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..8662233a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,185 +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 @@ -335,4 +153,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/Makefile b/Makefile index 29cf0495..373d4c88 100644 --- a/Makefile +++ b/Makefile @@ -13,17 +13,7 @@ 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;\ diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 0ce7c657..4f56c016 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -31,23 +31,22 @@ 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 = path.existsSync; +else + path.existsSync = fs.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]; @@ -67,24 +66,22 @@ function main(args) { ace(); } else if (type == "demo") { demo(); + } else if (type == "bm") { + bookmarklet(); } else if (type == "full") { - ace(); - demo(); - } else if (type == "highlighter") { - // TODO + demo(ace()); + 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(" 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(" bm Runs bookmarklet build of Ace"); + console.log(" full all of above"); console.log("args:"); console.log(" --target ./path path to build folder"); console.log("flags:"); @@ -93,34 +90,94 @@ function showHelp(type) { console.log(" --nc namespace require"); console.log(" --s shrinkwrap (combines all output files into one)"); 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) +} + +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 + var project = 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"); + 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" + }); - console.log('# ace ---------'); - for (var i = 0; i < 4; i++) - buildAce({compress: i & 2, noconflict: i & 1}); + return project; } -function demo() { +function demo(project) { + project = project || buildAce({ + compress: false, + noconflict: false, + coreOnly: true + }); 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(" - - - - -
- \ No newline at end of file +

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 | DOMElement

Required. 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..f3f25cd1 100644 --- a/api/anchor.html +++ b/api/anchor.html @@ -1,272 +1,33 @@ - -
-
-
-
-
-

Anchor -

- -
-
-
-
-

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

docDocument

Required. The document to associate with the anchor

-
rowNumber

Required. The starting row position

-
columnNumber

Required. The starting column position

-
-
-
-
-
-
-

Events

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

Fires whenever the anchor position changes.

- -
-

Fires whenever the anchor position changes.

-

Both of these objects have a row and column property corresponding to the position.

+

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

docDocument

Required. The document to associate with the anchor

+
rowNumber

Required. The starting row position

+
columnNumber

Required. The starting column position

+

Events

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

    Fires whenever the anchor position changes.

    +

    Fires whenever the anchor position changes.

    Events that can trigger this function include setPosition().

    - -

    Arguments

    eObject

    Required. An object containing information about the anchor position. It has two properties:

    +

    Arguments

    eObject

    Required. 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
    • +
    • old: An object describing the old Anchor position

      +
    • +
    • value: An object describing the new Anchor position

      +

      Both of these objects have a row and column property corresponding to the position.

      +
    -
    - - - - - -

    Methods

    -
    -
    -
    -
    -
      -
    • -
        -
      • Anchor.detach()
      • -
      -
        -
      -
    • -
    -
    -
    -

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

    - -
    -

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

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
      -
    • -
        -
      • Anchor.getDocument() -
      • - -
      • -
      -
        -
      -
    • -
    -
    -
    -

    Returns the current document.

    - -
    -

    Returns the current document.

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
      -
    • -
        -
      • Anchor.getPosition() -
      • - -
      • -
      -
        -
      -
    • -
    -
    -
    -

    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.

    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
      -
    • -
        -
      • Anchor.onChange()
      • -
      -
        -
      • Undocumented
      • -
      -
    • -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -

    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

    rowNumber

    Required. The row index to move the anchor to

    -
    columnNumber

    Required. The column index to move the anchor to

    -
    noClipBoolean

    Required. Identifies if you want the position to be clipped

    -
    -
    -
    -
    -
    -
    - - - - - - -
    - \ No newline at end of file +

    Methods

      • Internal

    Clips the anchor position to the specified row and column.

    +

    Clips the anchor position to the specified row and column.

    +

    Arguments

    rowNumber

    Required. The row index to clip the anchor to

    +
    columnNumber

    Required. 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

      rowNumber

      Required. The row index to move the anchor to

      +
      columnNumber

      Required. The column index to move the anchor to

      +
      noClipBoolean

      Required. 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..8a11bcee 100644 --- a/api/background_tokenizer.html +++ b/api/background_tokenizer.html @@ -1,320 +1,30 @@ - -
      -
      -
      -
      -
      -

      BackgroundTokenizer -

      - -
      -
      -
      -
      -

      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

      tokenizerTokenizer

      Required. The tokenizer to use

      -
      editorEditor

      Required. The editor to associate with

      -
      -
      -
      -
      -
      -
      -

      Events

      -
      -
      -
      -
      -
        -
      • -
          -
        • BackgroundTokenizer.on("update", function(Object e))
        • -
        -
          -
        -
      • -
      -
      -
      -

      Fires whenever the background tokeniziers between a range of rows are going to be updated.

      - -
      -

      Fires whenever the background tokeniziers between a range of rows are going to be updated.

      - -

      Arguments

      eObject

      Required. An object containing two properties, first and last, which indicate the rows of the region being updated.

      -
      -
      -
      -
      -
      -
      -

      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

      firstRowNumber

      Required. The starting row region

      -
      lastRowNumber

      Required. The final row region

      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
        -
      • -
          -
        • BackgroundTokenizer.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 get state at

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

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

      - -
      -

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

      - -

      Arguments

      rowNumber

      Required. 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

      docDocument

      Required. 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

      tokenizerTokenizer

      Required. The new tokenizer to use

      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
        -
      • -
          -
        • BackgroundTokenizer.start(Number startRow)
        • -
        -
          -
        -
      • -
      -
      -
      -

      Starts tokenizing at the row indicated.

      - -
      -

      Starts tokenizing at the row indicated.

      - -

      Arguments

      startRowNumber

      Required. The row to start at

      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
        -
      • -
          -
        • BackgroundTokenizer.stop()
        • -
        -
          -
        -
      • -
      -
      -
      -

      Stops tokenizing.

      - -
      -

      Stops tokenizing.

      - -
      -
      -
      -
      -
      -
      - - - - - -
      -
      \ No newline at end of file +

      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

      tokenizerTokenizer

      Required. The tokenizer to use

      +
      editorEditor

      Required. The editor to associate with

      +

      Events

        • BackgroundTokenizer.on("update", function(Object e))

        Fires whenever the background tokeniziers between a range of rows are going to be updated.

        +

        Fires whenever the background tokeniziers between a range of rows are going to be updated.

        +

        Arguments

        eObject

        Required. An object containing two properties, first and last, which indicate the rows of the region being updated.

        +

        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

          firstRowNumber

          Required. The starting row region

          +
          lastRowNumber

          Required. 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

          rowNumber

          Required. 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

          rowNumber

          Required. 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

            docDocument

            Required. 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

              tokenizerTokenizer

              Required. The new tokenizer to use

              +
                • BackgroundTokenizer.start(Number startRow)

                Starts tokenizing at the row indicated.

                +

                Starts tokenizing at the row indicated.

                +

                Arguments

                startRowNumber

                Required. 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..b580d309 100644 --- a/api/command_manager.html +++ b/api/command_manager.html @@ -1,55 +1,5 @@ - -
                  -
                  -
                  -
                  -
                  -

                  CommandManager -

                  - -
                  -
                  -
                  -
                  -

                  new CommandManager(platform, commands)

                  - -
                  -
                  -
                  -
                  - - - - - -
                  -
                  \ No newline at end of file +

                  Constructors

                  TODO

                  +

                  TODO

                  +

                  Arguments

                  platformString

                  Required. Identifier for the platform; must be either 'mac' or 'win'

                  +
                  commandsArray

                  Required. A list of commands

                  +
                  \ No newline at end of file diff --git a/api/document.html b/api/document.html index f1fc2ff5..577fe66f 100644 --- a/api/document.html +++ b/api/document.html @@ -1,927 +1,146 @@ - -
                  -
                  -
                  -
                  - -
                  -
                  -
                  -

                  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 | Array

                  Required. The starting text

                  -
                  -
                  -
                  -
                  -
                  -
                  -

                  Events

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

                  Fires whenever the document changes.

                  - -
                  -

                  Fires whenever the document changes.

                  +

                  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 | Array

                  Required. The starting text

                  +

                  Events

                    • Document.on("change", function(Object e))

                    Fires whenever the document changes.

                    +

                    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:

                    -
                    -
                    -
                    -
                    -

                    Methods

                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.applyDeltas(Object deltas)
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    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'.

                    - -

                    Arguments

                    deltasObject

                    Required.

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

                    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

                    rowNumber

                    Required. The row number to use

                    -
                    columnNumber

                    Required. The column number to use

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.getAllLines()
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    Returns all lines in the document as string array.

                    - -
                    -

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

                    - -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.getLength()
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    Returns the number of rows in the document.

                    - -
                    -

                    Returns the number of rows in the document.

                    - -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.getLine(Number row)
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    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 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

                    firstRowNumber

                    Required. The first row index to retrieve

                    -
                    lastRowNumber

                    Required. 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

                    - -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.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

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.getValue()
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    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.

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

                    Converts an index position in a document to a {row, column} object.

                    - -
                    -

                    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:

                    -
                    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.

                    - -

                    Arguments

                    indexNumber

                    Required. An index to convert

                    -
                    startRowNumber

                    Required. =0 The row from which to start the conversion

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

                    Inserts a block of text and the indicated position.

                    - -
                    -

                    Inserts a block of text and the indicated position.

                    - -

                    Arguments

                    positionObject

                    Required. The position to start inserting at

                    -
                    textString

                    Required. 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

                    positionObject

                    Required. The position to insert at

                    -
                    textString

                    Required. 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

                    rowNumber

                    Required. The index of the row to insert at

                    -
                    linesArray

                    Required. An array of strings

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.insertNewLine(Object position) -
                      • - -
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    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

                    positionObject

                    Required. The position to insert at

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.isNewLine(String text)
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    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

                    textString

                    Required. The text to check

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

                    Converts the {row, column} position in a document to the character's index.

                    - -
                    -

                    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:

                    -
                    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.

                    - -

                    Arguments

                    posObject

                    Required. The {row, column} to convert

                    -
                    startRowNumber

                    Required. =0 The row from which to start the conversion

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

                    Removes the range from the document.

                    - -
                    -

                    Removes the range from the document.

                    - -

                    Arguments

                    rangeRange

                    Required. 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

                    rowNumber

                    Required. The row to remove from

                    -
                    startColumnNumber

                    Required. The column to start removing at

                    -
                    endColumnNumber

                    Required. 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

                    firstRowNumber

                    Required. The first row to be removed

                    -
                    lastRowNumber

                    Required. The last row to be removed

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.removeNewLine(Number row)
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    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

                    rowNumber

                    Required. 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

                    rangeRange

                    Required. A specified Range to replace

                    -
                    textString

                    Required. The new text to use as a replacement

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.revertDeltas(Object deltas)
                      • -
                      -
                        -
                      -
                    • -
                    -
                    -
                    -

                    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'.

                    - -

                    Arguments

                    deltasObject

                    Required.

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    -
                      -
                    • -
                        -
                      • Document.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

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

                    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

                    textString

                    Required. The text to use

                    -
                    -
                    -
                    -
                    -
                    -
                    -
                    - - - - - -
                    -
                    \ No newline at end of file + + +

                    Arguments

                    eObject

                    Required. Contains at least one property called "action". "action" indicates the action that triggered the change. Each action also has a set of additional properties.

                    +

                    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

                    textString

                    Required. The text to work with

                    +

                    Returns

                    Array of Strings

                    A String array, with each index containing a piece of the original text string.

                    +
                      • 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

                      rowNumber

                      Required. The row number to use

                      +
                      columnNumber

                      Required. 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

                        rowNumber

                        Required. 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

                        firstRowNumber

                        Required. The first row index to retrieve

                        +
                        lastRowNumber

                        Required. 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.

                          +

                          Returns

                          String

                          If newLineMode == windows, \r\n is returned.

                          +
                            +
                          • If newLineMode == unix, \n is returned.

                            +
                          • +
                          • If newLineMode == auto, the value of autoNewLine is returned.

                            +
                          • +
                          +
                            • 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

                            rangeRange

                            Required. 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

                            positionNumber

                            Required. The position to start inserting at

                            +
                            textString

                            Required. A chunk of text to insert

                            +

                            Returns

                            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 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

                            positionNumber

                            Required. The position to insert at

                            +
                            textString

                            Required. A chunk of text

                            +

                            Returns

                            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 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

                            rowNumber

                            Required. The index of the row to insert at

                            +
                            linesArray

                            Required. An array of strings

                            +

                            Returns

                            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}

                              +
                            • +
                            +

                            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

                            positionString

                            Required. The position to insert at

                            +

                            Returns

                            Object

                            Returns an object containing the final row and column, like this:

                            +
                              +
                            • {row: endRow, column: 0}
                            • +
                            +

                            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

                            textString

                            Required. The text to check

                            +

                            Removes the range from the document.

                            +

                            Removes the range from the document.

                            +

                            Arguments

                            rangeRange

                            Required. 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.

                            +

                            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

                            rowNumber

                            Required. The row to remove from

                            +
                            startColumnNumber

                            Required. The column to start removing at

                            +
                            endColumnNumber

                            Required. 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.

                            +

                            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

                            firstRowNumber

                            Required. The first row to be removed

                            +
                            lastRowNumber

                            Required. The last row to be removed

                            +

                            Returns

                            Array of Strings

                            Returns all the removed lines.

                            +
                              • 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

                              rowNumber

                              Required. 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

                              rangeRange

                              Required. A specified Range to replace

                              +
                              textString

                              Required. The new text to use as a replacement

                              +

                              Returns

                              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.

                                +
                              • +
                              +
                                • 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

                                  newLineModeString

                                  Required. 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

                                    textString

                                    Required. The text to use

                                    +
                                    \ No newline at end of file diff --git a/api/edit_session.html b/api/edit_session.html index 11e79ed0..398d61c3 100644 --- a/api/edit_session.html +++ b/api/edit_session.html @@ -1,3235 +1,306 @@ - -
                                    -
                                    -
                                    -
                                    -
                                    -

                                    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.

                                    +

                                    EditSession [edit]

                                    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(e))

                                            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("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("loadMode", function(e))
                                                            • 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

                                                              • 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

                                                            textString

                                                            Required. 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

                                                            strString

                                                            Required. The string to check

                                                            +
                                                            offsetNumber

                                                            Required. 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

                                                            strString

                                                            Required. The string to calculate the screen width of

                                                            +
                                                            maxScreenColumnNumber

                                                            Required.

                                                            +
                                                            screenColumnNumber

                                                            Required.

                                                            +

                                                            Returns

                                                            Array of Numbers

                                                            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.

                                                              +
                                                            • +
                                                            +
                                                              • EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange)
                                                              • Internal
                                                              • EditSession.$resetRowCache(Number row)
                                                              • Internal

                                                            Arguments

                                                            rowNumber

                                                            Required. 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

                                                            markerObject

                                                            Required. object with update method

                                                            +
                                                            inFrontBoolean

                                                            Required. 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

                                                              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

                                                              +

                                                              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

                                                              desiredLimitNumber

                                                              Required. 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

                                                                  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.

                                                                    +
                                                                      • 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

                                                                    docRowNumber

                                                                    Required. The document row to check

                                                                    +
                                                                    docColumnNumber

                                                                    Required. The document column to check

                                                                    +

                                                                    Returns

                                                                    Object

                                                                    The object returned by this method has two properties: row and column.

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

                                                                    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

                                                                    +

                                                                    Returns

                                                                    Number

                                                                    Returns the number of new rows added; in other words, lastRow - firstRow + 1.

                                                                    +
                                                                      • 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.

                                                                        +

                                                                        Returns the Document associated with this session.

                                                                        +

                                                                        Returns the Document associated with this session.

                                                                        +
                                                                          • EditSession.getDocumentLastRowColumnPosition(docRow, docColumn)
                                                                          • Internal
                                                                          • Related to:

                                                                        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

                                                                        +

                                                                        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

                                                                        +

                                                                        Returns the current text mode.

                                                                        +

                                                                        Returns the current text mode.

                                                                        +
                                                                          • EditSession.getNewLineMode()
                                                                          • Related to:

                                                                        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

                                                                        rowNumber

                                                                        Required. The row number to check

                                                                        +
                                                                          • EditSession.getRowSplitData(row)
                                                                          • Internal
                                                                          • Internal
                                                                          • Related to:

                                                                        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

                                                                        screenRowNumber

                                                                        Required. 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

                                                                          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.

                                                                                +

                                                                                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

                                                                                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'.

                                                                                    +
                                                                                      • Related to:

                                                                                    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

                                                                                    +

                                                                                    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

                                                                                    +

                                                                                    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

                                                                                        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 }
                                                                                            +

                                                                                            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.

                                                                                            +

                                                                                            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

                                                                                            positionNumber

                                                                                            Required. The position to start inserting at

                                                                                            +
                                                                                            textString

                                                                                            Required. A chunk of text to insert

                                                                                            +

                                                                                            Returns

                                                                                            Number

                                                                                            The position of the last line of text. If the length of text is 0, this function simply returns 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

                                                                                            +

                                                                                            Arguments

                                                                                            firstRowNumber

                                                                                            Required. The starting row to move down

                                                                                            +
                                                                                            lastRowNumber

                                                                                            Required. 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.

                                                                                            +

                                                                                            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

                                                                                            +

                                                                                            Returns

                                                                                            Number

                                                                                            If firstRow is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1.

                                                                                            +

                                                                                            { row: newRowLocation, column: newColumnLocation }

                                                                                            +

                                                                                            { 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

                                                                                            +

                                                                                            Returns

                                                                                            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:
                                                                                            • +
                                                                                            +
                                                                                              • EditSession.onReloadTokenizer(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.

                                                                                              +
                                                                                                • 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

                                                                                                +

                                                                                                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

                                                                                                +

                                                                                                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.

                                                                                                +
                                                                                                  • EditSession.removeGutterDecoration(Number row, String className)
                                                                                                    • Void

                                                                                                  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

                                                                                                    +

                                                                                                    Returns

                                                                                                    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.

                                                                                                      +
                                                                                                    • +
                                                                                                    +
                                                                                                      • EditSession.screenToDocumentColumn(screenRow, screenColumn)
                                                                                                      • Internal
                                                                                                      • Related to:

                                                                                                    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

                                                                                                    +

                                                                                                    Returns

                                                                                                    Object

                                                                                                    The object returned has two properties: row and column.

                                                                                                    +
                                                                                                      • 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

                                                                                                      annotationsArray

                                                                                                      Required. 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

                                                                                                      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 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

                                                                                                        docDocument

                                                                                                        Required. 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

                                                                                                        modeTextMode

                                                                                                        Required. Set a new text mode

                                                                                                        +
                                                                                                          • EditSession.setNewLineMode(String newLineMode)
                                                                                                          • Related to:

                                                                                                        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 +

                                                                                                          Arguments

                                                                                                          overwriteBoolean

                                                                                                          Required. 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

                                                                                                              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

                                                                                                                +

                                                                                                                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.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

                                                                                                                            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 diff --git a/api/editor.html b/api/editor.html index 6ffe4369..f2493025 100644 --- a/api/editor.html +++ b/api/editor.html @@ -1,4689 +1,343 @@ - -
                                                                                                                            -
                                                                                                                            -
                                                                                                                            -
                                                                                                                            -
                                                                                                                            -

                                                                                                                            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 [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

                                                                                                                            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("changeSelection", function())

                                                                                                                                  Emitted when the selection changes.

                                                                                                                                  +

                                                                                                                                  Emitted when the selection changes.

                                                                                                                                  +
                                                                                                                                    • 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(String text))

                                                                                                                                          Emitted when text is pasted.

                                                                                                                                          +

                                                                                                                                          Emitted when text is pasted.

                                                                                                                                          +

                                                                                                                                          Arguments

                                                                                                                                          textString

                                                                                                                                          Required. The pasted text

                                                                                                                                          +

                                                                                                                                          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

                                                                                                                                              moverFunction

                                                                                                                                              Required. 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

                                                                                                                                                orientedRangeRange

                                                                                                                                                Required. A range containing a cursor

                                                                                                                                                +
                                                                                                                                                  • Editor.alignCursors()

                                                                                                                                                  aligns cursors or selected text

                                                                                                                                                  +

                                                                                                                                                  aligns cursors or selected text

                                                                                                                                                  +
                                                                                                                                                    • Editor.blockOutdent()
                                                                                                                                                    • Related to:

                                                                                                                                                  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()
                                                                                                                                                        • Related to:

                                                                                                                                                      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.

                                                                                                                                                      +
                                                                                                                                                        • Related to:

                                                                                                                                                      Copies all the selected lines down one row.

                                                                                                                                                      +

                                                                                                                                                      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 to:

                                                                                                                                                      Copies all the selected lines up one row.

                                                                                                                                                      +

                                                                                                                                                      Copies all the selected lines up one row.

                                                                                                                                                      +

                                                                                                                                                      Returns

                                                                                                                                                      Number

                                                                                                                                                      On success, returns 0.

                                                                                                                                                      +
                                                                                                                                                        • 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

                                                                                                                                                          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

                                                                                                                                                          needleString

                                                                                                                                                          Required. The text to find

                                                                                                                                                          +
                                                                                                                                                          optionsObject

                                                                                                                                                          Required. The search options

                                                                                                                                                          +
                                                                                                                                                          additiveBoolean

                                                                                                                                                          Required. 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

                                                                                                                                                          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.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.

                                                                                                                                                              +
                                                                                                                                                                • Editor.getCursorPosition()
                                                                                                                                                                • Related to:

                                                                                                                                                              Gets the current position of the cursor.

                                                                                                                                                              +

                                                                                                                                                              Gets the current position of the cursor.

                                                                                                                                                              +

                                                                                                                                                              Returns

                                                                                                                                                              Object

                                                                                                                                                              This returns an object that looks something like this:

                                                                                                                                                              +
                                                                                                                                                                +
                                                                                                                                                              • { row: currRow, column: currCol }
                                                                                                                                                              • +
                                                                                                                                                              +
                                                                                                                                                                • Editor.getCursorPositionScreen()
                                                                                                                                                                • Related to:

                                                                                                                                                              Returns the screen position of the cursor.

                                                                                                                                                              +

                                                                                                                                                              Returns the screen position of the cursor.

                                                                                                                                                              +

                                                                                                                                                              Returns the current mouse drag delay.

                                                                                                                                                              +

                                                                                                                                                              Returns the current mouse drag delay.

                                                                                                                                                              +
                                                                                                                                                                • Editor.getFirstVisibleRow()
                                                                                                                                                                • Related to:

                                                                                                                                                              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.getHighlightSelectedWord()

                                                                                                                                                                  Returns true if currently highlighted words are to be highlighted.

                                                                                                                                                                  +

                                                                                                                                                                  Returns true if currently highlighted words are to be highlighted.

                                                                                                                                                                  +
                                                                                                                                                                    • Editor.getKeyboardHandler()
                                                                                                                                                                    • Related to:

                                                                                                                                                                  Returns the keyboard handler.

                                                                                                                                                                  +

                                                                                                                                                                  Returns the keyboard handler.

                                                                                                                                                                  +
                                                                                                                                                                    • Editor.getLastSearchOptions()
                                                                                                                                                                    • Related to:

                                                                                                                                                                  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()
                                                                                                                                                                    • Related to:

                                                                                                                                                                  Returns the index of the last visible row.

                                                                                                                                                                  +

                                                                                                                                                                  Returns the index of the last visible row.

                                                                                                                                                                  +
                                                                                                                                                                    • Related to:

                                                                                                                                                                  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.getSelectionRange()
                                                                                                                                                                      • Related to:

                                                                                                                                                                    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.

                                                                                                                                                                      +

                                                                                                                                                                      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.

                                                                                                                                                                      +
                                                                                                                                                                        • Related to:

                                                                                                                                                                      Returns the path of the current theme.

                                                                                                                                                                      +

                                                                                                                                                                      Returns the path of the current theme.

                                                                                                                                                                      +
                                                                                                                                                                        • Related to:

                                                                                                                                                                      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

                                                                                                                                                                      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()
                                                                                                                                                                            • Related to:

                                                                                                                                                                          Indents the current line.

                                                                                                                                                                          +

                                                                                                                                                                          Indents the current line.

                                                                                                                                                                          +

                                                                                                                                                                          Inserts text into wherever the cursor is pointing.

                                                                                                                                                                          +

                                                                                                                                                                          Inserts text into wherever the cursor is pointing.

                                                                                                                                                                          +

                                                                                                                                                                          Arguments

                                                                                                                                                                          textString

                                                                                                                                                                          Required. 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

                                                                                                                                                                          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()

                                                                                                                                                                            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

                                                                                                                                                                            rowNumber

                                                                                                                                                                            Required. The new row number

                                                                                                                                                                            +
                                                                                                                                                                            columnNumber

                                                                                                                                                                            Required. The new column number

                                                                                                                                                                            +
                                                                                                                                                                              • Editor.moveCursorToPosition(Object pos)
                                                                                                                                                                              • Related to:

                                                                                                                                                                            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

                                                                                                                                                                            +
                                                                                                                                                                              • Related to:

                                                                                                                                                                            Shifts all the selected lines down one row.

                                                                                                                                                                            +

                                                                                                                                                                            Shifts all the selected lines down one row.

                                                                                                                                                                            +

                                                                                                                                                                            Returns

                                                                                                                                                                            Number

                                                                                                                                                                            On success, it returns -1.

                                                                                                                                                                            +
                                                                                                                                                                              • Related to:

                                                                                                                                                                            Shifts all the selected lines up one row.

                                                                                                                                                                            +

                                                                                                                                                                            Shifts all the selected lines up one row.

                                                                                                                                                                            +

                                                                                                                                                                            Returns

                                                                                                                                                                            Number

                                                                                                                                                                            On success, it returns -1.

                                                                                                                                                                            +

                                                                                                                                                                            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

                                                                                                                                                                            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

                                                                                                                                                                            +

                                                                                                                                                                            Returns

                                                                                                                                                                            Range

                                                                                                                                                                            The new range where the text was moved 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

                                                                                                                                                                              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.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.

                                                                                                                                                                                                    +

                                                                                                                                                                                                    Called whenever a text "paste" happens.

                                                                                                                                                                                                    +

                                                                                                                                                                                                    Called whenever a text "paste" happens.

                                                                                                                                                                                                    +

                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                    textString

                                                                                                                                                                                                    Required. The pasted text

                                                                                                                                                                                                    +
                                                                                                                                                                                                      • Editor.redo()
                                                                                                                                                                                                      • Related to:

                                                                                                                                                                                                    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

                                                                                                                                                                                                    dirString

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

                                                                                                                                                                                                    +
                                                                                                                                                                                                      • Editor.removeLines()
                                                                                                                                                                                                      • Related to:

                                                                                                                                                                                                    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

                                                                                                                                                                                                      rangeRange

                                                                                                                                                                                                      Required. 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

                                                                                                                                                                                                              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

                                                                                                                                                                                                              +
                                                                                                                                                                                                                • Related to:

                                                                                                                                                                                                              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.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

                                                                                                                                                                                                                  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(Number row)
                                                                                                                                                                                                                    • Related to:

                                                                                                                                                                                                                  Moves the editor to the specified row.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Moves the editor to the specified row.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                  rowNumber

                                                                                                                                                                                                                  Required. The row to move to

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                    • Editor.selectAll()
                                                                                                                                                                                                                    • Related 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

                                                                                                                                                                                                                  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.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.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.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.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(keyboardHandler)

                                                                                                                                                                                                                                  Sets a new keyboard handler.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Sets a new keyboard handler.

                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                    • Editor.setOverwrite(Boolean overwrite)
                                                                                                                                                                                                                                    • Related to:

                                                                                                                                                                                                                                  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

                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                          • 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

                                                                                                                                                                                                                                          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 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

                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                  • Related to:

                                                                                                                                                                                                                                                Adds a new class, style, to the editor.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Adds a new class, style, to the editor.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                styleString

                                                                                                                                                                                                                                                Required. A class name

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                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.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).

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                      • Editor.toggleOverwrite()
                                                                                                                                                                                                                                                      • Related to:

                                                                                                                                                                                                                                                    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()
                                                                                                                                                                                                                                                              • Related to:

                                                                                                                                                                                                                                                            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.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                              • Editor.unsetStyle(style)
                                                                                                                                                                                                                                                              • Related to:

                                                                                                                                                                                                                                                            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..a4f1f307 100644 --- a/api/index.html +++ b/api/index.html @@ -1,12 +1,4 @@ - -

                                                                                                                                                                                                                                                              Ace API Reference

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              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 +
                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/api/placeholder.html b/api/placeholder.html index fa12a958..98aa0b55 100644 --- a/api/placeholder.html +++ b/api/placeholder.html @@ -1,293 +1,24 @@ - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder -

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • new PlaceHolder()
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • session (Document): The document to associate with the anchor
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • length (Number): The starting row position
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • pos (Number): The starting column position
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • others (String):
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • mainClass (String):
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • othersClass (String):
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • session (Document): The document to associate with the anchor
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • length (Number): The starting row position
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • pos (Number): The starting column position
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • others (String):
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • mainClass (String):
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • othersClass (String):
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • PlaceHolder.cancel()
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.cancel()

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.cancel()

                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              TODO

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • PlaceHolder.detach()
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.detach()

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.detach()

                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              TODO

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • PlaceHolder.hideOtherMarkers()
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.hideOtherMarkers()

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.hideOtherMarkers()

                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              Hides all over markers in the EditSession that are not the currently selected one.

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • PlaceHolder.onCursorChange(Object event)
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder@onCursorChange(e)

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder@onCursorChange(e)

                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              Emitted when the cursor changes.

                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                              eventObject

                                                                                                                                                                                                                                                              Required.

                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • PlaceHolder.onUpdate(Object event)
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder@onUpdate(e)

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder@onUpdate(e)

                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              Emitted when the place holder updates.

                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                              eventObject

                                                                                                                                                                                                                                                              Required.

                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • PlaceHolder.setup()
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.setup()

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.setup()

                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              TODO

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                • PlaceHolder.showOtherMarkers()
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.showOtherMarkers()

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              PlaceHolder.showOtherMarkers()

                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                              TODO

                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              - - - - - -
                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                              \ No newline at end of file +

                                                                                                                                                                                                                                                              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..19f69645 100644 --- a/api/range.html +++ b/api/range.html @@ -1,968 +1,297 @@ - -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            Range -

                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.

                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            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

                                                                                                                                                                                                                                                                            startRowNumber

                                                                                                                                                                                                                                                                            Required. The starting row

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            startColumnNumber

                                                                                                                                                                                                                                                                            Required. The starting column

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            endRowNumber

                                                                                                                                                                                                                                                                            Required. The ending row

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            endColumnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            firstRowNumber

                                                                                                                                                                                                                                                                            Required. The starting row

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            lastRowNumber

                                                                                                                                                                                                                                                                            Required. The ending row

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • Range.clone() -
                                                                                                                                                                                                                                                                              • - -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            pRange

                                                                                                                                                                                                                                                                            Required. A point to compare with

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

                                                                                                                                                                                                                                                                            Compares this range (A) with another range (B).

                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            Compares this range (A) with another range (B).

                                                                                                                                                                                                                                                                            - -

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rangeRange

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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:

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                               this.start.row <= row <= this.end.row &&
                                                                                                                                                                                                                                                                            -   this.start.column <= column <= this.end.column
                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row to check for

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rangeRange

                                                                                                                                                                                                                                                                            Required. A range to compare with

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

                                                                                                                                                                                                                                                                            Changes the row and column points for the calling range for both the starting and ending points.

                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            Changes the row and column points for the calling range for both the starting and ending points.

                                                                                                                                                                                                                                                                            - -

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A new row to extend to

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            startRange

                                                                                                                                                                                                                                                                            Required. A starting point to use

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            endRange

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rangeRange

                                                                                                                                                                                                                                                                            Required. A range to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • Range.isEmpty()
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • Undocumented
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. A column point to compare with

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

                                                                                                                                                                                                                                                                            Returns true if and only if the starting row and column, and ending row and column, are equivalent to those given by range.

                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            Returns true if and only if the starting row and column, and ending row and column, are equivalent to those given by range.

                                                                                                                                                                                                                                                                            - -

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rangeRange

                                                                                                                                                                                                                                                                            Required. A range to check against

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • Range.isMultiLine() -
                                                                                                                                                                                                                                                                              • - -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to compare with

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to set

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. A column point to set

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

                                                                                                                                                                                                                                                                            Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                            - -

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumber

                                                                                                                                                                                                                                                                            Required. A row point to set

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            columnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            sessionEditSession

                                                                                                                                                                                                                                                                            Required. The EditSession to retrieve coordinates from

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • Range.toString() -
                                                                                                                                                                                                                                                                              • - -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            Returns a string containing the range's row and column information, given like this:

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                               [start.row/start.column] -> [end.row/end.column]
                                                                                                                                                                                                                                                                            - -
                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                            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 +

                                                                                                                                                                                                                                                                            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

                                                                                                                                                                                                                                                                            startRowNumber

                                                                                                                                                                                                                                                                            Required. The starting row

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            startColumnNumber

                                                                                                                                                                                                                                                                            Required. The starting column

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            endRowNumber

                                                                                                                                                                                                                                                                            Required. The ending row

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            endColumnNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                            firstRowNumber

                                                                                                                                                                                                                                                                            Required. The starting row

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            lastRowNumber

                                                                                                                                                                                                                                                                            Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. A column point to compare with

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Returns

                                                                                                                                                                                                                                                                              Number

                                                                                                                                                                                                                                                                              This method returns one of the following numbers:

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 0 if the two points are exactly equal
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • -1 if p.row is less then the calling range
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 1 if p.row is greater than the calling range
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the starting row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is greater than or equal to the calling range's starting column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns -1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the ending row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is less than or equal to the calling range's ending column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns 1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. A column point to compare with

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Returns

                                                                                                                                                                                                                                                                              Number

                                                                                                                                                                                                                                                                              This method returns one of the following numbers:

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 0 if the two points are exactly equal
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • -1 if p.row is less then the calling range
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 1 if p.row is greater than the calling range, or if isEnd is `true.
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the starting row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is greater than or equal to the calling range's starting column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns -1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                *

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the ending row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is less than or equal to the calling range's ending column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns 1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. A column point to compare with

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Returns

                                                                                                                                                                                                                                                                              Number

                                                                                                                                                                                                                                                                              This method returns one of the following numbers:

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 1 if the ending row of the calling range is equal to row, and the ending column of the calling range is equal to column
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • -1 if the starting row of the calling range is equal to row, and the starting column of the calling range is equal to column
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • Otherwise, it returns the value after calling compare().

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                              pRange

                                                                                                                                                                                                                                                                              Required. A point to compare with

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Returns

                                                                                                                                                                                                                                                                              Number

                                                                                                                                                                                                                                                                              This method returns one of the following numbers:

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 0 if the two points are exactly equal
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • -1 if p.row is less then the calling range
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 1 if p.row is greater than the calling range
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the starting row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is greater than or equal to the calling range's starting column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns -1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                *

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the ending row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is less than or equal to the calling range's ending column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns 1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Compares this range (A) with another range (B).

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Compares this range (A) with another range (B).

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                              rangeRange

                                                                                                                                                                                                                                                                              Required. A range to compare with

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Returns

                                                                                                                                                                                                                                                                              Number

                                                                                                                                                                                                                                                                              This method returns one of the following numbers:

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • -2: (B) is in front of (A), and doesn't intersect with (A)
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • -1: (B) begins before (A) but ends inside of (A)
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 0: (B) is completely inside of (A) OR (A) is completely inside of (B)
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • +1: (B) begins inside of (A) but ends outside of (A)
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • +2: (B) is after (A) and doesn't intersect with (A)
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 42: FTW state: (B) ends in (A) but starts outside of (A)
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. A column point to compare with

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Returns

                                                                                                                                                                                                                                                                              Number

                                                                                                                                                                                                                                                                              This method returns one of the following numbers:

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 0 if the two points are exactly equal
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • -1 if p.row is less then the calling range
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • 1 if p.row is greater than the calling range, or if isStart is true.
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the starting row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is greater than or equal to the calling range's starting column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns -1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +

                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • If the ending row of the calling range is equal to p.row, and:

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • p.column is less than or equal to the calling range's ending column, this returns 0
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • Otherwise, it returns 1
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row to check for

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rangeRange

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A new row to extend to

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              startRange

                                                                                                                                                                                                                                                                              Required. A starting point to use

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              endRange

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rangeRange

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rangeRange

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to compare with

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to set

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. A column point to set

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                              rowNumber

                                                                                                                                                                                                                                                                              Required. A row point to set

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              columnNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              sessionEditSession

                                                                                                                                                                                                                                                                              Required. 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..26aa4d16 100644 --- a/api/renderloop.html +++ b/api/renderloop.html @@ -1,55 +1,3 @@ - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              RenderLoop -

                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Batches changes (that force something to be redrawn) in the background.

                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              - - - - - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              \ No newline at end of file +

                                                                                                                                                                                                                                                                              Batches changes (that force something to be redrawn) in the background.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                • new RenderLoop(onRender, win)
                                                                                                                                                                                                                                                                                • Internal

                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                • RenderLoop.schedule(Array change)
                                                                                                                                                                                                                                                                                • Internal

                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                              changeArray

                                                                                                                                                                                                                                                                              Required.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              \ No newline at end of file diff --git a/api/resources/csses/ace_api.css b/api/resources/csses/ace_api.css index 7a90b4c3..7080c7a5 100644 --- a/api/resources/csses/ace_api.css +++ b/api/resources/csses/ace_api.css @@ -14,16 +14,13 @@ color: black; } -pre { - background-color: #FFFFFF; -} - -code { +#documentation code { font-size: 12px; line-height: 16px; 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; @@ -64,6 +61,8 @@ code { } #documentation p { font-size: 13px; + line-height : 20px; + margin-bottom : 13px; } #documentation li p:last-child { margin-bottom : 5px; @@ -142,6 +141,26 @@ code { Menu venue */ +form.navbar-search { + float: none; +} + +form.navbar-search .search-query { + background-color: #FFFFFF; + border-color: #999; + -webkit-transition: border 0.3s; + -moz-transition: border 0.3s; + font-size: 14px; + line-height: 16px; +} + +form.navbar-search .search-query:focus, form.navbar-search .search-query:active { + border: 1px solid #666; +} + +.navbar-search .search-query:focus, .navbar-search .search-query.focused { + padding: 4px 9px; +} h3.api_title { padding-top: 10px; @@ -181,6 +200,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); @@ -276,18 +339,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 { @@ -335,10 +393,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 +413,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 +463,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 +501,10 @@ ul.tabs .double ul, ul.tabs .triple ul, ul.tabs .quad ul{ .content { height: 100%; } +.content .row { + margin-left: auto; + margin-right: auto; +} header.filler { position: relative; @@ -442,6 +512,11 @@ header.filler { width: 100%; } +.centerpiece { + min-height: 100%; + padding: 20px 0; +} + /* .container-fluid .row-fluid { width: 1000px; @@ -455,21 +530,26 @@ header.filler { margin-bottom: 3px; } +#sidebar { + margin-top: 5px; + /*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-left: 15px; padding-bottom: 10px; } @@ -491,6 +571,7 @@ div#documentation article:last-child { } #documentation article.article.methodToggleOpen { background: rgba(255, 255, 255, 0.5); + padding: 20px; font-size: 13px; line-height: 24px; margin: 0 0 10px 0; @@ -626,7 +707,7 @@ li.signature { .eventObjName { font-style: italic; } -.eventListenerStart, .eventListenerClose, .eventFunctionOpen, .eventFunctionClose { +.eventListenerStart, .eventFunctionOpen, .eventFunctionClose { color: #999999; } .eventMember { @@ -662,11 +743,6 @@ li.signature { text-transform: capitalize; } -.undocumented { - background-color: #B94A48; - color: #ffffff; -} - #documentation .alias a, #documentation .related-to a { color: #ffffff; /* text-decoration: underline; */ @@ -698,8 +774,8 @@ li.signature { color: #ffffff; } .description h4 { - padding-top: 10px; font-size: 18px; + margin: 20px 0 10px; line-height : 18px; } @@ -722,6 +798,10 @@ li.signature { Everyday I'm togglin' */ +#documentation h3 { + font-size: 24px; + margin-top: 5px; +} #documentation i.methodToggle { cursor: pointer; color: #9f9f9f; @@ -750,6 +830,7 @@ li.signature { } #documentation h3.sectionHeader { + margin: 10px 0 17px 0; line-height : 24px; } 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/font-awesome.css b/api/resources/csses/font-awesome.css new file mode 100644 index 00000000..4697599c --- /dev/null +++ b/api/resources/csses/font-awesome.css @@ -0,0 +1,303 @@ +/* Font Awesome + the iconic font designed for use with Twitter Bootstrap + ------------------------------------------------------- + The full suite of pictographic icons, examples, and documentation + can be found at: http://fortawesome.github.com/Font-Awesome/ + + License + ------------------------------------------------------- + The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0: + http://creativecommons.org/licenses/by/3.0/ A mention of + 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable + source code is considered acceptable attribution (most common on the web). + If human readable source code is not available to the end user, a mention in + an 'About' or 'Credits' screen is considered acceptable (most common in desktop + or mobile software). + + Contact + ------------------------------------------------------- + Email: dave@davegandy.com + Twitter: http://twitter.com/fortaweso_me + Work: http://lemonwi.se co-founder + + */ +@font-face { + font-family: "FontAwesome"; + src: url('../font/fontawesome-webfont.eot'); + src: url('../font/fontawesome-webfont.eot?#iefix') format('eot'), url('../font/fontawesome-webfont.woff') format('woff'), url('../font/fontawesome-webfont.ttf') format('truetype'), url('../font/fontawesome-webfont.svg#FontAwesome') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* Font Awesome styles + ------------------------------------------------------- */ +[class^="icon-"]:before, [class*=" icon-"]:before { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + display: inline-block; + text-decoration: inherit; +} +a [class^="icon-"], a [class*=" icon-"] { + display: inline-block; + text-decoration: inherit; +} +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: top; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-"], .btn [class*=" icon-"] { + /* keeps button heights with and without icons the same */ + + line-height: .9em; +} +li [class^="icon-"], li [class*=" icon-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li .icon-large[class^="icon-"], li .icon-large[class*=" icon-"] { + /* 1.5 increased font size for icon-large * 1.25 width */ + + width: 1.875em; +} +li[class^="icon-"], li[class*=" icon-"] { + margin-left: 0; + list-style-type: none; +} +li[class^="icon-"]:before, li[class*=" icon-"]:before { + text-indent: -2em; + text-align: center; +} +li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before { + text-indent: -1.3333333333333333em; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { content: "\f000"; } +.icon-music:before { content: "\f001"; } +.icon-search:before { content: "\f002"; } +.icon-envelope:before { content: "\f003"; } +.icon-heart:before { content: "\f004"; } +.icon-star:before { content: "\f005"; } +.icon-star-empty:before { content: "\f006"; } +.icon-user:before { content: "\f007"; } +.icon-film:before { content: "\f008"; } +.icon-th-large:before { content: "\f009"; } +.icon-th:before { content: "\f00a"; } +.icon-th-list:before { content: "\f00b"; } +.icon-ok:before { content: "\f00c"; } +.icon-remove:before { content: "\f00d"; } +.icon-zoom-in:before { content: "\f00e"; } + +.icon-zoom-out:before { content: "\f010"; } +.icon-off:before { content: "\f011"; } +.icon-signal:before { content: "\f012"; } +.icon-cog:before { content: "\f013"; } +.icon-trash:before { content: "\f014"; } +.icon-home:before { content: "\f015"; } +.icon-file:before { content: "\f016"; } +.icon-time:before { content: "\f017"; } +.icon-road:before { content: "\f018"; } +.icon-download-alt:before { content: "\f019"; } +.icon-download:before { content: "\f01a"; } +.icon-upload:before { content: "\f01b"; } +.icon-inbox:before { content: "\f01c"; } +.icon-play-circle:before { content: "\f01d"; } +.icon-repeat:before { content: "\f01e"; } + +/* \f020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { content: "\f021"; } +.icon-list-alt:before { content: "\f022"; } +.icon-lock:before { content: "\f023"; } +.icon-flag:before { content: "\f024"; } +.icon-headphones:before { content: "\f025"; } +.icon-volume-off:before { content: "\f026"; } +.icon-volume-down:before { content: "\f027"; } +.icon-volume-up:before { content: "\f028"; } +.icon-qrcode:before { content: "\f029"; } +.icon-barcode:before { content: "\f02a"; } +.icon-tag:before { content: "\f02b"; } +.icon-tags:before { content: "\f02c"; } +.icon-book:before { content: "\f02d"; } +.icon-bookmark:before { content: "\f02e"; } +.icon-print:before { content: "\f02f"; } + +.icon-camera:before { content: "\f030"; } +.icon-font:before { content: "\f031"; } +.icon-bold:before { content: "\f032"; } +.icon-italic:before { content: "\f033"; } +.icon-text-height:before { content: "\f034"; } +.icon-text-width:before { content: "\f035"; } +.icon-align-left:before { content: "\f036"; } +.icon-align-center:before { content: "\f037"; } +.icon-align-right:before { content: "\f038"; } +.icon-align-justify:before { content: "\f039"; } +.icon-list:before { content: "\f03a"; } +.icon-indent-left:before { content: "\f03b"; } +.icon-indent-right:before { content: "\f03c"; } +.icon-facetime-video:before { content: "\f03d"; } +.icon-picture:before { content: "\f03e"; } + +.icon-pencil:before { content: "\f040"; } +.icon-map-marker:before { content: "\f041"; } +.icon-adjust:before { content: "\f042"; } +.icon-tint:before { content: "\f043"; } +.icon-edit:before { content: "\f044"; } +.icon-share:before { content: "\f045"; } +.icon-check:before { content: "\f046"; } +.icon-move:before { content: "\f047"; } +.icon-step-backward:before { content: "\f048"; } +.icon-fast-backward:before { content: "\f049"; } +.icon-backward:before { content: "\f04a"; } +.icon-play:before { content: "\f04b"; } +.icon-pause:before { content: "\f04c"; } +.icon-stop:before { content: "\f04d"; } +.icon-forward:before { content: "\f04e"; } + +.icon-fast-forward:before { content: "\f050"; } +.icon-step-forward:before { content: "\f051"; } +.icon-eject:before { content: "\f052"; } +.icon-chevron-left:before { content: "\f053"; } +.icon-chevron-right:before { content: "\f054"; } +.icon-plus-sign:before { content: "\f055"; } +.icon-minus-sign:before { content: "\f056"; } +.icon-remove-sign:before { content: "\f057"; } +.icon-ok-sign:before { content: "\f058"; } +.icon-question-sign:before { content: "\f059"; } +.icon-info-sign:before { content: "\f05a"; } +.icon-screenshot:before { content: "\f05b"; } +.icon-remove-circle:before { content: "\f05c"; } +.icon-ok-circle:before { content: "\f05d"; } +.icon-ban-circle:before { content: "\f05e"; } + +.icon-arrow-left:before { content: "\f060"; } +.icon-arrow-right:before { content: "\f061"; } +.icon-arrow-up:before { content: "\f062"; } +.icon-arrow-down:before { content: "\f063"; } +.icon-share-alt:before { content: "\f064"; } +.icon-resize-full:before { content: "\f065"; } +.icon-resize-small:before { content: "\f066"; } +.icon-plus:before { content: "\f067"; } +.icon-minus:before { content: "\f068"; } +.icon-asterisk:before { content: "\f069"; } +.icon-exclamation-sign:before { content: "\f06a"; } +.icon-gift:before { content: "\f06b"; } +.icon-leaf:before { content: "\f06c"; } +.icon-fire:before { content: "\f06d"; } +.icon-eye-open:before { content: "\f06e"; } + +.icon-eye-close:before { content: "\f070"; } +.icon-warning-sign:before { content: "\f071"; } +.icon-plane:before { content: "\f072"; } +.icon-calendar:before { content: "\f073"; } +.icon-random:before { content: "\f074"; } +.icon-comment:before { content: "\f075"; } +.icon-magnet:before { content: "\f076"; } +.icon-chevron-up:before { content: "\f077"; } +.icon-chevron-down:before { content: "\f078"; } +.icon-retweet:before { content: "\f079"; } +.icon-shopping-cart:before { content: "\f07a"; } +.icon-folder-close:before { content: "\f07b"; } +.icon-folder-open:before { content: "\f07c"; } +.icon-resize-vertical:before { content: "\f07d"; } +.icon-resize-horizontal:before { content: "\f07e"; } + +.icon-bar-chart:before { content: "\f080"; } +.icon-twitter-sign:before { content: "\f081"; } +.icon-facebook-sign:before { content: "\f082"; } +.icon-camera-retro:before { content: "\f083"; } +.icon-key:before { content: "\f084"; } +.icon-cogs:before { content: "\f085"; } +.icon-comments:before { content: "\f086"; } +.icon-thumbs-up:before { content: "\f087"; } +.icon-thumbs-down:before { content: "\f088"; } +.icon-star-half:before { content: "\f089"; } +.icon-heart-empty:before { content: "\f08a"; } +.icon-signout:before { content: "\f08b"; } +.icon-linkedin-sign:before { content: "\f08c"; } +.icon-pushpin:before { content: "\f08d"; } +.icon-external-link:before { content: "\f08e"; } + +.icon-signin:before { content: "\f090"; } +.icon-trophy:before { content: "\f091"; } +.icon-github-sign:before { content: "\f092"; } +.icon-upload-alt:before { content: "\f093"; } +.icon-lemon:before { content: "\f094"; } +.icon-phone:before { content: "\f095"; } +.icon-check-empty:before { content: "\f096"; } +.icon-bookmark-empty:before { content: "\f097"; } +.icon-phone-sign:before { content: "\f098"; } +.icon-twitter:before { content: "\f099"; } +.icon-facebook:before { content: "\f09a"; } +.icon-github:before { content: "\f09b"; } +.icon-unlock:before { content: "\f09c"; } +.icon-credit-card:before { content: "\f09d"; } +.icon-rss:before { content: "\f09e"; } + +.icon-hdd:before { content: "\f0a0"; } +.icon-bullhorn:before { content: "\f0a1"; } +.icon-bell:before { content: "\f0a2"; } +.icon-certificate:before { content: "\f0a3"; } +.icon-hand-right:before { content: "\f0a4"; } +.icon-hand-left:before { content: "\f0a5"; } +.icon-hand-up:before { content: "\f0a6"; } +.icon-hand-down:before { content: "\f0a7"; } +.icon-circle-arrow-left:before { content: "\f0a8"; } +.icon-circle-arrow-right:before { content: "\f0a9"; } +.icon-circle-arrow-up:before { content: "\f0aa"; } +.icon-circle-arrow-down:before { content: "\f0ab"; } +.icon-globe:before { content: "\f0ac"; } +.icon-wrench:before { content: "\f0ad"; } +.icon-tasks:before { content: "\f0ae"; } + +.icon-filter:before { content: "\f0b0"; } +.icon-briefcase:before { content: "\f0b1"; } +.icon-fullscreen:before { content: "\f0b2"; } + +.icon-group:before { content: "\f0c0"; } +.icon-link:before { content: "\f0c1"; } +.icon-cloud:before { content: "\f0c2"; } +.icon-beaker:before { content: "\f0c3"; } +.icon-cut:before { content: "\f0c4"; } +.icon-copy:before { content: "\f0c5"; } +.icon-paper-clip:before { content: "\f0c6"; } +.icon-save:before { content: "\f0c7"; } +.icon-sign-blank:before { content: "\f0c8"; } +.icon-reorder:before { content: "\f0c9"; } +.icon-list-ul:before { content: "\f0ca"; } +.icon-list-ol:before { content: "\f0cb"; } +.icon-strikethrough:before { content: "\f0cc"; } +.icon-underline:before { content: "\f0cd"; } +.icon-table:before { content: "\f0ce"; } + +.icon-magic:before { content: "\f0d0"; } +.icon-truck:before { content: "\f0d1"; } +.icon-pinterest:before { content: "\f0d2"; } +.icon-pinterest-sign:before { content: "\f0d3"; } +.icon-google-plus-sign:before { content: "\f0d4"; } +.icon-google-plus:before { content: "\f0d5"; } +.icon-money:before { content: "\f0d6"; } +.icon-caret-down:before { content: "\f0d7"; } +.icon-caret-up:before { content: "\f0d8"; } +.icon-caret-left:before { content: "\f0d9"; } +.icon-caret-right:before { content: "\f0da"; } +.icon-columns:before { content: "\f0db"; } +.icon-sort:before { content: "\f0dc"; } +.icon-sort-down:before { content: "\f0dd"; } +.icon-sort-up:before { content: "\f0de"; } + +.icon-envelope-alt:before { content: "\f0e0"; } +.icon-linkedin:before { content: "\f0e1"; } +.icon-undo:before { content: "\f0e2"; } +.icon-legal:before { content: "\f0e3"; } +.icon-dashboard:before { content: "\f0e4"; } +.icon-comment-alt:before { content: "\f0e5"; } +.icon-comments-alt:before { content: "\f0e6"; } +.icon-bolt:before { content: "\f0e7"; } +.icon-sitemap:before { content: "\f0e8"; } +.icon-umbrella:before { content: "\f0e9"; } +.icon-paste:before { content: "\f0ea"; } + +.icon-user-md:before { content: "\f200"; } 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/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..4a2ffdbd 100644 --- a/api/resources/javascripts/ux.js +++ b/api/resources/javascripts/ux.js @@ -16,20 +16,17 @@ $(function () { 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 url = "https://www.google.com/search?q=" + encodeURIComponent("site:ace.ajax.org/api" + " " + query); + window.open(url); + } + return false; + }; } // init search @@ -71,6 +68,59 @@ function ux() { } else sx = 0; + $('.members').each(function (i) { + var $classContent = $(this).closest('.classContent'); + + $(this).scrollspy({ + min: $classContent.position().top + 5, + max: $classContent.position().top + $classContent.height() - 35, + 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 + }).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, i.methodClicker').each(function () { var a = $(this); var constructorPos = a.attr("id").indexOf("new "); diff --git a/api/scrollbar.html b/api/scrollbar.html index 5f311060..8ba5848c 100644 --- a/api/scrollbar.html +++ b/api/scrollbar.html @@ -1,261 +1,19 @@ - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              ScrollBar -

                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                              parentDOMElement

                                                                                                                                                                                                                                                                              Required. A DOM element

                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Events

                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                • ScrollBar.on("scroll", function(Object e))
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Emitted when the scroll bar, well, scrolls.

                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Emitted when the scroll bar, well, scrolls.

                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                              eObject

                                                                                                                                                                                                                                                                              Required. Contains one property, "data", which indicates the current scroll top position

                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                • ScrollBar.getWidth() -
                                                                                                                                                                                                                                                                                • - -
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Returns the width of the scroll bar.

                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Returns the width of the scroll bar.

                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                • ScrollBar.onScroll()
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                • Undocumented
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                • ScrollBar.setHeight(Number height)
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Sets the height of the scroll bar, in pixels.

                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                              Sets the height of the scroll bar, in pixels.

                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                              heightNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              heightNumber

                                                                                                                                                                                                                                                                              Required. 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

                                                                                                                                                                                                                                                                              scrollTopNumber

                                                                                                                                                                                                                                                                              Required. The new scroll top

                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              - - - - - -
                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                              \ No newline at end of file +

                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                              parentDOMElement

                                                                                                                                                                                                                                                                              Required. A DOM element

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Events

                                                                                                                                                                                                                                                                                • ScrollBar.on("scroll", function(Object e))

                                                                                                                                                                                                                                                                                Emitted when the scroll bar, well, scrolls.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Emitted when the scroll bar, well, scrolls.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                eObject

                                                                                                                                                                                                                                                                                Required. Contains one property, "data", which indicates the current scroll top position

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                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

                                                                                                                                                                                                                                                                                  heightNumber

                                                                                                                                                                                                                                                                                  Required. 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

                                                                                                                                                                                                                                                                                    heightNumber

                                                                                                                                                                                                                                                                                    Required. 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

                                                                                                                                                                                                                                                                                      scrollTopNumber

                                                                                                                                                                                                                                                                                      Required. The new scroll top

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                      \ No newline at end of file diff --git a/api/search.html b/api/search.html index 61616063..a2e1f5f3 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:

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      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

                                                                                                                                                                                                                                                                                        sessionEditSession

                                                                                                                                                                                                                                                                                        Required. The session to search with

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

                                                                                                                                                                                                                                                                                        Searches for all occurances options.needle. If found, this method returns an array of Ranges 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 Ranges where the text first occurs. If options.backwards is true, the search goes backwards in the session.

                                                                                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                        sessionEditSession

                                                                                                                                                                                                                                                                                        Required. The session to search with

                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                          • Search.getOptions() -
                                                                                                                                                                                                                                                                                          • - -
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                        inputString

                                                                                                                                                                                                                                                                                        Required. The text to search in

                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        replacementString

                                                                                                                                                                                                                                                                                        Required. The replacing text

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                        sessionEditSession

                                                                                                                                                                                                                                                                                        Required. The session to search with

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        Searches for all occurances options.needle. If found, this method returns an array of Ranges 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 Ranges where the text first occurs. If options.backwards is true, the search goes backwards in the session.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                        sessionEditSession

                                                                                                                                                                                                                                                                                        Required. 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

                                                                                                                                                                                                                                                                                        inputString

                                                                                                                                                                                                                                                                                        Required. The text to search in

                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                        replacementString

                                                                                                                                                                                                                                                                                        Required. The replacing text

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        Returns

                                                                                                                                                                                                                                                                                        String

                                                                                                                                                                                                                                                                                        If options.regExp is true, this function returns input with the replacement already made. Otherwise, this function just returns replacement.

                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • (String): If options.regExp is true, this function returns input with the replacement already made. Otherwise, this function just returns replacement.
                                                                                                                                                                                                                                                                                          -If options.needle was not found, this function returns null.
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • If options.needle was not found, this function returns null.
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                          • Chainable
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                        Sets the search options via the options parameter.

                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                        Sets the search options via the options parameter.

                                                                                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                        optionsObject

                                                                                                                                                                                                                                                                                        Required. An object containing all the new search properties

                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                          • Search.setOptions()
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                          • Undocumented
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        - - - - - - -
                                                                                                                                                                                                                                                                                        - \ No newline at end of file +

                                                                                                                                                                                                                                                                                        Sets the search options via the options parameter.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        Sets the search options via the options parameter.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                        optionsObject

                                                                                                                                                                                                                                                                                        Required. 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..bb08acd7 100644 --- a/api/selection.html +++ b/api/selection.html @@ -1,1781 +1,123 @@ - -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                        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
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        - - - - - -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                            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.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              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.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                  • Selection.getSelectionAnchor()
                                                                                                                                                                                                                                                                                                  • Related to:

                                                                                                                                                                                                                                                                                                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

                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                      • Related to:

                                                                                                                                                                                                                                                                                                    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.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                      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.

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          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()
                                                                                                                                                                                                                                                                                                                              • Related to:

                                                                                                                                                                                                                                                                                                                            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()
                                                                                                                                                                                                                                                                                                                                                  • Related to:

                                                                                                                                                                                                                                                                                                                                                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

                                                                                                                                                                                                                                                                                                                                                    rowNumber

                                                                                                                                                                                                                                                                                                                                                    Required. The new row

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                    columnNumber

                                                                                                                                                                                                                                                                                                                                                    Required. The new column

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                    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

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      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

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      \ No newline at end of file diff --git a/api/split.html b/api/split.html index fd75edce..44c46036 100644 --- a/api/split.html +++ b/api/split.html @@ -1,640 +1,36 @@ - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Split -

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.blur()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Blurs the current editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Blurs the current editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.execute()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.focus()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Focuses the current editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Focuses the current editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • - -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      callbackFunction

                                                                                                                                                                                                                                                                                                                                                      Required. A callback function to execute

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      scopeString

                                                                                                                                                                                                                                                                                                                                                      Required. The default scope for the callback

                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Executes callback on all of the available editors.

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.getCurrentEditor() -
                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Returns the current editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Returns the current editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.getEditor(Number idx)
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      idxNumber

                                                                                                                                                                                                                                                                                                                                                      Required. The index of the editor you want

                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Returns the editor identified by the index idx.

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.getOrientation() -
                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Returns the orientation.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Returns the orientation.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.getSplits() -
                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Returns the number of splits.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Returns the number of splits.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.hasRedo()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.hasUndo()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.redo()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.reset()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.resize()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Resizes the editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Resizes the editor.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.setFontSize(Number size)
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      sizeNumber

                                                                                                                                                                                                                                                                                                                                                      Required. The new font size

                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Sets the font size, in pixels, for all the available editors.

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.setKeyboardHandler(String keybinding)
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      keybindingString

                                                                                                                                                                                                                                                                                                                                                      Required. Sets the keyboard handler for the editor.

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.setOrientation(Number orientation)
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Sets the orientation.

                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Sets the orientation.

                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      orientationNumber

                                                                                                                                                                                                                                                                                                                                                      Required. The new orientation value

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

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      sessionEditSession

                                                                                                                                                                                                                                                                                                                                                      Required. The new edit session

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      idxNumber

                                                                                                                                                                                                                                                                                                                                                      Required. The editor's index you're interested in

                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Sets a new EditSession for the indicated editor.

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.setSplits()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.setTheme(String theme)
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      themeString

                                                                                                                                                                                                                                                                                                                                                      Required. The name of the theme to set

                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                      Sets a theme for each of the available editors.

                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.undo()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Split.UndoManagerProxy()
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      - - - - - -
                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                      \ No newline at end of file +

                                                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                      containerDocument

                                                                                                                                                                                                                                                                                                                                                      Required. The document to associate with the split

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      themeString

                                                                                                                                                                                                                                                                                                                                                      Required. The name of the initial theme

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      splitsNumber

                                                                                                                                                                                                                                                                                                                                                      Required. The number of initial splits

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                                        • Split.blur()
                                                                                                                                                                                                                                                                                                                                                          • Void
                                                                                                                                                                                                                                                                                                                                                        • Related to:

                                                                                                                                                                                                                                                                                                                                                      Blurs the current editor.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      Blurs the current editor.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                        • Split.focus()
                                                                                                                                                                                                                                                                                                                                                          • Void
                                                                                                                                                                                                                                                                                                                                                        • Related to:

                                                                                                                                                                                                                                                                                                                                                      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

                                                                                                                                                                                                                                                                                                                                                      callbackFunction

                                                                                                                                                                                                                                                                                                                                                      Required. A callback function to execute

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      scopeString

                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                        • 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

                                                                                                                                                                                                                                                                                                                                                        idxNumber

                                                                                                                                                                                                                                                                                                                                                        Required. 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
                                                                                                                                                                                                                                                                                                                                                          • Split.setFontSize(Number size)
                                                                                                                                                                                                                                                                                                                                                            • Void
                                                                                                                                                                                                                                                                                                                                                          • Related to:

                                                                                                                                                                                                                                                                                                                                                        Sets the font size, in pixels, for all the available editors.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Sets the font size, in pixels, for all the available editors.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                        sizeNumber

                                                                                                                                                                                                                                                                                                                                                        Required. The new font size

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                          • Split.setKeyboardHandler(String keybinding)
                                                                                                                                                                                                                                                                                                                                                            • Void
                                                                                                                                                                                                                                                                                                                                                          • Internal

                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                        keybindingString

                                                                                                                                                                                                                                                                                                                                                        Required.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                          • Split.setOrientation(Number oriantation)
                                                                                                                                                                                                                                                                                                                                                            • Void
                                                                                                                                                                                                                                                                                                                                                          • Internal

                                                                                                                                                                                                                                                                                                                                                        Sets the orientation.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Sets the orientation.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                        oriantationNumber

                                                                                                                                                                                                                                                                                                                                                        Required.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Sets a new EditSession for the indicated editor.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Sets a new EditSession for the indicated editor.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                        sessionEditSession

                                                                                                                                                                                                                                                                                                                                                        Required. The new edit session

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        idxNumber

                                                                                                                                                                                                                                                                                                                                                        Required. The editor's index you're interested in

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                          • Split.setSplits(Number splits)
                                                                                                                                                                                                                                                                                                                                                            • Void
                                                                                                                                                                                                                                                                                                                                                          • Internal

                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                        splitsNumber

                                                                                                                                                                                                                                                                                                                                                        Required. The new number of splits

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                          • Split.setTheme(String theme)
                                                                                                                                                                                                                                                                                                                                                            • Void
                                                                                                                                                                                                                                                                                                                                                          • Related to:

                                                                                                                                                                                                                                                                                                                                                        Sets a theme for each of the available editors.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Sets a theme for each of the available editors.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                        themeString

                                                                                                                                                                                                                                                                                                                                                        Required. 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..a6de2ef9 100644 --- a/api/token_iterator.html +++ b/api/token_iterator.html @@ -1,248 +1,18 @@ - -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                                                                                        TokenIterator -

                                                                                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                                                                                        sessionEditSession

                                                                                                                                                                                                                                                                                                                                                        Required. The session to associate with

                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        initialRowNumber

                                                                                                                                                                                                                                                                                                                                                        Required. The row to start the tokenizing at

                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                        initialColumnNumber

                                                                                                                                                                                                                                                                                                                                                        Required. 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 +

                                                                                                                                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                                                                                                                        sessionEditSession

                                                                                                                                                                                                                                                                                                                                                        Required. The session to associate with

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        initialRowNumber

                                                                                                                                                                                                                                                                                                                                                        Required. The row to start the tokenizing at

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        initialColumnNumber

                                                                                                                                                                                                                                                                                                                                                        Required. 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.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                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.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                  • 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..5ca489e9 100644 --- a/api/tokenizer.html +++ b/api/tokenizer.html @@ -1,122 +1,8 @@ - -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -

                                                                                                                                                                                                                                                                                                                                                                  Tokenizer -

                                                                                                                                                                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  - -

                                                                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -

                                                                                                                                                                                                                                                                                                                                                                  Constructs a new tokenizer based on the given rules and flags.

                                                                                                                                                                                                                                                                                                                                                                  - -
                                                                                                                                                                                                                                                                                                                                                                  -

                                                                                                                                                                                                                                                                                                                                                                  Constructs a new tokenizer based on the given rules and flags.

                                                                                                                                                                                                                                                                                                                                                                  - -

                                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                                  rulesObject

                                                                                                                                                                                                                                                                                                                                                                  Required. The highlighting rules

                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  flagString

                                                                                                                                                                                                                                                                                                                                                                  Required. Any additional regular expression flags to pass (like "i" for case insensitive)

                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -

                                                                                                                                                                                                                                                                                                                                                                  Methods

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

                                                                                                                                                                                                                                                                                                                                                                  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.

                                                                                                                                                                                                                                                                                                                                                                  - -

                                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                                  lineObject

                                                                                                                                                                                                                                                                                                                                                                  Required.

                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  startStateObject

                                                                                                                                                                                                                                                                                                                                                                  Required.

                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  - - - - - -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                  \ No newline at end of file +

                                                                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                                                                  Constructs a new tokenizer based on the given rules and flags.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Constructs a new tokenizer based on the given rules and flags.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                                  rulesObject

                                                                                                                                                                                                                                                                                                                                                                  Required. The highlighting rules

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                  flagString

                                                                                                                                                                                                                                                                                                                                                                  Required. 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..da876c91 100644 --- a/api/undomanager.html +++ b/api/undomanager.html @@ -1,271 +1,23 @@ - -
                                                                                                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                                                                                                    -

                                                                                                                                                                                                                                                                                                                                                                    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:

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    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

                                                                                                                                                                                                                                                                                                                                                                        optionsObject

                                                                                                                                                                                                                                                                                                                                                                        Required. Contains additional properties

                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          • UndoManager.hasRedo() -
                                                                                                                                                                                                                                                                                                                                                                          • - -
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                                                                                                        Returns true if there are redo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                                                                                                        Returns true if there are redo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          • UndoManager.hasUndo() -
                                                                                                                                                                                                                                                                                                                                                                          • - -
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                                                                                                        Returns true if there are undo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                                                                                                        Returns true if there are undo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          • UndoManager.redo(Boolean dontSelect)
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -

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

                                                                                                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                                                                                                        -

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

                                                                                                                                                                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                                        dontSelectBoolean

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

                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          • UndoManager.reset()
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                                                                                                                        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.

                                                                                                                                                                                                                                                                                                                                                                        - -
                                                                                                                                                                                                                                                                                                                                                                        -

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

                                                                                                                                                                                                                                                                                                                                                                        - -

                                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                                        dontSelectBoolean

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

                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        - - - - - -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                        \ No newline at end of file +

                                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                                        optionsObject

                                                                                                                                                                                                                                                                                                                                                                        Required. 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

                                                                                                                                                                                                                                                                                                                                                                          dontSelectBoolean

                                                                                                                                                                                                                                                                                                                                                                          Required. 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

                                                                                                                                                                                                                                                                                                                                                                            dontSelectBoolean

                                                                                                                                                                                                                                                                                                                                                                            Required. 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..b61cb4b5 100644 --- a/api/virtual_renderer.html +++ b/api/virtual_renderer.html @@ -1,2190 +1,153 @@ - -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                                                                                                                                            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 +

                                                                                                                                                                                                                                                                                                                                                                            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.addGutterDecoration(row, className)
                                                                                                                                                                                                                                                                                                                                                                              • Deprecated

                                                                                                                                                                                                                                                                                                                                                                            Deprecated; (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                            Deprecated; (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                              • 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.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.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                  • VirtualRenderer.getScrollLeft()
                                                                                                                                                                                                                                                                                                                                                                                                  • Related to:

                                                                                                                                                                                                                                                                                                                                                                                                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()
                                                                                                                                                                                                                                                                                                                                                                                                  • Related to:

                                                                                                                                                                                                                                                                                                                                                                                                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()

                                                                                                                                                                                                                                                                                                                                                                                                            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

                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                              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.removeGutterDecoration(row, className)
                                                                                                                                                                                                                                                                                                                                                                                                                  • Void
                                                                                                                                                                                                                                                                                                                                                                                                                • Deprecated

                                                                                                                                                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                                                                                                                                                              deltaXNumber

                                                                                                                                                                                                                                                                                                                                                                                                              Required. The x value to scroll by

                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                              deltaYNumber

                                                                                                                                                                                                                                                                                                                                                                                                              Required. The y value to scroll by

                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                • VirtualRenderer.scrollCursorIntoView(cursor, offset)

                                                                                                                                                                                                                                                                                                                                                                                                                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

                                                                                                                                                                                                                                                                                                                                                                                                                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)
                                                                                                                                                                                                                                                                                                                                                                                                                  • Related to:

                                                                                                                                                                                                                                                                                                                                                                                                                Gracefully scrolls the top of the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Gracefully scrolls the top of the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                rowNumber

                                                                                                                                                                                                                                                                                                                                                                                                                Required. A row id

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the editor to the x pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the editor to the x pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                scrollLeftNumber

                                                                                                                                                                                                                                                                                                                                                                                                                Required. The position to scroll to

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                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)

                                                                                                                                                                                                                                                                                                                                                                                                                      Sets the inner text of the current composition to text.

                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                      Sets the inner text of the current composition to text.

                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                      textString

                                                                                                                                                                                                                                                                                                                                                                                                                      Required. A string of text to use

                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                        • 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.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(String style)

                                                                                                                                                                                                                                                                                                                                                                                                                                    Adds a new class, style, to the editor.

                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                    Adds a new class, style, to the editor.

                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                    styleString

                                                                                                                                                                                                                                                                                                                                                                                                                                    Required. A class name

                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                      • 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.showComposition(Number position)
                                                                                                                                                                                                                                                                                                                                                                                                                                        • Internal

                                                                                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                      positionNumber

                                                                                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                        • 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()

                                                                                                                                                                                                                                                                                                                                                                                                                                              Redraw breakpoints.

                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                              Redraw breakpoints.

                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                • 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 diff --git a/build b/build index a4e495d8..86abb023 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit a4e495d8901876c6bafe3870a35cb8e32c827e97 +Subproject commit 86abb02339499ac96f95649ad5e088e66b6b9a9c 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/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..3f9eaafc 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/demo.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ b/demo/kitchen-sink/demo.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -33,15 +33,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,18 +46,16 @@ 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 whitespace = require("ace/ext/whitespace");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var MultiSelect = require("ace/multi_select").MultiSelect;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var doclist = require("./doclist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var modelist = require("ace/ext/modelist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var themelist = require("ace/ext/themelist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var modelist = require("./modelist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var layout = require("./layout");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var TokenTooltip = require("./token_tooltip").TokenTooltip;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var util = require("./util");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -74,18 +64,8 @@ var fillDropdown = util.fillDropdown;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var bindCheckbox = util.bindCheckbox;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var bindDropdown = util.bindDropdown;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var ElasticTabstopsLite = require("ace/ext/elastic_tabstops_lite").ElasticTabstopsLite;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var IncrementalSearch = require("ace/incremental_search").IncrementalSearch;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var workerModule = require("ace/worker/worker_client");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -if (location.href.indexOf("noworker") !== -1) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    workerModule.WorkerClient = workerModule.UIWorkerClient;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                               /*********** create editor ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var container = document.getElementById("editor-container");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var container = document.getElementById("editor");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               // Splitting.
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var Split = require("ace/split").Split;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -97,23 +77,21 @@ split.on("focus", function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               env.split = split;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               window.env = env;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +window.ace = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +env.editor.setAnimatedScroll(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +// add multiple cursor support to editor
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +require("ace/multi_select").MultiSelect(env.editor);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               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";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +border:1px solid #baf; zIndex:100";
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var cmdLine = new layout.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.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -133,80 +111,37 @@ 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);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            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());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            var r = eval(editor.getCopyText()||editor.getValue());
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       } catch(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           r = e;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        editor.cmdLine.setValue(r + "");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        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"); },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "Esc|Shift-Esc": function(cmdLine){ cmdLine.editor.focus(); },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -224,37 +159,14 @@ 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",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -265,8 +177,6 @@ var keybindings = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   })
                                                                                                                                                                                                                                                                                                                                                                                                                                                               };
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                               /*********** manage layout ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var consoleHeight = 20;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               function onResize() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -296,7 +206,6 @@ 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");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -310,44 +219,16 @@ bindDropdown("mode", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   env.editor.session.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);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       updateUIEditorOptions();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       env.editor.focus();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                               function updateUIEditorOptions() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var editor = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var session = editor.session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -371,26 +252,20 @@ 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}),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                               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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               };
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -415,11 +290,28 @@ bindDropdown("folding", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindDropdown("soft_wrap", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("wrap", value);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var session = env.editor.session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var renderer = env.editor.renderer;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    switch (value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        case "off":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setUseWrapMode(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            renderer.setPrintMarginColumn(80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        case "free":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setWrapLimitRange(null, null);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            renderer.setPrintMarginColumn(80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        default:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            var col = parseInt(value, 10);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setWrapLimitRange(col, col);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            renderer.setPrintMarginColumn(col);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               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 +339,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) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -469,53 +357,32 @@ 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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -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)});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("highlight_token", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var editor = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   if (editor.tokenTooltip && !checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -526,60 +393,122 @@ bindCheckbox("highlight_token", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var StatusBar = require("ace/ext/statusbar").StatusBar;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +bindCheckbox("mobile_mode", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    /** Mobile test **/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var editorElement = document.getElementById("editor");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var left = editorElement.offsetLeft;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var height = editorElement.style.height;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var totalHeight = env.editor.session.getLength() * env.editor.renderer.lineHeight;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var width = document.documentElement.clientWidth - left;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var mobileScrollDiv = document.createElement("div");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        mobileScrollDiv.id = "scrolldiv_container";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        mobileScrollDiv.style.width = (width+30) + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        //mobileScrollDiv.style.left = left + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        mobileScrollDiv.style.height = height;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var mobileScrollDivChild = document.createElement("div");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        mobileScrollDivChild.id = "scrolldiv_child";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        mobileScrollDivChild.style.height = totalHeight + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        mobileScrollDiv.appendChild(mobileScrollDivChild);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        editorElement.appendChild(mobileScrollDiv);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var movementDiff = 0, lastMovementPos = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var timeDiff = 0, lastTime = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var waitingForLastScroll = false;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        document.addEventListener("touchmove", function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            //console.log("     TOUCHMOVE", e, mobileScrollDiv.scrollTop);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            movementDiff = mobileScrollDiv.scrollTop - lastMovementPos;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            lastMovementPos = mobileScrollDiv.scrollTop;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            timeDiff = e.timeStamp - lastTime;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            lastTime = e.timeStamp;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var movingTimer;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        document.addEventListener("touchstart", function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            if (e.target.className.split(" ").indexOf("ace_content") !== -1) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                clearInterval(movingTimer);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                waitingForLastScroll = false;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                movementDiff = 0, lastMovementPos = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                timeDiff = 0, lastTime = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                //console.log("touchstart", e);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        }, false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        document.addEventListener("touchend", function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            if (e.target.className.split(" ").indexOf("ace_content") !== -1) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                waitingForLastScroll = true;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                //console.log("TOUCH END", e);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                //console.log(movementDiff, timeDiff);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                var position = mobileScrollDiv.scrollTop;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                //var velocity = (movementDiff/timeDiff) * 4;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                var velocity = movementDiff;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                movingTimer = setInterval(function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                    position += velocity;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                    velocity *= 0.949;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                    //console.log(velocity);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                    env.editor.session.setScrollTop(position);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                    mobileScrollDiv.scrollTop = position;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                    if (Math.abs(velocity) < 4)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                        clearInterval(movingTimer);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                }, 5);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        }, false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        mobileScrollDiv.onscroll = function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            //console.log("Scrolling", e, mobileScrollDiv.scrollTop);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            if (waitingForLastScroll === false) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                env.editor.session.setScrollTop(mobileScrollDiv.scrollTop);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            // Set the top of the scrolldiv to what the editor scrolltop is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            /*else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                mobileScrollDiv.scrollTop = env.editor.session.getScrollTop();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            }*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var mobileScrollDiv = document.getElementById("scrolldiv_container");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (mobileScrollDiv)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            mobileScrollDiv.parentNode.removeChild(mobileScrollDiv);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +/************** 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("./statusbar").StatusBar;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               new StatusBar(env.editor, cmdLine.container);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -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);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// require("ace/placeholder").PlaceHolder;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var snippetManager = require("ace/snippets").snippetManager;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -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();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("ace/ext/language_tools");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -env.editor.setOptions({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    enableBasicAutocompletion: true,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    enableLiveAutocompletion: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    enableSnippets: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -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
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index a4848d50..ab659b1a 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/doclist.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ b/demo/kitchen-sink/doclist.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -35,7 +35,7 @@ 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");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var modelist = require("./modelist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               /*********** demo documents ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var fileCache = {};
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -47,15 +47,13 @@ function initDoc(file, path, doc) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   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);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var mode = modelist.getModeFromPath(path);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   session.modeName = mode.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   session.setMode(mode.mode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -66,51 +64,70 @@ function makeHuge(txt) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var docs = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/javascript.js": {order: 1, name: "JavaScript"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/AsciiDoc.asciidoc": "AsciiDoc",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "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/dart.dart": "Dart",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/diff.diff": "Diff",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/glsl.glsl": "Glsl",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/golang.go": "Go",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/groovy.groovy": "Groovy",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/haml.haml": "Haml",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/Haxe.hx": "haXe",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/html.html": "HTML",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/jade.jade": "Jade",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/java.java": "Java",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/jsp.jsp": "JSP",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/json.json": "JSON",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/jsx.jsx": "JSX",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "docs/latex.tex": {name: "LaTeX", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/less.less": "LESS",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/lisp.lisp": "Lisp",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/liquid.liquid": "Liquid",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/lua.lua": "Lua",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/lucene.lucene": "Lucene",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/luapage.lp": "LuaPage",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/Makefile": "Makefile",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "docs/markdown.md": {name: "Markdown", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/mushcode.mc": {name: "MUSHCode", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/objectivec.m": {name: "Objective-C"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "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/stylus.styl": "Stylus",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "docs/sql.sql": {name: "SQL", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/svg.svg": "SVG",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/tcl.tcl": "Tcl",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "docs/textile.textile": {name: "Textile", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/c9search.c9search_results": "C9 Search Results",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/mel.mel": "MEL",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/Nix.nix": "Nix"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/typescript.ts": "Typescript",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "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 = require.toUrl ? {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var hugeDocs = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "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)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -121,13 +138,6 @@ if (window.require && window.require.s) try {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               } 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) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -169,44 +179,13 @@ function loadDoc(name, callback) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -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)),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    docs: prepareDocList(docs),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ownSource: prepareDocList(ownSource),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   hugeDocs: prepareDocList(hugeDocs),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   initDoc: initDoc,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    loadDoc: loadDoc,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    saveDoc: saveDoc,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    loadDoc: loadDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                               };
                                                                                                                                                                                                                                                                                                                                                                                                                                                               module.exports.all = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "Mode Examples": module.exports.docs,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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/asciidoc.asciidoc b/demo/kitchen-sink/docs/AsciiDoc.asciidoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              similarity index 100%
                                                                                                                                                                                                                                                                                                                                                                                                                                                              rename from demo/kitchen-sink/docs/asciidoc.asciidoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              rename to demo/kitchen-sink/docs/AsciiDoc.asciidoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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/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/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 index 735a20b3..8700c8cd 100644 --- a/demo/kitchen-sink/docs/dart.dart +++ b/demo/kitchen-sink/docs/dart.dart @@ -1,19 +1,58 @@ -// 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); +main() { + print('Hello World!'); } -// 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)); +int fib(int n) => (n > 1) ? (fib(n - 1) + fib(n - 2)) : n; +main() { + print('fib(20) = ${fib(20)}'); } +/*asd +asdad +*/ +0.67 +77 +.86 + +#import("http://dartwatch.com/myOtherLibrary.dart"); +#import("myOtherLibrary.dart", prefix:"lib1"); + +"""asdasdads +asdadsadsasd +asdasdasdad""" + +'23424' + +0x234 + +foo is bar + +int x = 4 << 10 +// Create a class for Point. +class Point { + + // Final variables cannot be changed once they are assigned. + // Create two instance variables. + final num x, y; + + // A constructor, with syntactic sugar for setting instance variables. + Point(this.x, this.y); + + // A named constructor with an initializer list. + Point.origin() : x = 0, y = 0; + + // A method. + num distanceTo(Point other) { + var dx = x - other.x; + var dy = y - other.y; + return sqrt(dx * dx + dy * dy); + } +} + + // Check for null. +var unicorn; +assert(unicorn == null); + +// Check for NaN. +var iMeantToDoThis = 0/0; +assert(iMeantToDoThis.isNaN()); 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/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/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/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/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/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/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..48e26ae0 100644 --- a/demo/kitchen-sink/docs/ruby.rb +++ b/demo/kitchen-sink/docs/ruby.rb @@ -20,16 +20,4 @@ class Range end end -{:id => ?", :key => "value"} - - - herDocs = [<<'FOO', < 34, :sdfasdfasdf => "asdasdads"} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/rust.rs b/demo/kitchen-sink/docs/rust.rs deleted file mode 100644 index 7ab5418c..00000000 --- a/demo/kitchen-sink/docs/rust.rs +++ /dev/null @@ -1,20 +0,0 @@ -use core::rand::RngUtil; - -fn main() { - for ["Alice", "Bob", "Carol"].each |&name| { - do spawn { - let v = rand::Rng().shuffle([1, 2, 3]); - for v.each |&num| { - print(fmt!("%s says: '%d'\n", name, num + 1)) - } - } - } -} - -fn map(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/tex.tex b/demo/kitchen-sink/docs/tex.tex deleted file mode 100644 index 9f1df621..00000000 --- a/demo/kitchen-sink/docs/tex.tex +++ /dev/null @@ -1,20 +0,0 @@ -The quadratic formula is $$-b \pm \sqrt{b^2 - 4ac} \over 2a$$ -\bye - -\makeatletter - \newcommand{\be}{% - \begingroup - % \setlength{\arraycolsep}{2pt} - \eqnarray% - \@ifstar{\nonumber}{}% - } - \newcommand{\ee}{\endeqnarray\endgroup} - \makeatother - - \begin{equation} - x=\left\{ \begin{array}{cl} - 0 & \textrm{if }A=\ldots\\ - 1 & \textrm{if }B=\ldots\\ - x & \textrm{this runs with as much text as you like, but without an raggeright text -.}\end{array}\right. - \end{equation} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/toml.toml b/demo/kitchen-sink/docs/toml.toml deleted file mode 100644 index 46e5b9d1..00000000 --- a/demo/kitchen-sink/docs/toml.toml +++ /dev/null @@ -1,29 +0,0 @@ -# This is a TOML document. Boom. - -title = "TOML Example" - -[owner] -name = "Tom Preston-Werner" -organization = "GitHub" -bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." -dob = 1979-05-27T07:32:00Z # First class dates? Why not? - -[database] -server = "192.168.1.1" -ports = [ 8001, 8001, 8002 ] -connection_max = 5000 -enabled = true - -[servers] - - # You can indent as you please. Tabs or spaces. TOML don't care. - [servers.alpha] - ip = "10.0.0.1" - dc = "eqdc10" - - [servers.beta] - ip = "10.0.0.2" - dc = "eqdc10" - -[clients] -data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it \ No newline at end of file diff --git a/demo/kitchen-sink/docs/twig.twig b/demo/kitchen-sink/docs/twig.twig deleted file mode 100644 index 02214f09..00000000 --- a/demo/kitchen-sink/docs/twig.twig +++ /dev/null @@ -1,30 +0,0 @@ - - - - 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/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 index 1332eef3..36f85cf3 100644 --- a/demo/kitchen-sink/layout.js +++ b/demo/kitchen-sink/layout.js @@ -103,6 +103,11 @@ var Split = function(){ exports.singleLineEditor = function(el) { var renderer = new Renderer(el); el.style.overflow = "hidden"; + renderer.scrollBar.element.style.top = "0"; + renderer.scrollBar.element.style.display = "none"; + renderer.scrollBar.orginalWidth = renderer.scrollBar.width; + renderer.scrollBar.width = 0; + renderer.content.style.height = "auto"; renderer.screenToTextCoordinates = function(x, y) { var pos = this.pixelToScreenCoordinates(x, y); @@ -112,15 +117,72 @@ exports.singleLineEditor = function(el) { ); }; - renderer.$maxLines = 4; + renderer.maxLines = 4; + renderer.$computeLayerConfigWithScroll = renderer.$computeLayerConfig; + renderer.$computeLayerConfig = function() { + var config = this.layerConfig; + var height = this.session.getScreenLength() * this.lineHeight; + if (config.height != height) { + var vScroll = height > this.maxLines * this.lineHeight; + + if (vScroll != this.$vScroll) { + if (vScroll) { + this.scrollBar.element.style.display = ""; + this.scrollBar.width = this.scrollBar.orginalWidth; + this.container.style.height = config.height + "px"; + height = config.height; + this.scrollTop = height - this.maxLines * this.lineHeight; + } else { + this.scrollBar.element.style.display = "none"; + this.scrollBar.width = 0; + } + + this.onResize(); + this.$vScroll = vScroll; + } + + if (this.$vScroll) + return renderer.$computeLayerConfigWithScroll(); + + this.container.style.height = height + "px"; + this.scroller.style.height = height + "px"; + this.content.style.height = height + "px"; + this._emit("resize"); + } + + var longestLine = this.$getLongestLine(); + var firstRow = 0; + var lastRow = this.session.getLength(); + + this.scrollTop = 0; + 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; + + this.$gutterLayer.element.style.marginTop = 0 + "px"; + this.content.style.marginTop = 0 + "px"; + this.content.style.width = longestLine + 2 * this.$padding + "px"; + }; + renderer.isScrollableBy=function(){return false}; renderer.setStyle("ace_one-line"); 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); + 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/modelist.js b/demo/kitchen-sink/modelist.js new file mode 100644 index 00000000..be057a19 --- /dev/null +++ b/demo/kitchen-sink/modelist.js @@ -0,0 +1,107 @@ +define(function(require, exports, module) { +"use strict"; + +/************** modes ***********************/ +var modes = []; +function getModeFromPath(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, desc, extensions) { + this.name = name; + this.desc = desc; + this.mode = "ace/mode/" + name; + if (/\^/.test(extensions)) { + var re = extensions.replace(/\|(\^)?/g, function(a, b){ + return "$|" + (b ? "^" : "^.*\\."); + }) + "$"; + } else { + var re = "^.*\\.(" + extensions + ")$"; + } + + this.extRe = new RegExp(re, "g"); +}; + +Mode.prototype.supportsFile = function(filename) { + return filename.match(this.extRe); +}; + +var modesByName = { + asciidoc: ["AsciiDoc" , "asciidoc"], + c9search: ["C9Search" , "c9search_results"], + coffee: ["CoffeeScript" , "^Cakefile|coffee|cf"], + coldfusion: ["ColdFusion" , "cfm"], + csharp: ["C#" , "cs"], + css: ["CSS" , "css"], + dart: ["Dart" , "dart"], + diff: ["Diff" , "diff|patch"], + glsl: ["Glsl" , "glsl|frag|vert"], + golang: ["Go" , "go"], + groovy: ["Groovy" , "groovy"], + haxe: ["haXe" , "hx"], + haml: ["HAML" , "haml"], + html: ["HTML" , "htm|html|xhtml"], + c_cpp: ["C/C++" , "c|cc|cpp|cxx|h|hh|hpp"], + clojure: ["Clojure" , "clj"], + jade: ["Jade" , "jade"], + java: ["Java" , "java"], + jsp: ["JSP" , "jsp"], + javascript: ["JavaScript" , "js"], + json: ["JSON" , "json"], + jsx: ["JSX" , "jsx"], + latex: ["LaTeX" , "latex|tex|ltx|bib"], + less: ["LESS" , "less"], + lisp: ["Lisp" , "lisp|scm|rkt"], + liquid: ["Liquid" , "liquid"], + lua: ["Lua" , "lua"], + luapage: ["LuaPage" , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates + lucene: ["Lucene" , "lucene"], + makefile: ["Makefile" , "^GNUmakefile|^makefile|^Makefile|^OCamlMakefile|make"], + markdown: ["Markdown" , "md|markdown"], + objectivec: ["Objective-C" , "m"], + 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"], + stylus: ["Stylus" , "styl|stylus"], + svg: ["SVG" , "svg"], + tcl: ["Tcl" , "tcl"], + text: ["Text" , "txt"], + textile: ["Textile" , "textile"], + typescript: ["Typescript" , "typescript|ts|str"], + xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"], + xquery: ["XQuery" , "xq"], + yaml: ["YAML" , "yaml"] +}; + +for (var name in modesByName) { + var mode = modesByName[name]; + mode = new Mode(name, mode[0], mode[1]); + modesByName[name] = mode; + modes.push(mode); +} + +module.exports = { + getModeFromPath: getModeFromPath, + modes: modes, + modesByName: modesByName +}; + +}); + 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..39dbad8e 100644 --- a/demo/kitchen-sink/require.js +++ b/demo/kitchen-sink/require.js @@ -1,18 +1,18 @@ /** 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.1.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 */ +/*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+', + version = '2.1.1', commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, jsSuffixRegExp = /\.js$/, @@ -21,8 +21,9 @@ var requirejs, require, define; ostring = op.toString, hasOwn = op.hasOwnProperty, 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, @@ -80,10 +81,6 @@ var requirejs, require, define; return hasOwn.call(obj, prop); } - function getOwn(obj, prop) { - return hasProp(obj, prop) && obj[prop]; - } - /** * Cycles over properties in an object and calls a function for each * property value. If the function returns a truthy value, then the @@ -92,7 +89,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; } @@ -108,10 +105,7 @@ var requirejs, require, define; 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 (deepStringMixin && typeof value !== 'string') { if (!target[prop]) { target[prop] = {}; } @@ -137,11 +131,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) { @@ -180,7 +170,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; @@ -198,27 +188,19 @@ var requirejs, require, define; 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. waitSeconds: 7, baseUrl: './', paths: {}, - bundles: {}, pkgs: {}, shim: {}, + map: {}, config: {} }, registry = {}, - //registry of just enabled modules, to speed - //cycle breaking code when lots of modules - //are registered, but not activated. - enabledRegistry = {}, undefEvents = {}, defQueue = [], defined = {}, urlFetched = {}, - bundlesMap = {}, requireCounter = 1, unnormalizedCounter = 1; @@ -232,8 +214,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,7 +248,7 @@ var requirejs, require, define; * @returns {String} normalized name */ function normalize(name, baseName, applyMap) { - var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, + var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, foundMap, foundI, foundStarMap, starI, baseParts = baseName && baseName.split('/'), normalizedBaseParts = baseParts, @@ -279,26 +261,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. + normalizedBaseParts = 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. + normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); } - name = normalizedBaseParts.concat(name); + name = normalizedBaseParts.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,37 +292,41 @@ 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 //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; } } } } + if (foundMap) { + 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); + if (!foundStarMap && starMap && starMap[nameSegment]) { + foundStarMap = starMap[nameSegment]; starI = i; } } @@ -353,11 +342,7 @@ var requirejs, require, define; } } - // 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) { @@ -373,19 +358,14 @@ 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.require([id]); return true; } } @@ -439,7 +419,7 @@ var requirejs, require, define; if (prefix) { prefix = normalize(prefix, parentName, applyMap); - pluginModule = getOwn(defined, prefix); + pluginModule = defined[prefix]; } //Account for relative paths if there is a base name. @@ -492,7 +472,7 @@ var requirejs, require, define; function getModule(depMap) { var id = depMap.id, - mod = getOwn(registry, id); + mod = registry[id]; if (!mod) { mod = registry[id] = new context.Module(depMap); @@ -503,7 +483,7 @@ 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)) { @@ -511,12 +491,7 @@ var requirejs, require, define; 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 +503,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,7 +531,7 @@ 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 = []; } } @@ -573,7 +548,7 @@ var requirejs, require, define; mod.usingExports = true; if (mod.map.isDefine) { if (mod.exports) { - return (defined[mod.map.id] = mod.exports); + return mod.exports; } else { return (mod.exports = defined[mod.map.id] = {}); } @@ -587,9 +562,9 @@ var requirejs, require, define; id: mod.map.id, uri: mod.map.url, config: function () { - return getOwn(config.config, mod.map.id) || {}; + return (config.config && config.config[mod.map.id]) || {}; }, - exports: mod.exports || (mod.exports = {}) + exports: defined[mod.map.id] }); } } @@ -598,7 +573,6 @@ var requirejs, require, define; function cleanRegistry(id) { //Clean up machinery used for waiting modules. delete registry[id]; - delete enabledRegistry[id]; } function breakCycle(mod, traced, processed) { @@ -610,14 +584,14 @@ var requirejs, require, define; traced[id] = true; each(mod.depMaps, function (depMap, i) { var depId = depMap.id, - dep = getOwn(registry, depId); + dep = 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)) { + if (traced[depId]) { mod.defineDep(i, defined[depId]); mod.check(); //pass false? } else { @@ -630,7 +604,7 @@ var requirejs, require, define; } function checkLoaded() { - var err, usingPathFallback, + var map, modId, err, usingPathFallback, 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(), @@ -647,9 +621,9 @@ 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) { @@ -717,9 +691,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 = []; @@ -828,7 +802,7 @@ var requirejs, require, define; }, /** - * Checks if the module is ready to define itself, and if so, + * Checks is the module is ready to define itself, and if so, * define it. */ check: function () { @@ -856,13 +830,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 +841,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 +859,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,7 +880,7 @@ var requirejs, require, define; } //Clean up - cleanRegistry(id); + delete registry[id]; this.defined = true; } @@ -939,11 +911,11 @@ var requirejs, require, define; on(pluginMap, 'defined', bind(this, function (plugin) { var load, normalizedMap, normalizedMod, - bundleId = getOwn(bundlesMap, this.map.id), name = this.map.name, parentName = this.map.parentMap ? this.map.parentMap.name : null, localRequire = context.makeRequire(map.parentMap, { - enableBuildCallback: true + enableBuildCallback: true, + skipMap: true }); //If current map is not normalized, wait for that @@ -968,7 +940,7 @@ var requirejs, require, define; }); })); - normalizedMod = getOwn(registry, normalizedMap.id); + normalizedMod = registry[normalizedMap.id]; if (normalizedMod) { //Mark this as a dependency for this plugin, so it //can be traced for cycles. @@ -985,14 +957,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 @@ -1041,19 +1005,11 @@ var requirejs, require, define; //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])); + throw new Error('fromText eval for ' + moduleName + + ' failed: ' + e); } if (hasInteractive) { @@ -1083,7 +1039,6 @@ var requirejs, require, define; }, enable: function () { - enabledRegistry[this.map.id] = this; this.enabled = true; //Set flag mentioning that the module is enabling, @@ -1105,7 +1060,7 @@ var requirejs, require, define; !this.skipMap); this.depMaps[i] = depMap; - handler = getOwn(handlers, depMap.id); + handler = handlers[depMap.id]; if (handler) { this.depExports[i] = handler(this); @@ -1120,7 +1075,7 @@ var requirejs, require, define; })); if (this.errback) { - on(depMap, 'error', bind(this, this.errback)); + on(depMap, 'error', this.errback); } } @@ -1130,7 +1085,7 @@ var requirejs, require, define; //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) { + if (!handlers[id] && mod && !mod.enabled) { context.enable(depMap, this); } })); @@ -1138,7 +1093,7 @@ var requirejs, require, define; //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); } @@ -1171,10 +1126,7 @@ var requirejs, require, define; }; 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) { @@ -1243,7 +1195,6 @@ var requirejs, require, define; Module: Module, makeModuleMap: makeModuleMap, nextTick: req.nextTick, - onError: onError, /** * Set a configuration for the context. @@ -1257,38 +1208,28 @@ 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, + var pkgs = config.pkgs, + shim = config.shim, objs = { paths: true, - bundles: true, config: true, map: true }; eachProp(cfg, function (value, prop) { if (objs[prop]) { - if (!config[prop]) { - config[prop] = {}; + if (prop === 'map') { + mixin(config[prop], value, true, true); + } else { + mixin(config[prop], value, true); } - mixin(config[prop], value, true, true); } else { config[prop] = value; } }); - //Reverse map the bundles - if (cfg.bundles) { - eachProp(cfg.bundles, function (value, prop) { - each(value, function (v) { - if (v !== prop) { - bundlesMap[v] = prop; - } - }); - }); - } - //Merge shim if (cfg.shim) { eachProp(cfg.shim, function (value, id) { @@ -1298,7 +1239,7 @@ var requirejs, require, define; deps: value }; } - if ((value.exports || value.init) && !value.exportsFn) { + if (value.exports && !value.exportsFn) { value.exportsFn = context.makeShimExports(value); } shim[id] = value; @@ -1309,25 +1250,29 @@ 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, '') + }; }); + + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; } //If there are any "waiting to execute" modules in the registry, @@ -1356,7 +1301,7 @@ var requirejs, require, define; if (value.init) { ret = value.init.apply(global, arguments); } - return ret || (value.exports && getGlobal(value.exports)); + return ret || getGlobal(value.exports); } return fn; }, @@ -1380,14 +1325,14 @@ var requirejs, require, define; //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)) { + if (relMap && 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); + return req.get(context, deps, relMap); } //Normalize module name, if it contains . or .. @@ -1438,20 +1383,16 @@ var requirejs, require, define; * plain URLs like nameToUrl. */ toUrl: function (moduleNamePlusExt) { - var ext, - index = moduleNamePlusExt.lastIndexOf('.'), - segment = moduleNamePlusExt.split('/')[0], - isRelative = segment === '.' || segment === '..'; + var index = moduleNamePlusExt.lastIndexOf('.'), + ext = null; - //Have a file extension alias, and it is not the - //dots from a relative path. - if (index !== -1 && (!isRelative || index > 1)) { + if (index !== -1) { ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); moduleNamePlusExt = moduleNamePlusExt.substring(0, index); } return context.nameToUrl(normalize(moduleNamePlusExt, - relMap && relMap.id, true), ext, true); + relMap && relMap.id, true), ext); }, defined: function (id) { @@ -1472,23 +1413,12 @@ var requirejs, require, define; takeGlobalQueue(); var map = makeModuleMap(id, relMap, true), - mod = getOwn(registry, id); - - removeScript(id); + mod = registry[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 @@ -1507,12 +1437,11 @@ var requirejs, require, define; /** * 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(); } @@ -1526,7 +1455,7 @@ var requirejs, require, define; */ completeLoad: function (moduleName) { var found, args, mod, - shim = getOwn(config.shim, moduleName) || {}, + shim = config.shim[moduleName] || {}, shExports = shim.exports; takeGlobalQueue(); @@ -1552,9 +1481,9 @@ 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; @@ -1581,20 +1510,9 @@ var requirejs, require, define; * 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); - - if (pkgMain) { - moduleName = pkgMain; - } - - bundleId = getOwn(bundlesMap, moduleName); - - if (bundleId) { - return context.nameToUrl(bundleId, ext, skipExt); - } + nameToUrl: function (moduleName, ext) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + parentPath; //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 +1526,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 +1534,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 +1544,22 @@ 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 += (ext || (/\?/.test(url) ? '' : '.js')); url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; } @@ -1646,7 +1575,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. * @@ -1684,7 +1613,7 @@ 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])); } } }; @@ -1731,7 +1660,7 @@ var requirejs, require, define; contextName = config.context; } - context = getOwn(contexts, contextName); + context = contexts[contextName]; if (!context) { context = contexts[contextName] = req.s.newContext(contextName); } @@ -1813,19 +1742,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 +1760,12 @@ 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.async = true; node.setAttribute('data-requirecontext', context.contextName); node.setAttribute('data-requiremodule', moduleName); @@ -1875,7 +1798,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 +1827,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 +1854,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 +1868,24 @@ 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('/') + '/' : './'; cfg.baseUrl = subPath; + dataMain = mainScript; } - //Strip off any trailing .js since mainScript is now + //Strip off any trailing .js since dataMain 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; - } + dataMain = dataMain.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; } @@ -2005,13 +1913,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/statusbar.js b/demo/kitchen-sink/statusbar.js new file mode 100644 index 00000000..946ae1d4 --- /dev/null +++ b/demo/kitchen-sink/statusbar.js @@ -0,0 +1,48 @@ +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.style.cssText = "color: gray; position:absolute; right:0; border-left:1px solid"; + parentNode.appendChild(this.element); + + var statusUpdate = lang.deferredCall(function(){ + this.updateStatus(editor) + }.bind(this)); + editor.on("changeStatus", function() { + statusUpdate.schedule(50); + }); + editor.on("changeSelection", function() { + statusUpdate.schedule(50); + }); +}; + +(function(){ + this.updateStatus = function(editor) { + var status = []; + function add(str, separator) { + str && status.push(str, separator || "|"); + } + + 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(); + this.element.textContent = status.join(""); + }; +}).call(StatusBar.prototype); + +exports.StatusBar = StatusBar; + +}); \ No newline at end of file diff --git a/demo/kitchen-sink/styles.css b/demo/kitchen-sink/styles.css index 3f46f701..d525fce1 100644 --- a/demo/kitchen-sink/styles.css +++ b/demo/kitchen-sink/styles.css @@ -16,12 +16,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; @@ -41,15 +41,18 @@ body { #controls td + td { text-align: left; } -.ace_status-indicator { - color: gray; + +#scrolldiv_container { position: absolute; - right: 0; - border-left: 1px solid; + top: 0px; + left: 0px; + z-index: 9999; + -webkit-overflow-scrolling: touch; + overflow-y: scroll; + pointer-events: none; } -/* .ace_text-input { - z-index: 10!important; - opacity: 1!important; - background: rgb(84, 0, 255)!important; -}*/ +#scrolldiv_child { + -webkit-transform: translateZ(0px); + pointer-events: none; +} \ No newline at end of file diff --git a/demo/kitchen-sink/token_tooltip.js b/demo/kitchen-sink/token_tooltip.js index 9e607f69..b16966c2 100644 --- a/demo/kitchen-sink/token_tooltip.js +++ b/demo/kitchen-sink/token_tooltip.js @@ -32,26 +32,25 @@ 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) { +var tooltipNode; + +var TokenTooltip = function(editor) { if (editor.tokenTooltip) return; - Tooltip.call(this, editor.container); - editor.tokenTooltip = this; + editor.tokenTooltip = this; this.editor = editor; + + editor.tooltip = tooltipNode || this.$init(); 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 = {}; @@ -64,8 +63,8 @@ oop.inherits(TokenTooltip, Tooltip); if (this.lastT - (r.timeStamp || 0) > 1000) { r.rect = null; r.timeStamp = this.lastT; - this.maxHeight = window.innerHeight; - this.maxWidth = window.innerWidth; + this.maxHeight = innerHeight; + this.maxWidth = innerWidth; } var canvasPos = r.rect || (r.rect = r.scroller.getBoundingClientRect()); @@ -87,10 +86,15 @@ oop.inherits(TokenTooltip, Tooltip); } if (!token) { session.removeMarker(this.marker); - this.hide(); + tooltipNode.style.display = "none"; + this.isOpen = false; return; } - + if (!this.isOpen) { + tooltipNode.style.display = ""; + this.isOpen = true; + } + var tokenText = token.type; if (token.state) tokenText += "|" + token.state; @@ -98,15 +102,15 @@ oop.inherits(TokenTooltip, Tooltip); 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(); + tooltipNode.textContent = tokenText; + this.tooltipWidth = tooltipNode.offsetWidth; + this.tooltipHeight = tooltipNode.offsetHeight; this.tokenText = tokenText; } - - this.show(null, this.x, this.y); + + this.updateTooltipPosition(this.x, this.y); this.token = token; session.removeMarker(this.marker); @@ -119,34 +123,56 @@ oop.inherits(TokenTooltip, Tooltip); this.y = e.clientY; if (this.isOpen) { this.lastT = e.timeStamp; - this.setPosition(this.x, this.y); + this.updateTooltipPosition(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(); + var t = e && e.relatedTarget; + var ct = e && e.currentTarget; + while(t && (t = t.parentNode)) { + if (t == ct) + return; + } + tooltipNode.style.display = "none"; this.editor.session.removeMarker(this.marker); this.$timer = clearTimeout(this.$timer); + this.isOpen = false; + }; + + this.updateTooltipPosition = function(x, y) { + var st = tooltipNode.style; + if (x + 10 + this.tooltipWidth > this.maxWidth) + x = innerWidth - this.tooltipWidth - 10; + if (y > innerHeight * 0.75 || y + 20 + this.tooltipHeight > this.maxHeight) + y = y - this.tooltipHeight - 30; + + st.left = x + 10 + "px"; + st.top = y + 20 + "px"; }; - 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.$init = function() { + tooltipNode = document.documentElement.appendChild(dom.createElement("div")); + var st = tooltipNode.style; + st.position = "fixed"; + st.display = "none"; + st.background = "lightyellow"; + st.borderRadius = ""; + st.border = "1px solid gray"; + st.padding = "1px"; + st.zIndex = 1000; + st.fontFamily = "monospace"; + st.whiteSpace = "pre-line"; + return tooltipNode; }; 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; + delete this.editor.tokenTooltip; }; }).call(TokenTooltip.prototype); @@ -154,3 +180,4 @@ oop.inherits(TokenTooltip, Tooltip); exports.TokenTooltip = TokenTooltip; }); + diff --git a/demo/kitchen-sink/util.js b/demo/kitchen-sink/util.js index c4b74f38..13460257 100644 --- a/demo/kitchen-sink/util.js +++ b/demo/kitchen-sink/util.js @@ -40,10 +40,6 @@ 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); @@ -58,10 +54,13 @@ exports.createSplitEditor = function(el) { 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.editor0 = split[0] = new Editor(new Renderer(e0, require("ace/theme/textmate"))); + split.editor1 = split[1] = new Editor(new Renderer(e1, require("ace/theme/textmate"))); split.splitter = s; + MultiSelect(split.editor0); + MultiSelect(split.editor1); + s.ratio = 0.5; split.resize = function resize(){ @@ -105,8 +104,8 @@ exports.createSplitEditor = function(el) { }; var onResizeInterval = function() { - s.ratio = (x - rect.left) / rect.width; - split.resize(); + s.ratio = (x - rect.left) / rect.width + split.resize() }; event.capture(s, onMouseMove, onResizeEnd); @@ -168,7 +167,6 @@ exports.bindCheckbox = function(id, callback, noInit) { }; el.onclick = onCheck; noInit || onCheck(); - return el; }; exports.bindDropdown = function(id, callback, noInit) { @@ -202,7 +200,7 @@ exports.fillDropdown = function(el, values) { function elt(tag, attributes, content) { var el = dom.createElement(tag); if (typeof content == "string") { - el.appendChild(document.createTextNode(content)); + el.textContent = content; } else if (content) { content.forEach(function(ch) { el.appendChild(ch); @@ -217,8 +215,8 @@ function elt(tag, attributes, content) { 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); + item = {name: item, desc: item}; + return elt("option", {value: item.name}, item.desc); }); } @@ -233,3 +231,4 @@ function dropdown(values) { }); + 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..dd64bc31 100644 --- a/doc/build.js +++ b/doc/build.js @@ -2,11 +2,9 @@ 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 options = { title : "Ace API", - parseType : "jsd", linkFormat : function(linkHtml) { var href = linkHtml.href; var o = href.match(/(.+)\.html(#.+)/); @@ -15,18 +13,28 @@ var options = { if ( o !== null ) { href = href.replace(href, '#nav=api&api=' + o[1]);// + '§ion=' + o[2]); } - + /*else if (c != null) { + var fileLoc = path.basename(linkHtml.originalFile, path.extname(linkHtml.originalFile)); + var sectionLoc = c[1]; + if (fileLoc.toUpperCase() !== sectionLoc.toUpperCase()) { + href = href.replace(href, '#nav=api&api=' + fileLoc + '§ion=' + sectionLoc); + } + else { + //href = href.replace(href, '#nav=api&api=' + fileLoc); + } + }*/ linkHtml.href = href; return linkHtml; }, 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/**"], - index : "./index.md" + exclude : ["**/*_test.js", "**/mode/**", "**/test/**", "**/theme/**", "**/worker/**"], + index : "./index.md", + disableTests: true }; files = [srcPath]; @@ -37,7 +45,7 @@ panino.parse(files, options, function (err, ast) { 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); diff --git a/doc/package.json b/doc/package.json index 50796eea..294fe73f 100644 --- a/doc/package.json +++ b/doc/package.json @@ -2,7 +2,7 @@ "name": "ace-api", "version": "0.1.0", "dependencies": { - "panino" : ">=2.2.0", + "panino" : ">=2.0.8", "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 85% rename from doc/template/resources/csses/ace_api.css rename to doc/resources/ace/skeleton/csses/ace_api.css index 7a90b4c3..7080c7a5 100644 --- a/doc/template/resources/csses/ace_api.css +++ b/doc/resources/ace/skeleton/csses/ace_api.css @@ -14,16 +14,13 @@ color: black; } -pre { - background-color: #FFFFFF; -} - -code { +#documentation code { font-size: 12px; line-height: 16px; 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; @@ -64,6 +61,8 @@ code { } #documentation p { font-size: 13px; + line-height : 20px; + margin-bottom : 13px; } #documentation li p:last-child { margin-bottom : 5px; @@ -142,6 +141,26 @@ code { Menu venue */ +form.navbar-search { + float: none; +} + +form.navbar-search .search-query { + background-color: #FFFFFF; + border-color: #999; + -webkit-transition: border 0.3s; + -moz-transition: border 0.3s; + font-size: 14px; + line-height: 16px; +} + +form.navbar-search .search-query:focus, form.navbar-search .search-query:active { + border: 1px solid #666; +} + +.navbar-search .search-query:focus, .navbar-search .search-query.focused { + padding: 4px 9px; +} h3.api_title { padding-top: 10px; @@ -181,6 +200,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); @@ -276,18 +339,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 { @@ -335,10 +393,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 +413,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 +463,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 +501,10 @@ ul.tabs .double ul, ul.tabs .triple ul, ul.tabs .quad ul{ .content { height: 100%; } +.content .row { + margin-left: auto; + margin-right: auto; +} header.filler { position: relative; @@ -442,6 +512,11 @@ header.filler { width: 100%; } +.centerpiece { + min-height: 100%; + padding: 20px 0; +} + /* .container-fluid .row-fluid { width: 1000px; @@ -455,21 +530,26 @@ header.filler { margin-bottom: 3px; } +#sidebar { + margin-top: 5px; + /*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-left: 15px; padding-bottom: 10px; } @@ -491,6 +571,7 @@ div#documentation article:last-child { } #documentation article.article.methodToggleOpen { background: rgba(255, 255, 255, 0.5); + padding: 20px; font-size: 13px; line-height: 24px; margin: 0 0 10px 0; @@ -626,7 +707,7 @@ li.signature { .eventObjName { font-style: italic; } -.eventListenerStart, .eventListenerClose, .eventFunctionOpen, .eventFunctionClose { +.eventListenerStart, .eventFunctionOpen, .eventFunctionClose { color: #999999; } .eventMember { @@ -662,11 +743,6 @@ li.signature { text-transform: capitalize; } -.undocumented { - background-color: #B94A48; - color: #ffffff; -} - #documentation .alias a, #documentation .related-to a { color: #ffffff; /* text-decoration: underline; */ @@ -698,8 +774,8 @@ li.signature { color: #ffffff; } .description h4 { - padding-top: 10px; font-size: 18px; + margin: 20px 0 10px; line-height : 18px; } @@ -722,6 +798,10 @@ li.signature { Everyday I'm togglin' */ +#documentation h3 { + font-size: 24px; + margin-top: 5px; +} #documentation i.methodToggle { cursor: pointer; color: #9f9f9f; @@ -750,6 +830,7 @@ li.signature { } #documentation h3.sectionHeader { + margin: 10px 0 17px 0; line-height : 24px; } 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/font-awesome.css b/doc/resources/ace/skeleton/csses/font-awesome.css new file mode 100644 index 00000000..4697599c --- /dev/null +++ b/doc/resources/ace/skeleton/csses/font-awesome.css @@ -0,0 +1,303 @@ +/* Font Awesome + the iconic font designed for use with Twitter Bootstrap + ------------------------------------------------------- + The full suite of pictographic icons, examples, and documentation + can be found at: http://fortawesome.github.com/Font-Awesome/ + + License + ------------------------------------------------------- + The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0: + http://creativecommons.org/licenses/by/3.0/ A mention of + 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable + source code is considered acceptable attribution (most common on the web). + If human readable source code is not available to the end user, a mention in + an 'About' or 'Credits' screen is considered acceptable (most common in desktop + or mobile software). + + Contact + ------------------------------------------------------- + Email: dave@davegandy.com + Twitter: http://twitter.com/fortaweso_me + Work: http://lemonwi.se co-founder + + */ +@font-face { + font-family: "FontAwesome"; + src: url('../font/fontawesome-webfont.eot'); + src: url('../font/fontawesome-webfont.eot?#iefix') format('eot'), url('../font/fontawesome-webfont.woff') format('woff'), url('../font/fontawesome-webfont.ttf') format('truetype'), url('../font/fontawesome-webfont.svg#FontAwesome') format('svg'); + font-weight: normal; + font-style: normal; +} + +/* Font Awesome styles + ------------------------------------------------------- */ +[class^="icon-"]:before, [class*=" icon-"]:before { + font-family: FontAwesome; + font-weight: normal; + font-style: normal; + display: inline-block; + text-decoration: inherit; +} +a [class^="icon-"], a [class*=" icon-"] { + display: inline-block; + text-decoration: inherit; +} +/* makes the font 33% larger relative to the icon container */ +.icon-large:before { + vertical-align: top; + font-size: 1.3333333333333333em; +} +.btn [class^="icon-"], .btn [class*=" icon-"] { + /* keeps button heights with and without icons the same */ + + line-height: .9em; +} +li [class^="icon-"], li [class*=" icon-"] { + display: inline-block; + width: 1.25em; + text-align: center; +} +li .icon-large[class^="icon-"], li .icon-large[class*=" icon-"] { + /* 1.5 increased font size for icon-large * 1.25 width */ + + width: 1.875em; +} +li[class^="icon-"], li[class*=" icon-"] { + margin-left: 0; + list-style-type: none; +} +li[class^="icon-"]:before, li[class*=" icon-"]:before { + text-indent: -2em; + text-align: center; +} +li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before { + text-indent: -1.3333333333333333em; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { content: "\f000"; } +.icon-music:before { content: "\f001"; } +.icon-search:before { content: "\f002"; } +.icon-envelope:before { content: "\f003"; } +.icon-heart:before { content: "\f004"; } +.icon-star:before { content: "\f005"; } +.icon-star-empty:before { content: "\f006"; } +.icon-user:before { content: "\f007"; } +.icon-film:before { content: "\f008"; } +.icon-th-large:before { content: "\f009"; } +.icon-th:before { content: "\f00a"; } +.icon-th-list:before { content: "\f00b"; } +.icon-ok:before { content: "\f00c"; } +.icon-remove:before { content: "\f00d"; } +.icon-zoom-in:before { content: "\f00e"; } + +.icon-zoom-out:before { content: "\f010"; } +.icon-off:before { content: "\f011"; } +.icon-signal:before { content: "\f012"; } +.icon-cog:before { content: "\f013"; } +.icon-trash:before { content: "\f014"; } +.icon-home:before { content: "\f015"; } +.icon-file:before { content: "\f016"; } +.icon-time:before { content: "\f017"; } +.icon-road:before { content: "\f018"; } +.icon-download-alt:before { content: "\f019"; } +.icon-download:before { content: "\f01a"; } +.icon-upload:before { content: "\f01b"; } +.icon-inbox:before { content: "\f01c"; } +.icon-play-circle:before { content: "\f01d"; } +.icon-repeat:before { content: "\f01e"; } + +/* \f020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { content: "\f021"; } +.icon-list-alt:before { content: "\f022"; } +.icon-lock:before { content: "\f023"; } +.icon-flag:before { content: "\f024"; } +.icon-headphones:before { content: "\f025"; } +.icon-volume-off:before { content: "\f026"; } +.icon-volume-down:before { content: "\f027"; } +.icon-volume-up:before { content: "\f028"; } +.icon-qrcode:before { content: "\f029"; } +.icon-barcode:before { content: "\f02a"; } +.icon-tag:before { content: "\f02b"; } +.icon-tags:before { content: "\f02c"; } +.icon-book:before { content: "\f02d"; } +.icon-bookmark:before { content: "\f02e"; } +.icon-print:before { content: "\f02f"; } + +.icon-camera:before { content: "\f030"; } +.icon-font:before { content: "\f031"; } +.icon-bold:before { content: "\f032"; } +.icon-italic:before { content: "\f033"; } +.icon-text-height:before { content: "\f034"; } +.icon-text-width:before { content: "\f035"; } +.icon-align-left:before { content: "\f036"; } +.icon-align-center:before { content: "\f037"; } +.icon-align-right:before { content: "\f038"; } +.icon-align-justify:before { content: "\f039"; } +.icon-list:before { content: "\f03a"; } +.icon-indent-left:before { content: "\f03b"; } +.icon-indent-right:before { content: "\f03c"; } +.icon-facetime-video:before { content: "\f03d"; } +.icon-picture:before { content: "\f03e"; } + +.icon-pencil:before { content: "\f040"; } +.icon-map-marker:before { content: "\f041"; } +.icon-adjust:before { content: "\f042"; } +.icon-tint:before { content: "\f043"; } +.icon-edit:before { content: "\f044"; } +.icon-share:before { content: "\f045"; } +.icon-check:before { content: "\f046"; } +.icon-move:before { content: "\f047"; } +.icon-step-backward:before { content: "\f048"; } +.icon-fast-backward:before { content: "\f049"; } +.icon-backward:before { content: "\f04a"; } +.icon-play:before { content: "\f04b"; } +.icon-pause:before { content: "\f04c"; } +.icon-stop:before { content: "\f04d"; } +.icon-forward:before { content: "\f04e"; } + +.icon-fast-forward:before { content: "\f050"; } +.icon-step-forward:before { content: "\f051"; } +.icon-eject:before { content: "\f052"; } +.icon-chevron-left:before { content: "\f053"; } +.icon-chevron-right:before { content: "\f054"; } +.icon-plus-sign:before { content: "\f055"; } +.icon-minus-sign:before { content: "\f056"; } +.icon-remove-sign:before { content: "\f057"; } +.icon-ok-sign:before { content: "\f058"; } +.icon-question-sign:before { content: "\f059"; } +.icon-info-sign:before { content: "\f05a"; } +.icon-screenshot:before { content: "\f05b"; } +.icon-remove-circle:before { content: "\f05c"; } +.icon-ok-circle:before { content: "\f05d"; } +.icon-ban-circle:before { content: "\f05e"; } + +.icon-arrow-left:before { content: "\f060"; } +.icon-arrow-right:before { content: "\f061"; } +.icon-arrow-up:before { content: "\f062"; } +.icon-arrow-down:before { content: "\f063"; } +.icon-share-alt:before { content: "\f064"; } +.icon-resize-full:before { content: "\f065"; } +.icon-resize-small:before { content: "\f066"; } +.icon-plus:before { content: "\f067"; } +.icon-minus:before { content: "\f068"; } +.icon-asterisk:before { content: "\f069"; } +.icon-exclamation-sign:before { content: "\f06a"; } +.icon-gift:before { content: "\f06b"; } +.icon-leaf:before { content: "\f06c"; } +.icon-fire:before { content: "\f06d"; } +.icon-eye-open:before { content: "\f06e"; } + +.icon-eye-close:before { content: "\f070"; } +.icon-warning-sign:before { content: "\f071"; } +.icon-plane:before { content: "\f072"; } +.icon-calendar:before { content: "\f073"; } +.icon-random:before { content: "\f074"; } +.icon-comment:before { content: "\f075"; } +.icon-magnet:before { content: "\f076"; } +.icon-chevron-up:before { content: "\f077"; } +.icon-chevron-down:before { content: "\f078"; } +.icon-retweet:before { content: "\f079"; } +.icon-shopping-cart:before { content: "\f07a"; } +.icon-folder-close:before { content: "\f07b"; } +.icon-folder-open:before { content: "\f07c"; } +.icon-resize-vertical:before { content: "\f07d"; } +.icon-resize-horizontal:before { content: "\f07e"; } + +.icon-bar-chart:before { content: "\f080"; } +.icon-twitter-sign:before { content: "\f081"; } +.icon-facebook-sign:before { content: "\f082"; } +.icon-camera-retro:before { content: "\f083"; } +.icon-key:before { content: "\f084"; } +.icon-cogs:before { content: "\f085"; } +.icon-comments:before { content: "\f086"; } +.icon-thumbs-up:before { content: "\f087"; } +.icon-thumbs-down:before { content: "\f088"; } +.icon-star-half:before { content: "\f089"; } +.icon-heart-empty:before { content: "\f08a"; } +.icon-signout:before { content: "\f08b"; } +.icon-linkedin-sign:before { content: "\f08c"; } +.icon-pushpin:before { content: "\f08d"; } +.icon-external-link:before { content: "\f08e"; } + +.icon-signin:before { content: "\f090"; } +.icon-trophy:before { content: "\f091"; } +.icon-github-sign:before { content: "\f092"; } +.icon-upload-alt:before { content: "\f093"; } +.icon-lemon:before { content: "\f094"; } +.icon-phone:before { content: "\f095"; } +.icon-check-empty:before { content: "\f096"; } +.icon-bookmark-empty:before { content: "\f097"; } +.icon-phone-sign:before { content: "\f098"; } +.icon-twitter:before { content: "\f099"; } +.icon-facebook:before { content: "\f09a"; } +.icon-github:before { content: "\f09b"; } +.icon-unlock:before { content: "\f09c"; } +.icon-credit-card:before { content: "\f09d"; } +.icon-rss:before { content: "\f09e"; } + +.icon-hdd:before { content: "\f0a0"; } +.icon-bullhorn:before { content: "\f0a1"; } +.icon-bell:before { content: "\f0a2"; } +.icon-certificate:before { content: "\f0a3"; } +.icon-hand-right:before { content: "\f0a4"; } +.icon-hand-left:before { content: "\f0a5"; } +.icon-hand-up:before { content: "\f0a6"; } +.icon-hand-down:before { content: "\f0a7"; } +.icon-circle-arrow-left:before { content: "\f0a8"; } +.icon-circle-arrow-right:before { content: "\f0a9"; } +.icon-circle-arrow-up:before { content: "\f0aa"; } +.icon-circle-arrow-down:before { content: "\f0ab"; } +.icon-globe:before { content: "\f0ac"; } +.icon-wrench:before { content: "\f0ad"; } +.icon-tasks:before { content: "\f0ae"; } + +.icon-filter:before { content: "\f0b0"; } +.icon-briefcase:before { content: "\f0b1"; } +.icon-fullscreen:before { content: "\f0b2"; } + +.icon-group:before { content: "\f0c0"; } +.icon-link:before { content: "\f0c1"; } +.icon-cloud:before { content: "\f0c2"; } +.icon-beaker:before { content: "\f0c3"; } +.icon-cut:before { content: "\f0c4"; } +.icon-copy:before { content: "\f0c5"; } +.icon-paper-clip:before { content: "\f0c6"; } +.icon-save:before { content: "\f0c7"; } +.icon-sign-blank:before { content: "\f0c8"; } +.icon-reorder:before { content: "\f0c9"; } +.icon-list-ul:before { content: "\f0ca"; } +.icon-list-ol:before { content: "\f0cb"; } +.icon-strikethrough:before { content: "\f0cc"; } +.icon-underline:before { content: "\f0cd"; } +.icon-table:before { content: "\f0ce"; } + +.icon-magic:before { content: "\f0d0"; } +.icon-truck:before { content: "\f0d1"; } +.icon-pinterest:before { content: "\f0d2"; } +.icon-pinterest-sign:before { content: "\f0d3"; } +.icon-google-plus-sign:before { content: "\f0d4"; } +.icon-google-plus:before { content: "\f0d5"; } +.icon-money:before { content: "\f0d6"; } +.icon-caret-down:before { content: "\f0d7"; } +.icon-caret-up:before { content: "\f0d8"; } +.icon-caret-left:before { content: "\f0d9"; } +.icon-caret-right:before { content: "\f0da"; } +.icon-columns:before { content: "\f0db"; } +.icon-sort:before { content: "\f0dc"; } +.icon-sort-down:before { content: "\f0dd"; } +.icon-sort-up:before { content: "\f0de"; } + +.icon-envelope-alt:before { content: "\f0e0"; } +.icon-linkedin:before { content: "\f0e1"; } +.icon-undo:before { content: "\f0e2"; } +.icon-legal:before { content: "\f0e3"; } +.icon-dashboard:before { content: "\f0e4"; } +.icon-comment-alt:before { content: "\f0e5"; } +.icon-comments-alt:before { content: "\f0e6"; } +.icon-bolt:before { content: "\f0e7"; } +.icon-sitemap:before { content: "\f0e8"; } +.icon-umbrella:before { content: "\f0e9"; } +.icon-paste:before { content: "\f0ea"; } + +.icon-user-md:before { content: "\f200"; } diff --git a/doc/template/resources/font/fontawesome-webfont.eot b/doc/resources/ace/skeleton/font/fontawesome-webfont.eot similarity index 100% rename from doc/template/resources/font/fontawesome-webfont.eot rename to doc/resources/ace/skeleton/font/fontawesome-webfont.eot diff --git a/doc/template/resources/font/fontawesome-webfont.svg b/doc/resources/ace/skeleton/font/fontawesome-webfont.svg similarity index 100% rename from doc/template/resources/font/fontawesome-webfont.svg rename to doc/resources/ace/skeleton/font/fontawesome-webfont.svg diff --git a/doc/template/resources/font/fontawesome-webfont.ttf b/doc/resources/ace/skeleton/font/fontawesome-webfont.ttf similarity index 100% rename from doc/template/resources/font/fontawesome-webfont.ttf rename to doc/resources/ace/skeleton/font/fontawesome-webfont.ttf diff --git a/doc/template/resources/font/fontawesome-webfont.woff b/doc/resources/ace/skeleton/font/fontawesome-webfont.woff similarity index 100% rename from doc/template/resources/font/fontawesome-webfont.woff rename to doc/resources/ace/skeleton/font/fontawesome-webfont.woff 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/template/resources/javascripts/bbq.js b/doc/resources/ace/skeleton/javascripts/bbq.js similarity index 100% rename from doc/template/resources/javascripts/bbq.js rename to doc/resources/ace/skeleton/javascripts/bbq.js diff --git a/doc/template/resources/javascripts/bootstrap.js b/doc/resources/ace/skeleton/javascripts/bootstrap.js similarity index 100% rename from doc/template/resources/javascripts/bootstrap.js rename to doc/resources/ace/skeleton/javascripts/bootstrap.js diff --git a/doc/template/resources/javascripts/clicker.js b/doc/resources/ace/skeleton/javascripts/clicker.js similarity index 100% rename from doc/template/resources/javascripts/clicker.js rename to doc/resources/ace/skeleton/javascripts/clicker.js diff --git a/doc/template/resources/javascripts/disqus-ext.js b/doc/resources/ace/skeleton/javascripts/disqus-ext.js similarity index 100% rename from doc/template/resources/javascripts/disqus-ext.js rename to doc/resources/ace/skeleton/javascripts/disqus-ext.js 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/template/resources/javascripts/ux.js b/doc/resources/ace/skeleton/javascripts/ux.js similarity index 60% rename from doc/template/resources/javascripts/ux.js rename to doc/resources/ace/skeleton/javascripts/ux.js index 3bb07cf4..4a2ffdbd 100644 --- a/doc/template/resources/javascripts/ux.js +++ b/doc/resources/ace/skeleton/javascripts/ux.js @@ -16,20 +16,17 @@ $(function () { 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 url = "https://www.google.com/search?q=" + encodeURIComponent("site:ace.ajax.org/api" + " " + query); + window.open(url); + } + return false; + }; } // init search @@ -71,6 +68,59 @@ function ux() { } else sx = 0; + $('.members').each(function (i) { + var $classContent = $(this).closest('.classContent'); + + $(this).scrollspy({ + min: $classContent.position().top + 5, + max: $classContent.position().top + $classContent.height() - 35, + 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 + }).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, i.methodClicker').each(function () { var a = $(this); var constructorPos = a.attr("id").indexOf("new "); diff --git a/doc/resources/ace/templates/ace_menu.jade b/doc/resources/ace/templates/ace_menu.jade new file mode 100644 index 00000000..7bf9599a --- /dev/null +++ b/doc/resources/ace/templates/ace_menu.jade @@ -0,0 +1,59 @@ +div#well + form(id='searchbox', action='', class='navbar-search') + input(class='search-query span3', name='query', type='text', placeholder="Search the API", title="Search across all the documentation") + + ul.menu + li + div.menu-item + a(class="menuLink namespace", href="ace.html#nav=api") Ace + li + div.menu-item + a(class="menuLink namespace", href="anchor.html#nav=api") Anchor + li + div.menu-item + a(class="menuLink namespace", href="background_tokenizer.html#nav=api") BackgroundTokenizer + li + div.menu-item + a(class="menuLink namespace", href="document.html#nav=api") Document + li + div.menu-item + a(class="menuLink namespace", href="edit_session.html#nav=api") EditSession + li + div.menu-item + a(class="menuLink namespace", href="editor.html#nav=api") Editor + + //- probably not needing doc a(class="menuLink namespace", href="multi_select.html#nav=api") MultiSelect + + //- not actually doc'ed yet a(class="menuLink namespace", href="placeholder.html#nav=api") PlaceHolder + + li + div.menu-item + a(class="menuLink namespace", href="range.html#nav=api") Range + + //- not actually doc'ed yet a(class="menuLink namespace", href="renderloop.html#nav=api") RenderLoop + + + li + div.menu-item + a(class="menuLink namespace", href="scrollbar.html#nav=api") Scrollbar + li + div.menu-item + a(class="menuLink namespace", href="search.html#nav=api") Search + li + div.menu-item + a(class="menuLink namespace", href="selection.html#nav=api") Selection + + //- not actually doc'ed yet a(class="menuLink namespace", href="split.html#nav=api") Split + + li + div.menu-item + a(class="menuLink namespace", href="token_iterator.html#nav=api") TokenIterator + li + div.menu-item + a(class="menuLink namespace", href="tokenizer.html#nav=api") Tokenizer + li + div.menu-item + a(class="menuLink namespace", href="undomanager.html#nav=api") UndoManager + li + div.menu-item + a(class="menuLink namespace", href="virtual_renderer.html#nav=api") VirtualRenderer \ No newline at end of file diff --git a/doc/template/jade/common_layout.jade b/doc/resources/ace/templates/common_layout.jade similarity index 94% rename from doc/template/jade/common_layout.jade rename to doc/resources/ace/templates/common_layout.jade index bb665600..817e3c73 100644 --- a/doc/template/jade/common_layout.jade +++ b/doc/resources/ace/templates/common_layout.jade @@ -23,11 +23,13 @@ mixin head meta(name="description", content="Ace API documentation for the online code editor") meta(name="author", content="Garen J. Torikian") + script(src="#{dirPrefix}resources/javascripts/jquery.js") 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(rel="stylesheet", href="#{dirPrefix}resources/csses/bootstrap.min.css") 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") diff --git a/doc/template/jade/layout.jade b/doc/resources/ace/templates/layout.jade similarity index 73% rename from doc/template/jade/layout.jade rename to doc/resources/ace/templates/layout.jade index c2911c69..68864969 100644 --- a/doc/template/jade/layout.jade +++ b/doc/resources/ace/templates/layout.jade @@ -1,7 +1,7 @@ -include common_layout +include ../../common_layout include lib -#documentation.span9 +#documentation.span8 -if (isIndex) != indexContent -else diff --git a/doc/resources/ace/templates/lib.jade b/doc/resources/ace/templates/lib.jade new file mode 100644 index 00000000..c59bb5a0 --- /dev/null +++ b/doc/resources/ace/templates/lib.jade @@ -0,0 +1,267 @@ +- 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] + + 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) + + 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 + 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.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:  + for alias in obj.aliases + mixin link(alias)  + + if obj.related_to + li + span.label.related-to + | Related to: + obj.related_to + + 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 + h4 Arguments + != argumentTable(obj.arguments, ["argument-list", "table", "table-striped", "table-bordered"]) + + if obj.returns + 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 (pos >= 0) + span.editInC9 + mixin formatGHHref(obj.file) + + -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(id='dropdown_#{m.path}', data-id='#{m.path}', class='memberLink') + mixin link(m, [], true) + -methodSection = constructorSection = propertySection = eventSection = false; + mixin article(obj, []) + +mixin rewriteLink(text) + != text.replace('a', 'bbbb') + +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) + 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..817e3c73 --- /dev/null +++ b/doc/resources/common_layout.jade @@ -0,0 +1,57 @@ +-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="#{dirPrefix}resources/javascripts/jquery.js") + 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(rel="stylesheet", href="#{dirPrefix}resources/csses/bootstrap.min.css") + 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/site/images/FineCut_small_logo.png b/doc/site/images/FineCut_small_logo.png new file mode 100644 index 00000000..87f310b2 Binary files /dev/null and b/doc/site/images/FineCut_small_logo.png differ diff --git a/doc/site/images/KERA-med-web.png b/doc/site/images/KERA-med-web.png new file mode 100644 index 00000000..de004afc Binary files /dev/null and b/doc/site/images/KERA-med-web.png differ diff --git a/doc/site/images/acebug-logo.png b/doc/site/images/acebug-logo.png new file mode 100644 index 00000000..cac5a3fb Binary files /dev/null and b/doc/site/images/acebug-logo.png 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/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/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/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/js/main.js b/doc/site/js/main.js index 39dc202d..efa7ba2b 100644 --- a/doc/site/js/main.js +++ b/doc/site/js/main.js @@ -1,62 +1,22 @@ 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(); - } - }); + hljs.initHighlighting(); + ace.config.set("workerPath", "build/src-min"); + editor = ace.edit("ace_editor_demo"); + embedded_editor = ace.edit("embedded_ace_code"); + editor.getSession().setMode("ace/mode/javascript"); + editor.getSession().setMode("ace/mode/javascript"); + embedded_editor.getSession().setMode("ace/mode/html"); $("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; + if (e.target.tagName === "LI") { + console.log($(this).find("a")); + window.location = $(this).find("a").attr("href"); + } + else if (e.target.tagName === "P" || e.target.tagName === "IMG") { + var anchor = $(e.target).siblings(); + window.location = anchor.attr("href"); } }); @@ -70,8 +30,7 @@ $(function() { var _self = $(this); $("#apiHolder").load($(this).attr("href") + " #documentation", function(){ - $("#apiHolder").removeClass("apiIntro").removeClass("span9"); - $("#documentation").removeClass("span9").addClass("span7"); + $("#apiHolder").removeClass("apiIntro").removeClass("span8"); ux(); setupClicker(); @@ -88,17 +47,19 @@ $(function() { $('.menu-item a').click(magicClickInterceptor); $('a.argument').click(magicClickInterceptor); - $('a.external').click(function(e) { + $('a.external').click(function(e) { e.preventDefault(); }); - var tabs = $("#tabnav"), - tab_a_selector = "a"; + var tabs = $("#tabnav"), + tab_a_selector = "a"; - var firstLoad = true; + var firstLoad = true; - tabs.find(tab_a_selector).click(function(e) { + tabs.find(tab_a_selector).click(function(e) { e.preventDefault(); + embedded_editor.resize(); + editor.resize(); if ($(this).attr("href") === "/") { window.location = "http://ace.ajax.org"; return; @@ -141,47 +102,18 @@ $(function() { $.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() { + $(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 + }); + }).trigger("hashchange"); +}); \ No newline at end of file diff --git a/doc/site/style.css b/doc/site/style.css index 1167340a..79640676 100644 --- a/doc/site/style.css +++ b/doc/site/style.css @@ -5,18 +5,25 @@ body { font-family: Helvetica, Arial; } +#embed_ace_wrapper { + height: 525px; +} - -#ace_editor_demo, #embedded_ace_code { +.ace_editor_wrapper { height: 275px; + position: relative; border: 1px solid #DDD; border-radius: 4px; border-bottom-right-radius: 0px; margin-top: 5px; } -#embedded_ace_code { - height: 525px; +#ace_editor_demo, #embedded_ace_code { + left: 0px; + top: 0px; + bottom: 1px; + right: 1px; + background: #fff; } h1, h2, h3, h4, h5, h6 { @@ -192,7 +199,7 @@ UL{ } .menu, .site-menu { - padding: 25px 0 0 35px; + padding:23px 0 0 24px; } UL.content-list { @@ -206,8 +213,8 @@ UL.content-list li { } ul.menu-list { - padding: 15px 0; - margin: 0 0 20px 0; + padding: 0; + margin: 15px 0 20px 0; list-style-type: none; line-height: 16px; overflow: auto; @@ -235,7 +242,7 @@ ul.menu-list li { -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%), + 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%), @@ -243,7 +250,7 @@ ul.menu-list li { 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%), + 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%), @@ -468,42 +475,19 @@ p.highlight_note a { color: #537CC7; } +.apiIntro { + padding-left: 15px; + padding-bottom: 10px; +} + .prod_no_image { position: relative; left: -10px; top: -12px; } +#sidebarContainer { + margin: 0px 20px 0 15px; +} #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/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/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/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..fcfc0077 100644 --- a/index.html +++ b/index.html @@ -1,33 +1,36 @@ - - - - Ace - The High Performance Code Editor for the Web - - - - - - - - - - - + + + + ACE - The High Performance Code Editor for the Web + + + + + + + + + + + + + + - Fork me on GitHub + Fork me on GitHub -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The high performance code editor for the web.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The high performance code editor for the web.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -51,24 +54,23 @@ API Reference
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • - Real World Users + ACE in Production
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Support
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Built for Code

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace is an embeddable code editor written in JavaScript. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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 + 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. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                                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 @@ -82,19 +84,18 @@ function add(x, y) { } var addResult = add(3, 2); -console.log(addResult); -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +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)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • + kitchen sink.

                                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                Features

                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Syntax highlighting for over 40 languages (TextMate/Sublime/.tmlanguage files can be imported)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Over 20 themes (TextMate/Sublime/.tmtheme files can be imported)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Automatic indent and outdent
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • An optional command line
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Handles huge documents (four million lines seems to be the limit!)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Handles huge documents (at last check, 4,000,000 lines is the upper limit)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Fully customizable key bindings including vim and Emacs modes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Search and replace with regular expressions
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Highlight matching parentheses
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • @@ -107,43 +108,42 @@ console.log(addResult);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • 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 +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                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! -

                                                                                                                                                                                                                                                                                                                                                                                                                                                                + highlighting and keybindings!

                                                                                                                                                                                                                                                                                                                                                                                                                                                                git clone git://github.com/ajaxorg/ace.git
                                                                                                                                                                                                                                                                                                                                                                                                                                                                -

                                                                                                                                                                                                                                                                                                                                                                                                                                                                History

                                                                                                                                                                                                                                                                                                                                                                                                                                                                -

                                                                                                                                                                                                                                                                                                                                                                                                                                                                Skywriter/Bespin and Ace started +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                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 + 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 + 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 + 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 + 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. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                                + 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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Embedding ACE in Your Site

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              ACE can be easily embedded into a web page. Just copy the code below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              <!DOCTYPE html> <html lang="en"> <head> <title>ACE in Action</title> @@ -164,83 +164,116 @@ console.log(addResult); return x; }</div> -<script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> +<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +</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. + getting the contents from the editor.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Loading ACE from a Local URL

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The above code is all you need to embed ACE in your site (including setting language modes + and themes). Plus it's super fast because it's on Amazon's distributed content network.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              But, if you want to clone 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 as ace:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              var ace = require("lib/ace");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Working with Ace

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              In all of these examples Ace has been invoked - as shown in the embedding guide. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              > 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");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().setMode("ace/mode/javascript");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              ACE keeps everything about the state of the editor (selection, scroll position, etc.) + in editor.session. This means you can grab the + session, store it in a var, and set the editor to another session (e.g. a tabbed editor).

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              You might accomplish this like so:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              var EditSession = require("ace/edit_session").EditSession;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var js = new EditSession("some js code");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var css = new EditSession(["some", "css", "code here"]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +// and then to load document into editor, just call
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +editor.setSession(js);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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',{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.find('needle',{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   backwards: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   wrap: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   caseSensitive: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -250,99 +283,104 @@ editor.getValue(); // or session.getValue
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • + 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.find('foo');
                                                                                                                                                                                                                                                                                                                                                                                                                                                               editor.replace('bar');
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              And here's a replace all:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.replaceAll('bar');
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().on('change', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   // e.type, etc
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To listen for an selection change:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().selection.on('changeSelection', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().selection.on('changeSelection', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To listen for a cursor change:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().selection.on('changeCursor', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().selection.on('changeCursor', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Adding New Commands and Keybindings

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To assign key bindings to a custom function:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.commands.addCommand({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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";
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// defines the language specific highlighters and folding rules
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MyNewHighlightRules = require("./mynew_highlight_rules").MyNewHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MyNewFoldMode = require("./folding/mynew").MyNewFoldMode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var Mode = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // set everything up
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.HighlightRules = MyNewHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.$outdent = new MatchingBraceOutdent();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingRules = new MyNewFoldMode();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +// 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
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var highlighter = new MyNewHighlightRules();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.$outdent = new MatchingBraceOutdent();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.foldingRules = new MyNewFoldMode();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.$tokenizer = new Tokenizer(highlighter.getRules());
                                                                                                                                                                                                                                                                                                                                                                                                                                                               };
                                                                                                                                                                                                                                                                                                                                                                                                                                                               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
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +(function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    // Extra logic goes here--we won't be covering all of this
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    /* These are all optional pieces of code!
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   this.getNextLineIndent = function(state, line, tab) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       var indent = this.$getIndent(line);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       return indent;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -355,43 +393,40 @@ oop.inherits(Mode, TextMode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   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";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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 oop = require("../lib/oop");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MyNewHighlightRules = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var MyNewHighlightRules = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // regexp must not have capturing parentheses. Use (?:) instead.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // regexps are ordered -> the first match is used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   this.$rules = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        "start" : [
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    // 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
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                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
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -401,882 +436,467 @@ 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]+/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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("|")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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("|")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +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";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    token: function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (colors.hasOwnProperty(value.toLowerCase())) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            return "support.constant.color";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        else if (fonts.hasOwnProperty(value.toLowerCase())) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            return "support.constant.fonts";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        else if (fonts.hasOwnProperty(value.toLowerCase())) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            return "support.constant.fonts";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            return "text";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            return "text";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    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*)"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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)"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        merge : true,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        regex : "<\\!\\[CDATA\\[",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        next : "cdata"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   },
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "cdata" : [ {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        token : "text",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        regex : "\\]\\]>",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        next : "start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "cdata" : [ {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        token : "text",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        regex : "\\]\\]>",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        next : "start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        defaultToken : "text"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        token : "text",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        merge : true,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        regex : "\\s+"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        token : "text",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        merge : true,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        regex : ".+"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   } ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                               };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -this.$rules = new HtmlHighlightRules().getRules(); +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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 kitchen_sink.html and demo.js, as well as write any tests for the highlighting.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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": [ /* ... */ ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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": [ /* ... */ ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var newRules = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "start": [ /* ... */ ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              If you want to incorporate newRules into this.$rules, you'd do something like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              this.addRules(newRules, "new-");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var LuaPageHighlightRules = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.$rules = new HtmlHighlightRules().getRules();
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    for (var i in this.$rules) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        this.$rules[i].unshift({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            token: "keyword",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            regex: "<\\%\\=?",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            next: "lua-start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    for (var i in this.$rules) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.$rules[i].unshift({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            token: "keyword",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            regex: "<\\%\\=?",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            next: "lua-start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            token: "keyword",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            regex: "<\\?lua\\=?",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            next: "lua-start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            token: "keyword",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            regex: "<\\?lua\\=?",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            next: "lua-start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       });
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.embedRules(LuaHighlightRules, "lua-", [
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.embedRules(LuaHighlightRules, "lua-", [
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            token: "keyword",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            regex: "\\%>",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            next: "start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            token: "keyword",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            regex: "\\%>",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            next: "start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var MyMode = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingRules = new MyFoldMode();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    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";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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 oop = require("../../lib/oop");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var Range = require("../../range").Range;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var BaseFoldMode = require("./fold_mode").FoldMode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var FoldMode = exports.FoldMode = function() {};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var FoldMode = exports.FoldMode = function() {};
                                                                                                                                                                                                                                                                                                                                                                                                                                                               oop.inherits(FoldMode, BaseFoldMode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +(function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // regular expressions that identify starting and stopping points
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingStartMarker; 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingStopMarker;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    // regular expressions that identify starting and stopping points
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.foldingStartMarker; 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.foldingStopMarker;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.getFoldWidgetRange = function(session, foldStyle, row) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var line = session.getLine(row);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.getFoldWidgetRange = function(session, foldStyle, row) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var line = session.getLine(row);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        // test each line, and return a range of segments to collapse
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        // 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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    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:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The file that defines the behavior for this live demo is defined in demo/kitchen-sink/demo.js. You'll want to add lines to two separate objects:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. modesByName needs a new entry that defines all the rules regarding your new mode. Entries looks like propertyName: [dropdownName, arrayOfExtensions], where:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • propertyName is the name of the new language you're highlighting
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • dropdownName is an arbitrary string that lists your language in the live demo's Mode dropdown menu
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • arrayOfExtensions is an array of strings (seperated by |) that defines valid extensions to use for the new language.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              3. docs also needs a new entry, which defines the location of your sample document showing all the power of your new language. Entries look like filenamePath: modeToUse, where:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • filenamePath is the path to your example document. This should just be in docs/.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • modeToUse is the same arbitrary string as dropdownName
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              4. +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Once you set this up, you should see be able to witness a live demonstration of your new highlighter.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Adding Automated Tests

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              It's also suggested that you go one step further and define some automated tests to test your syntax highlighter. A basic test looks something like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              if (typeof process !== "undefined") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    require("amd-loader");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +define(function(require, exports, module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +"use strict";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var MyNewLanguage = require("./mynewlanguage").Mode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var assert = require("../test/assertions");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +module.exports = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    name: "MyNewLanguage Tokenizer",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    setUp : function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.tokenizer = new MyNewLanguage().getTokenizer();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "test: my random description" : function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var line = "-12px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var tokens = this.tokenizer.getLineTokens(line, "ruleset").tokens;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        assert.equal(2, tokens.length);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        assert.equal("constant.numeric", tokens[0].type);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "test: tokenize more than one thing" : function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var tokens = this.tokenizer.getLineTokens("{()}", "start").tokens;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        assert.equal(3, tokens.length);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        assert.equal("paren.lparen", tokens[0].type);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        assert.equal("text", tokens[1].type);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        assert.equal("paren.rparen", tokens[2].type);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +if (typeof module !== "undefined" && module === require.main) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    require("asyncjs").test.testcase(module.exports).exec()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              All tests contain a string describing what the test is doing. Then, you define an arbitrary line that you want your tokenizer to check. It's recommended that you test both the number of tokens found, as well as the values of those tokens.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Any file 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:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace API Reference

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Welcome to the Ace API Reference!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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 embedding guide. +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Projects Using Ace

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace is used all over the web in all kinds of production applications. Here is - just a small sampling:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              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:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - + + + - - - - + + + + + diff --git a/install.js b/install.js new file mode 100644 index 00000000..dca36fff --- /dev/null +++ b/install.js @@ -0,0 +1,73 @@ +#!/usr/bin/env node +/* ***** BEGIN LICENSE BLOCK ***** + * Ace is 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: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Ajax.org B.V. + * 4. Neither the name of the Ajax.org B.V. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AJAX.ORG B.V. ''AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ***** END LICENSE BLOCK ***** */ + +var buildAce = require("./Makefile.dryice").buildAce; +var fs = require("fs"); + +var ACE_HOME = __dirname; + +function getVersion(path) { + if (fs.existsSync(path + "/.git-ref")) + return fs.readFileSync(path + "/.git-ref", "utf8"); + if (fs.existsSync(path + "/.git/ORIG_HEAD")) + return fs.readFileSync(path + "/.git/ORIG_HEAD", "utf8"); + if (fs.existsSync(path + "/.sourcemint/source.json")) { + var json = fs.readFileSync(path + "/.sourcemint/source.json", "utf8"); + return JSON.parse(json).url.split("/").pop(); + } +} + +if (process.argv.indexOf("-c") > 0) try { + var version = getVersion(ACE_HOME); + var oldVersion = getVersion(ACE_HOME + "/build"); + if (version && oldVersion == version) { + console.log("ace build is up to date"); + process.exit(0); + } + fs.writeFileSync(ACE_HOME + "/build/.git-ref", version, "utf8"); +} catch (e) {} + +try { + buildAce({ + compress: false, + noconflict: false, + suffix: "", + name: "ace" + }); + +} catch (err) { + console.error("--- Ace Build error ---"); + console.error(err.stack); + process.exit(1); +} \ No newline at end of file diff --git a/kitchen-sink.html b/kitchen-sink.html index a8e1fb7b..324e5778 100644 --- a/kitchen-sink.html +++ b/kitchen-sink.html @@ -5,24 +5,30 @@ Ace Kitchen Sink + - - + + + + - + -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -57,7 +63,38 @@ @@ -69,10 +106,8 @@ - - @@ -113,7 +148,7 @@ - +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -149,8 +184,6 @@ @@ -205,22 +238,6 @@ - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -229,41 +246,14 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -283,7 +272,7 @@ - + diff --git a/lib/ace/ace.js b/lib/ace/ace.js index 6c8a6126..b40ab454 100644 --- a/lib/ace/ace.js +++ b/lib/ace/ace.js @@ -29,9 +29,11 @@ * ***** 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 +41,58 @@ 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("./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); + if (!(el = document.getElementById(el))) + throw "ace.edit can't find div #" + _id; } - 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..b10755bb 100644 --- a/lib/ace/anchor.js +++ b/lib/ace/anchor.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -35,126 +35,148 @@ 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. + + /** + * Anchor@change(e) + * - e (Object): 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 + Both of these objects have a `row` and `column` property corresponding to the position. * - * Both of these objects have a `row` and `column` property corresponding to the position. + * Fires whenever the anchor position changes. * * 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) + 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; - var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight); - this.setPosition(point.row, point.column, true); - }; + if (range.start.row > this.row) + return; + + if (range.start.row == this.row && range.start.column > this.column) + return; - 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. + var row = this.row; + var column = this.column; - // DELTA AFTER POINT: No change needed. - if ($pointsInOrder(point, deltaStart, moveIfEqual)) { - return { - row: point.row, - column: point.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; + } } - - // 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) - }; + 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; + } + } } - - // DELTA ENVELOPS POINT (delete only): Move point to delta start. - // TODO warn if delta.action != "remove" ? - - return { - row: deltaStart.row, - column: deltaStart.column - }; - } - /** + 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. - * @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 * **/ + this.setPosition = function(row, column, noClip) { var pos; if (noClip) { @@ -162,47 +184,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 +240,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..b9c5cd66 100644 --- a/lib/ace/anchor_test.js +++ b/lib/ace/anchor_test.js @@ -57,55 +57,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 +78,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 +110,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 +134,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 +167,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..08a46d5d 100644 --- a/lib/ace/background_tokenizer.js +++ b/lib/ace/background_tokenizer.js @@ -34,21 +34,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 +67,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 +98,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 +113,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 +127,19 @@ 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. * **/ - /** - * 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 + /** + * BackgroundTokenizer@update(e) + * - e (Object): An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. + * + * Fires whenever the background tokeniziers between a range of rows are going to be updated. * **/ this.fireUpdateEvent = function(firstRow, lastRow) { @@ -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..c62e33f1 100644 --- a/lib/ace/background_tokenizer_test.js +++ b/lib/ace/background_tokenizer_test.js @@ -62,62 +62,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..26863643 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.byName = {}; + 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..76d973bb 100644 --- a/lib/ace/commands/command_manager_test.js +++ b/lib/ace/commands/command_manager_test.js @@ -188,7 +188,7 @@ module.exports = { assert.equal(command, "cm2"); var command = this.cm.findKeyCommand(0, "return"); - assert.equal(command + "", ["cm4", "cm3"] + ""); + assert.equal(command, "cm3"); } }; diff --git a/lib/ace/commands/default_commands.js b/lib/ace/commands/default_commands.js index de14df85..8c33fc42 100644 --- a/lib/ace/commands/default_commands.js +++ b/lib/ace/commands/default_commands.js @@ -32,48 +32,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 +64,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 +108,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 +268,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 +287,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 +310,60 @@ 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" + multiSelectAction: "forEach" }, { 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" + multiSelectAction: "forEach" }, { 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 +376,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..ff59f045 100644 --- a/lib/ace/commands/multi_select_commands.js +++ b/lib/ace/commands/multi_select_commands.js @@ -35,49 +35,41 @@ 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", @@ -87,14 +79,7 @@ exports.defaultCommands = [{ }, { 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", - readonly: true + bindKey: {win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A"} }]; // commands active only in multiselect mode @@ -102,7 +87,6 @@ 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..5a1b0e47 100644 --- a/lib/ace/config.js +++ b/lib/ace/config.js @@ -32,14 +32,9 @@ 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 = { @@ -70,81 +65,30 @@ 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) { + 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 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,11 +96,7 @@ 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 { @@ -320,41 +268,40 @@ box-sizing: border-box; margin: 0 -12px 0 1px; - display: none; + display: inline-block; width: 11px; vertical-align: top; - 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.ace_end { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg=="); + 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_closed { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA=="); + 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); } /** @@ -374,22 +321,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 { 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; } @@ -410,42 +367,18 @@ font-style: italic; } +.ace_mobile_scroll-layer { + -webkit-overflow-scrolling: touch; + overflow-y: scroll; +} -.ace_error-marker { - background-color: rgba(255, 0, 0,0.2); +.ace_mobile_scroll-layer div { + z-index: 1; 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< 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 +198,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 +209,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 +221,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 +239,334 @@ 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. + * + * + **/ + /** + * Document@change(e) + * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties. + * + * Fires whenever the document changes. + * + * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available: + * + * * `"insertLines"` (emitted by [[Document.insertLines]]) + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines in the document that are changing + * * `"insertText"` (emitted by [[Document.insertNewLine]]) + * * `range`: the [[Range]] of the change within the document + * * `text`: the text that's being added + * * `"removeLines"` (emitted by [[Document.insertLines]]) + * * `range`: the [[Range]] of the change within the document + * * `lines`: the lines in the document that were removed + * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]]) + * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]]) + * * `range`: the [[Range]] of the change within the document + * * `text`: the text that's being removed + * + **/ + this.insertLines = function(row, lines) { + if (lines.length == 0) + return {row: row, column: 0}; + + // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF) + // to circumvent that we have to break huge inserts into smaller chunks here + if (lines.length > 0xFFFF) { + var end = this.insertLines(row, lines.slice(0xFFFF)); + lines = lines.slice(0, 0xFFFF); + } + + var args = [row, 0]; + args.push.apply(args, lines); + this.$lines.splice.apply(this.$lines, args); + + var range = new Range(row, 0, row + lines.length, 0); + var delta = { + action: "insertLines", + range: range, lines: lines - }); - - 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 +575,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..5c324db0 100644 --- a/lib/ace/document_test.js +++ b/lib/ace/document_test.js @@ -46,7 +46,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 +63,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 +80,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 +97,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 +107,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 +124,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 +141,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 +158,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 +175,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 +192,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 +209,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 +226,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 +235,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 +296,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..dffcd73d 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -31,9 +31,10 @@ 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,101 +44,107 @@ 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) + * - e (Object): An object containing a `delta` of information about the change. * * Emitted when the document changes. - * @event change - * @param {Object} e An object containing a `delta` of information about the change. **/ /** + * EditSession@changeTabSize() + * * Emitted when the tab size changes, via [[EditSession.setTabSize]]. - * - * @event changeTabSize **/ /** + * EditSession@changeOverwrite() + * * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. - * - * @event changeOverwrite **/ /** + * EditSession@changeBreakpoint() + * * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. - * - * @event changeBreakpoint **/ /** + * EditSession@changeFrontMarker() + * * Emitted when a front marker changes. - * - * @event changeFrontMarker **/ /** + * EditSession@changeBackMarker() + * * Emitted when a back marker changes. - * - * @event changeBackMarker **/ /** + * EditSession@changeAnnotation() + * * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. - * - * @event changeAnnotation **/ /** + * EditSession@tokenizerUpdate(e) + * - e (Object): An object containing one property, `"data"`, that contains information about the changing rows + * * Emitted when a background tokenizer asynchronously processes new rows. - * @event tokenizerUpdate - * - * @param {Object} e An object containing one property, `"data"`, that contains information about the changing rows * **/ -/** +/** hide + * EditSession@loadMode(e) + * + * + * + **/ +/** + * EditSession@changeMode() + * * Emitted when the current mode changes. * - * @event changeMode - * **/ -/** +/** + * EditSession@changeWrapMode() + * * Emitted when the wrap mode changes. * - * @event changeWrapMode - * **/ -/** +/** + * EditSession@changeWrapLimit() + * * Emitted when the wrapping limit changes. * - * @event changeWrapLimit - * **/ /** - * Emitted when a code fold is added or removed. + * EditSession@changeFold(e) * - * @event changeFold + * Emitted when a code fold is added or removed. * **/ /** + * EditSession@changeScrollTop(scrollTop) + * - scrollTop (Number): The new scroll top value + * * Emitted when the scroll top changes. - * @event changeScrollTop - * - * @param {Number} scrollTop The new scroll top value **/ /** + * EditSession@changeScrollLeft(scrollLeft) + * - scrollLeft (Number): The new scroll left value + * * 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) { @@ -147,23 +154,25 @@ var EditSession = function(text, mode) { this.$backMarkers = {}; this.$markerId = 1; this.$undoSelect = true; - + this.$foldData = []; this.$foldData.toString = function() { - return this.join("\n"); - }; + var str = ""; + this.forEach(function(foldLine) { + str += "\n" + foldLine.toString(); + }); + return str; + } this.on("changeFold", this.onChangeFold.bind(this)); this.$onChange = this.onChange.bind(this); - + if (typeof text != "object" || !text.getLine) text = new Document(text); this.setDocument(text); - this.selection = new Selection(this); - config.resetOptions(this); + this.selection = new Selection(this); this.setMode(mode); - config._signal("session", this); }; @@ -172,9 +181,10 @@ 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) { @@ -191,15 +201,20 @@ var EditSession = function(text, mode) { }; /** + * 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) { @@ -208,12 +223,12 @@ var EditSession = function(text, mode) { this.$screenRowCache = []; return; } - 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); - } + var l = this.$docRowCache.length; + this.$docRowCache.splice(i, l); + this.$screenRowCache.splice(i, l); + }; this.$getRowCacheIndex = function(cacheArray, val) { @@ -232,7 +247,7 @@ var EditSession = function(text, mode) { return mid; } - return low -1; + return low && low -1; }; this.resetCaches = function() { @@ -249,12 +264,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 +283,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 +324,30 @@ var EditSession = function(text, mode) { }; /** + * EditSession.getSelection() -> Selection + * * 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 +355,11 @@ var EditSession = function(text, mode) { }; /** + * EditSession.getTokenAt(row, column) -> Object + * - row (Number): The row number to retrieve from + * - column (Number): The column number to retrieve from + * * 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 - * - * **/ this.getTokenAt = function(row, column) { var tokens = this.bgTokenizer.getTokens(row); @@ -362,12 +381,12 @@ var EditSession = function(text, mode) { token.start = c - token.value.length; return token; }; - + /** + * 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 +399,11 @@ var EditSession = function(text, mode) { if (undoManager) { var self = this; - + /** internal, hide + * EditSession.$syncInformUndoManager() + * + * + **/ this.$syncInformUndoManager = function() { self.$informUndoManager.cancel(); @@ -403,25 +426,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 +444,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 +465,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 +515,35 @@ 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. + * 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. * - * @param {Boolean} overwrite Defines wheter or not to set overwrites - * - * **/ 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 +551,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 +560,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 +606,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 +667,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 +696,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,15 +720,16 @@ 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; @@ -693,8 +741,8 @@ var EditSession = function(text, mode) { this.$searchHighlight = this.addDynamicMarker(highlight); } this.$searchHighlight.setRegexp(re); - }; - + } + // experimental this.highlightLines = function(startRow, endRow, clazz, inFront) { if (typeof endRow != "number") { @@ -703,12 +751,14 @@ var EditSession = function(text, mode) { } if (!clazz) clazz = "ace_step"; - + var range = new Range(startRow, 0, endRow, Infinity); - range.id = this.addMarker(range, clazz, "fullLine", inFront); + + var id = this.addMarker(range, clazz, "fullLine", inFront); + range.id = id; return range; - }; - + }, + /* * Error: * { @@ -719,34 +769,40 @@ 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._emit("changeAnnotation", {}); }; /** + * EditSession.getAnnotations() -> Object + * * Returns the annotations for the `EditSession`. - * @returns {Array} **/ this.getAnnotations = function() { 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 +815,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 +831,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 +857,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 +873,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 +1044,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 +1103,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 +1128,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 +1194,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) -> String + * - range (Range): 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 +1297,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 +1326,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 +1383,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 +1392,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 +1413,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 +1502,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 +1626,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 +1640,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 +1665,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 +1745,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 +1802,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 +1819,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 +1846,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 +1863,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); @@ -1774,6 +1877,10 @@ var EditSession = function(text, mode) { this.$rowLengthCache[lastRow] = null; }; + /** internal, hide + * EditSession.$updateWrapData(firstRow, lastRow) + * + **/ this.$updateWrapData = function(firstRow, lastRow) { var lines = this.doc.getAllLines(); var tabSize = this.getTabSize(); @@ -1787,7 +1894,7 @@ 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 { @@ -1811,8 +1918,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 +1939,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 +1953,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 +1969,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 +1993,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 +2019,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 +2038,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 +2055,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 +2098,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 +2139,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 +2154,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 +2185,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 +2198,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 +2248,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 = i != 0 || !rowCache.length; } var maxRow = this.getLength() - 1; @@ -2203,7 +2262,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 +2273,6 @@ var EditSession = function(text, mode) { foldStart = foldLine ? foldLine.start.row : Infinity; } } - if (doCache) { this.$docRowCache.push(docRow); this.$screenRowCache.push(row); @@ -2229,26 +2287,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 +2317,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 +2353,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 = i != 0 || !rowCache.length; } var foldLine = this.getNextFoldLine(row); @@ -2340,44 +2395,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 +2433,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 +2456,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 +2466,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 +2513,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..e7a08056 100644 --- a/lib/ace/edit_session/bracket_match.js +++ b/lib/ace/edit_session/bracket_match.js @@ -37,10 +37,10 @@ var Range = require("../range").Range; function BracketMatch() { - this.findMatchingBracket = function(position, chr) { + this.findMatchingBracket = function(position, char) { if (position.column == 0) return null; - var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column-1); + var charBeforeCursor = char || this.getLine(position.row).charAt(position.column-1); if (charBeforeCursor == "") return null; var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); @@ -117,7 +117,6 @@ function BracketMatch() { typeRe = new RegExp( "(\\.?" + token.type.replace(".", "\\.").replace("rparen", ".paren") - .replace(/\b(?:end)\b/, "(?:start|begin|end)") + ")+" ); } @@ -174,7 +173,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..3a66f9c5 100644 --- a/lib/ace/edit_session/fold.js +++ b/lib/ace/edit_session/fold.js @@ -31,9 +31,6 @@ 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 +42,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 +64,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 +95,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..cec3eb4c 100644 --- a/lib/ace/edit_session/fold_line.js +++ b/lib/ace/edit_session/fold_line.js @@ -44,7 +44,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 +66,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 +93,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 +116,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 +127,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 +138,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 +150,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), @@ -175,7 +175,7 @@ function FoldLine(foldData, folds) { } 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 +189,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 +211,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 +222,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 +230,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 +261,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..f3029c18 100644 --- a/lib/ace/edit_session/folding.js +++ b/lib/ace/edit_session/folding.js @@ -66,6 +66,7 @@ function Folding() { * */ this.getFoldsInRange = function(range) { + range = range.clone(); var start = range.start; var end = range.end; var foldLines = this.$foldData; @@ -103,23 +104,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 +114,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 +249,7 @@ function Folding() { return foldLine; }; - /** + /* * Adds a new fold. * * @returns @@ -268,10 +263,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 +274,28 @@ 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 (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 +304,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 +318,8 @@ function Folding() { } } break; - } else if (endRow <= foldLine.start.row) { + } + else if (endRow <= foldLine.start.row) { break; } } @@ -340,7 +334,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 +386,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 +413,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 +427,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 +462,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) { textLine += placeholder; } else { textLine += doc.getLine(row).substring(lastColumn, column); } - }, endRow, endColumn); + }.bind(this), endRow, endColumn); return textLine; }; @@ -554,22 +533,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 +560,8 @@ function Folding() { if (tryToUnfold && folds.length) { this.expandFolds(folds); return; - } else if (folds.length == 1 ) { + } + else if (folds.length == 1 ) { fold = folds[0]; } } @@ -633,15 +617,10 @@ function Folding() { } }; - 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 +628,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 +659,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 +679,63 @@ 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 += " ace_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 +743,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..e89ad57f 100644 --- a/lib/ace/edit_session_test.js +++ b/lib/ace/edit_session_test.js @@ -62,7 +62,6 @@ function createFoldTestSession() { } 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]); @@ -280,7 +279,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 +379,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 +405,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 +424,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 +453,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() { @@ -916,27 +898,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 +911,7 @@ module.exports = { fail = true; } if (fail != shouldFail) { - throw new Error("Expected to get an exception"); + throw "Expected to get an exception"; } } @@ -1018,8 +980,7 @@ module.exports = { assertArray(session.$docRowCache, [1,3,4]); assertArray(session.$screenRowCache, [1,2,3]); - var pos = session.screenToDocumentPosition(0,0); - assert.equal(pos.row, 0); + session.screenToDocumentPosition(0,0); assertArray(session.$docRowCache, [1,3,4]); assertArray(session.$screenRowCache, [1,2,3]); @@ -1030,58 +991,11 @@ module.exports = { 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..d09a724e 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -34,7 +34,6 @@ 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; @@ -47,26 +46,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(); @@ -87,204 +81,49 @@ var Editor = function(renderer, session) { 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. **/ /** - * Sets a new editsession to use. This method also emits the `'changeSession'` event. - * @param {EditSession} session The new session to use + * Editor@changeSession(e) + * - e (Object): An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s. * + * Emitted whenever the [[EditSession]] changes. **/ this.setSession = function(session) { if (this.session == session) return; - - // 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 +137,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 +145,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 +246,87 @@ 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(force) + * - force (Boolean): If `true`, recomputes the size, even if the height and width haven't changed + * * {: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) + * - theme (String): The path to a 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) + * - style (String): A class name + * * {: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 +342,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 +386,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 +418,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,32 +450,34 @@ 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@changeSelection() * + * Emitted when the selection 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(); @@ -747,22 +485,17 @@ var Editor = function(renderer, session) { 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 && !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; + session.$highlightLineMarker = session.highlightLines(highlight.row, highlight.row, "ace_active-line"); } 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._emit("changeBackMarker"); } }; @@ -782,10 +515,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() { @@ -839,9 +572,8 @@ var Editor = function(renderer, session) { }; - this.onChangeMode = function(e) { + this.onChangeMode = function() { this.renderer.updateText(); - this._emit("changeMode", e); }; @@ -862,33 +594,29 @@ 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 + * Editor@copy(text) + * - text (String): The copied text * - **/ - /** - * Returns the string of text currently highlighted. - * @returns {String} - * @deprecated Use getSelectedText instead. + * Emitted when text is copied. **/ 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 +624,62 @@ 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(text) + * - text (String): The pasted text * + * Called whenever a text "paste" happens. **/ /** - * Called whenever a text "paste" happens. - * @param {String} text The pasted text - * + * Editor@paste(text) + * - text (String): The pasted text * + * Emitted when text is pasted. **/ - 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.onPaste = function(text) { + // todo this should change when paste becomes a command + if (this.$readOnly) + return; + this._emit("paste", text); + this.insert(text); }; + this.execCommand = function(command, args) { - return this.commands.exec(command, this, args); + this.commands.exec(command, this, args); }; /** + * 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,13 +688,6 @@ 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; @@ -1015,10 +710,44 @@ var Editor = function(renderer, session) { } } + // TODO disabled multiline auto indent + // possibly doing the indent before inserting the text + // if (cursor.row !== end.row) { if (session.getDocument().isNewLine(text)) { var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); - session.insert({row: cursor.row+1, column: 0}, lineIndent); + 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 +761,165 @@ 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. + * + **/ + /** + * Editor@changeSelectionStyle(data) + * - data (Object): Contains one property, `data`, which indicates the new selection style + * + * Emitted when the selection style changes, via [[Editor.setSelectionStyle]]. + * + **/ + this.setSelectionStyle = function(style) { + if (this.$selectionStyle == style) return; + + this.$selectionStyle = style; + this.onSelectionChange(); + this._emit("changeSelectionStyle", {data: style}); + }; + + /** + * 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 +934,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 +961,147 @@ 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; + /** - * 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 - * + * Editor.setBehavioursEnabled(enabled) + * - enabled (Boolean): Enables or disables behaviors + * + * Specifies whether to use behaviors or not. + * See [[Editor.setWrapBehavioursEnabled]]. + * ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} **/ 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; }; + this.$modeWrapBehaviours = true; + /** + * Editor.setWrapBehavioursEnabled(enabled) + * - enabled (Boolean): Enables or disables wrapping behaviors + * * 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); + this.$modeWrapBehaviours = enabled; }; /** + * Editor.getWrapBehavioursEnabled() -> Boolean + * * Returns `true` if the wrapping behaviors are currently enabled. **/ this.getWrapBehavioursEnabled = function () { - return this.getOption("wrapBehavioursEnabled"); + return this.$modeWrapBehaviours; }; /** - * 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 +1117,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 +1126,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.removeWordRight() + * * Removes the word directly to the right of the current selection. **/ this.removeWordRight = function() { @@ -1344,6 +1139,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.removeWordLeft() + * * Removes the word directly to the left of the current selection. **/ this.removeWordLeft = function() { @@ -1355,6 +1152,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 +1165,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 +1184,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.splitLine() + * * Splits the line at the current selection (by inserting an `'\n'`). **/ this.splitLine = function() { @@ -1397,6 +1200,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.transposeLetters() + * * Transposes current line. **/ this.transposeLetters = function() { @@ -1423,6 +1228,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.toLowerCase() + * * Converts the current selection entirely into lowercase. **/ this.toLowerCase = function() { @@ -1438,6 +1245,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.toUpperCase() + * * Converts the current selection entirely into uppercase. **/ this.toUpperCase = function() { @@ -1452,60 +1261,38 @@ 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(); @@ -1538,6 +1325,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.toggleCommentLines() + * * Given the currently selected range, this function either comments all the lines, or uncomments all of them. **/ this.toggleCommentLines = function() { @@ -1546,40 +1335,35 @@ 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} + * Editor.getNumberAt() -> Number + * + * Works like [[Editor.getTokenAt]], except it returns a number. **/ - this.getNumberAt = function(row, column) { - var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; - _numberRx.lastIndex = 0; + 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); + var s = this.session.getLine(row) + while(_numberRx.lastIndex < column - 1 ){ + 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 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) + * Editor.modifyNumber(amount) + * - amount (Number): The value to change the numeral by (can be negative to decrease value) * + * If the character before the cursor is a number, this functions changes its value by `amount`. **/ this.modifyNumber = function(amount) { var row = this.selection.getCursor().row; @@ -1600,14 +1384,14 @@ var Editor = function(renderer, session) { 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); @@ -1623,13 +1407,22 @@ var Editor = function(renderer, session) { } }; - /** + /** 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(); }; @@ -1637,143 +1430,143 @@ var Editor = function(renderer, session) { 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 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); + + 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 +1582,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 +1635,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 +1655,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 +1664,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 +1673,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 +1682,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 +1691,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 +1700,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 +1742,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 +1790,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 +2094,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 +2150,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 +2180,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 +2196,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 +2208,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_highlight_selected_word_test.js b/lib/ace/editor_highlight_selected_word_test.js index 13e19c23..864de9a1 100644 --- a/lib/ace/editor_highlight_selected_word_test.js +++ b/lib/ace/editor_highlight_selected_word_test.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE diff --git a/lib/ace/editor_text_edit_test.js b/lib/ace/editor_text_edit_test.js index 77ec34ed..cda1e426 100644 --- a/lib/ace/editor_text_edit_test.js +++ b/lib/ace/editor_text_edit_test.js @@ -42,7 +42,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 +184,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 +235,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 +245,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 +257,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 +284,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 +314,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 +324,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 +339,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/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/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..aa8c4ce6 100644 --- a/lib/ace/ext/static_highlight.js +++ b/lib/ace/ext/static_highlight.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -34,158 +34,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..a8f6317f 100644 --- a/lib/ace/ext/textarea.js +++ b/lib/ace/ext/textarea.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -73,8 +73,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 +132,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 +145,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 +160,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 +177,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 +198,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 +207,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 +218,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 +228,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 +248,7 @@ exports.transformTextarea = function(element, options) { this.style.cursor = "nw-resize"; } }); - + event.addListener(settingOpener, "mousedown", function(e) { if (state == "toggle") { editor.setDisplaySettings(); @@ -276,98 +280,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 +442,7 @@ function setupSettingPanel(settingDiv, settingOpener, editor) { twilight: "Twilight", vibrant_ink: "Vibrant Ink" }, - showGutter: BOOL, + gutter: BOOL, fontSize: { "10px": "10px", "11px": "11px", @@ -427,17 +450,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 +465,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 +509,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..8fc3aeeb 100644 --- a/lib/ace/keyboard/emacs.js +++ b/lib/ace/keyboard/emacs.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -32,18 +32,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,26 +49,20 @@ 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;\ }\ @@ -88,268 +79,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 +190,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", @@ -386,16 +219,14 @@ exports.emacsKeys = { "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,26 +245,27 @@ 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" }; @@ -443,7 +275,7 @@ exports.handler.addCommands({ recenterTopBottom: function(editor) { var renderer = editor.renderer; var pos = renderer.$cursorLayer.getPixelPosition(); - var h = renderer.$size.scrollerHeight - renderer.lineHeight; + var h = renderer.$size.scrollerHeight - renderer.lineHeight; var scrollTop = renderer.scrollTop; if (Math.abs(pos.top - scrollTop) < 2) { scrollTop = pos.top - h; @@ -457,74 +289,15 @@ exports.handler.addCommands({ 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 +314,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 +326,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.commands.byName.cut.exec(editor); }, - 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 +357,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 +371,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..92001c02 100644 --- a/lib/ace/keyboard/hash_handler.js +++ b/lib/ace/keyboard/hash_handler.js @@ -31,27 +31,17 @@ 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 +53,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,11 +114,16 @@ MultiHashHandler.prototype = HashHandler.prototype; }; this._buildKeyHash = function(command) { - this.bindKey(command.bindKey, command); - }; + var binding = command.bindKey; + if (!binding) + return; - // accepts keys in the form ctrl+Enter or ctrl-Enter - // keys without modifiers or shift only + 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(); @@ -206,51 +139,25 @@ MultiHashHandler.prototype = HashHandler.prototype; 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; - } + if (modifier == null) + throw "invalid modifier " + parts[i] + " in " + keys; hashId |= modifier; } 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]; }; 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..f92d1f6f 100644 --- a/lib/ace/keyboard/keybinding.js +++ b/lib/ace/keyboard/keybinding.js @@ -36,7 +36,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 +46,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 +62,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 +87,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..6108eab7 100644 --- a/lib/ace/keyboard/state_handler.js +++ b/lib/ace/keyboard/state_handler.js @@ -223,7 +223,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..44632ef3 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -34,442 +34,262 @@ 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.wrap = "off"; + text.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 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 = ""; - }, 0); - }; - this.blur = function() { text.blur(); }; - this.isFocused = function() { - return isFocused; - }; - - // 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) + var PLACEHOLDER = useragent.isIE ? "\x01" : "\x00"; + reset(true); + if (isFocused()) host.onFocus(); + var inCompostion = false; + var copied = false; + var pasted = false; + var tempStyle = ''; - 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; - } + function reset(full) { + try { + if (full) { + text.value = PLACEHOLDER; + text.selectionStart = 0; + text.selectionEnd = 1; + } else + text.select(); + } catch (e) {} } - 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); + 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); + } - 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(); + if (value && value != PLACEHOLDER) { + if (pasted) + host.onPaste(value); + else + host.onTextInput(value); + } } - 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); - }); + } + + copied = false; + pasted = false; + + // Safari doesn't fire copy events if no text is selected + reset(true); } - var onSelect = function(e) { - if (copied) { - copied = false; - } else if (isAllSelected(text)) { - host.selectAll(); - resetSelection(); - } else if (inputHandler) { - resetSelection(host.selection.isEmpty()); - } + var onTextInput = function(e) { + if (!inCompostion) + sendText(e.data); + setTimeout(function () { + if (!inCompostion) + reset(true); + }, 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 onPropertyChange = function(e) { + setTimeout(function() { + if (!inCompostion) + if(text.value != "") { + sendText(); + } + }, 0); }; - var doCopy = function(e, isCut) { - var data = host.getCopyText(); - if (!data) - return event.preventDefault(e); + var onCompositionStart = function(e) { + inCompostion = true; + host.onCompositionStart(); + setTimeout(onCompositionUpdate, 0); + }; - 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 onCompositionUpdate = function() { + if (!inCompostion) return; + host.onCompositionUpdate(text.value); }; - - var onCut = function(e) { - doCopy(e, true); + + var onCompositionEnd = function(e) { + inCompostion = false; + host.onCompositionEnd(); }; - + 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 +298,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) + 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..5313e44c 100644 --- a/lib/ace/keyboard/vim.js +++ b/lib/ace/keyboard/vim.js @@ -1,6177 +1,149 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Supported keybindings: +/* ***** BEGIN LICENSE BLOCK ***** + * Distributed under the BSD license: * - * Motion: - * h, j, k, l - * gj, gk - * e, E, w, W, b, B, ge, gE - * f, F, t, T - * $, ^, 0, -, +, _ - * gg, G - * % - * ', ` + * 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. * - * Operator: - * d, y, c - * dd, yy, cc - * g~, g~g~ - * >, <, >>, << - * - * Operator-Motion: - * x, X, D, Y, C, ~ - * - * Action: - * a, i, s, A, I, S, o, O - * zz, z., z, zt, zb, z- - * J - * u, Ctrl-r - * m - * r - * - * Modes: - * ESC - leave insert mode, visual mode, and clear input state. - * Ctrl-[, Ctrl-c - same as ESC. - * - * 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. - * - * 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 ((key == "esc" && hashId == 0) || key == "ctrl-[") { + return {command: coreCommands.stop}; + } else if (data.state == "start") { + if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) { + hashId = -1; + key = data.inputChar; + } + + if (hashId == -1 || hashId == 1) { + if (cmds.inputBuffer.idle && startCommands[key]) + return startCommands[key]; + return { + command: { + exec: function(editor) {cmds.inputBuffer.push(editor, key);} + } + }; + } // if no modifier || shift: wait for input. + else if (key.length == 1 && (hashId == 0 || hashId == 4)) { + return {command: "null", passEvent: true}; + } else if (key == "esc" && hashId == 0) { + return {command: coreCommands.stop}; + } + } else { + if (key == "ctrl-w") { + return {command: "removewordleft"}; + } + } + }, + + attach: function(editor) { + editor.on("click", exports.onCursorMove); + if (util.currentMode !== "insert") + cmds.coreCommands.stop.exec(editor); + editor.$vimModeHandler = this; + }, + + detach: function(editor) { + editor.removeListener("click", exports.onCursorMove); + util.noMode(editor); + util.currentMode = "normal"; + }, + + actions: cmds.actions, + getStatusText: function() { + if (util.currentMode == "insert") + return "INSERT"; + if (util.onVisualMode) + return (util.onVisualLineMode ? "VISUAL LINE " : "VISUAL ") + cmds.inputBuffer.status; + return cmds.inputBuffer.status; + } +}; + + +exports.onCursorMove = function(e) { + cmds.onCursorMove(e.editor, e); + exports.onCursorMove.scheduled = false; +}; + }); diff --git a/lib/ace/keyboard/vim/commands.js b/lib/ace/keyboard/vim/commands.js new file mode 100644 index 00000000..a9b24aa3 --- /dev/null +++ b/lib/ace/keyboard/vim/commands.js @@ -0,0 +1,561 @@ +/* ***** 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) { + +"never use strict"; + +var util = require("./maps/util"); +var motions = require("./maps/motions"); +var operators = require("./maps/operators"); +var alias = require("./maps/aliases"); +var registers = require("./registers"); + +var NUMBER = 1; +var OPERATOR = 2; +var MOTION = 3; +var ACTION = 4; +var HMARGIN = 8; // Minimum amount of line separation between margins; + +var repeat = function repeat(fn, count, args) { + while (0 < count--) + fn.apply(this, args); +}; + +var ensureScrollMargin = function(editor) { + var renderer = editor.renderer; + var pos = renderer.$cursorLayer.getPixelPosition(); + + var top = pos.top; + + var margin = HMARGIN * renderer.layerConfig.lineHeight; + if (2 * margin > renderer.$size.scrollerHeight) + margin = renderer.$size.scrollerHeight / 2; + + if (renderer.scrollTop > top - margin) { + renderer.session.setScrollTop(top - margin); + } + + if (renderer.scrollTop + renderer.$size.scrollerHeight < top + margin + renderer.lineHeight) { + renderer.session.setScrollTop(top + margin + renderer.lineHeight - renderer.$size.scrollerHeight); + } +}; + +var actions = exports.actions = { + "z": { + param: true, + fn: function(editor, range, count, param) { + switch (param) { + case "z": + editor.renderer.alignCursor(null, 0.5); + break; + case "t": + editor.renderer.alignCursor(null, 0); + break; + case "b": + editor.renderer.alignCursor(null, 1); + break; + } + } + }, + "r": { + param: true, + fn: function(editor, range, count, param) { + if (param && param.length) { + repeat(function() { editor.insert(param); }, count || 1); + editor.navigateLeft(); + } + } + }, + "R": { + fn: function(editor, range, count, param) { + util.insertMode(editor); + editor.setOverwrite(true); + } + }, + "~": { + fn: function(editor, range, count) { + repeat(function() { + var range = editor.selection.getRange(); + if (range.isEmpty()) + range.end.column++; + var text = editor.session.getTextRange(range); + var toggled = text.toUpperCase(); + if (toggled == text) + editor.navigateRight(); + else + editor.session.replace(range, toggled); + }, count || 1); + } + }, + "*": { + fn: function(editor, range, count, param) { + editor.selection.selectWord(); + editor.findNext(); + ensureScrollMargin(editor); + var r = editor.selection.getRange(); + editor.selection.setSelectionRange(r, true); + } + }, + "#": { + fn: function(editor, range, count, param) { + editor.selection.selectWord(); + editor.findPrevious(); + ensureScrollMargin(editor); + var r = editor.selection.getRange(); + editor.selection.setSelectionRange(r, true); + } + }, + "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, ch, keyId) { + this.idle = false; + var wObj = this.waitingForParam; + if (wObj) { + this.exec(editor, wObj, ch); + } + // If input is a number (that doesn't start with 0) + else if (!(ch === "0" && !this.currentCount.length) && + (ch.match(/^\d+$/) && this.isAccepting(NUMBER))) { + // Assuming that ch is always of type String, and not Number + this.currentCount += ch; + this.currentCmd = NUMBER; + this.accepting = [NUMBER, OPERATOR, MOTION, ACTION]; + } + else if (!this.operator && this.isAccepting(OPERATOR) && operators[ch]) { + this.operator = { + ch: ch, + count: this.getCount() + }; + this.currentCmd = OPERATOR; + this.accepting = [NUMBER, MOTION, ACTION]; + this.exec(editor, { operator: this.operator }); + } + else if (motions[ch] && this.isAccepting(MOTION)) { + this.currentCmd = MOTION; + + var ctx = { + operator: this.operator, + motion: { + ch: ch, + count: this.getCount() + } + }; + + if (motions[ch].param) + this.waitForParam(ctx); + else + this.exec(editor, ctx); + } + else if (alias[ch] && this.isAccepting(MOTION)) { + alias[ch].operator.count = this.getCount(); + this.exec(editor, alias[ch]); + } + else if (actions[ch] && this.isAccepting(ACTION)) { + var actionObj = { + action: { + fn: actions[ch].fn, + count: this.getCount() + } + }; + + if (actions[ch].param) { + this.waitForParam(actionObj); + } + else { + this.exec(editor, actionObj); + } + + if (actions[ch].acceptsMotion) + this.idle = false; + } + else if (this.operator) { + this.exec(editor, { operator: this.operator }, ch); + } + else { + this.reset(); + } + + if (this.waitingForParam || this.motion || this.operator) { + this.status += ch; + } else if (this.currentCount) { + this.status = this.currentCount; + } else if (this.status) { + this.status = ""; + } else { + return; + } + 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.ch].selFn) { + operators[o.ch].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 ch 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.ch].fn(editor, null, o.count, param); + this.reset(); + } + else if (m) { + var run = function(fn) { + if (fn && typeof fn === "function") { // There should always be a motion + if (m.count && !motionObj.handlesCount) + repeat(fn, m.count, [editor, null, m.count, param]); + else + fn(editor, null, m.count, param); + } + }; + + var motionObj = motions[m.ch]; + var selectable = motionObj.sel; + + if (!o) { + if ((util.onVisualMode || util.onVisualLineMode) && selectable) + run(motionObj.sel); + else + run(motionObj.nav); + } + else if (selectable) { + repeat(function() { + run(motionObj.sel); + operators[o.ch].fn(editor, editor.getSelectionRange(), o.count, param); + }, o.count || 1); + } + this.reset(); + } + else if (a) { + a.fn(editor, editor.getSelectionRange(), a.count, param); + this.reset(); + } + handleCursorMove(editor); + }, + + isAccepting: function(type) { + return this.accepting.indexOf(type) !== -1; + }, + + reset: function() { + this.operator = null; + this.motion = null; + this.currentCount = ""; + this.status = ""; + this.accepting = [NUMBER, OPERATOR, MOTION, ACTION]; + this.idle = true; + this.waitingForParam = null; + } +}; + +function setPreviousCommand(fn) { + inputBuffer.previous = { action: { action: { fn: fn } } }; +} + +exports.coreCommands = { + start: { + exec: function start(editor) { + util.insertMode(editor); + setPreviousCommand(start); + } + }, + startBeginning: { + exec: function startBeginning(editor) { + editor.navigateLineStart(); + util.insertMode(editor); + setPreviousCommand(startBeginning); + } + }, + // Stop 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/mode/plain_text_test.js b/lib/ace/keyboard/vim/maps/aliases.js similarity index 65% rename from lib/ace/mode/plain_text_test.js rename to lib/ace/keyboard/vim/maps/aliases.js index 7e02f5da..1a5f32f7 100644 --- a/lib/ace/mode/plain_text_test.js +++ b/lib/ace/keyboard/vim/maps/aliases.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,30 +27,68 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} + +"use strict" define(function(require, exports, module) { -"use strict"; - -var EditSession = require("../edit_session").EditSession; -var PlainTextMode = require("./plain_text").Mode; -var assert = require("../test/assertions"); - module.exports = { - setUp : function() { - this.mode = new PlainTextMode(); + "x": { + operator: { + ch: "d", + count: 1 + }, + motion: { + ch: "l", + count: 1 + } }, - - "test: lines should not be indented" : function() { - assert.equal("", this.mode.getNextLineIndent("start", " abc", " ")); + "X": { + operator: { + ch: "d", + count: 1 + }, + motion: { + ch: "h", + count: 1 + } + }, + "D": { + operator: { + ch: "d", + count: 1 + }, + motion: { + ch: "$", + count: 1 + } + }, + "C": { + operator: { + ch: "c", + count: 1 + }, + motion: { + ch: "$", + count: 1 + } + }, + "s": { + operator: { + ch: "c", + count: 1 + }, + motion: { + ch: "l", + count: 1 + } + }, + "S": { + operator: { + ch: "c", + count: 1 + }, + param: "c" } }; - }); -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/keyboard/vim/maps/motions.js b/lib/ace/keyboard/vim/maps/motions.js new file mode 100644 index 00000000..036930ec --- /dev/null +++ b/lib/ace/keyboard/vim/maps/motions.js @@ -0,0 +1,593 @@ +/* ***** 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 util = require("./util"); + +var keepScrollPosition = function(editor, fn) { + var scrollTopRow = editor.renderer.getScrollTopRow(); + var initialRow = editor.getCursorPosition().row; + var diff = initialRow - scrollTopRow; + fn && fn.call(editor); + editor.renderer.scrollToRow(editor.getCursorPosition().row - diff); +}; + +function Motion(m) { + if (typeof m == "function") { + var getPos = m; + m = this; + } else { + var getPos = m.getPos; + } + m.nav = function(editor, range, count, param) { + var a = getPos(editor, range, count, param, false); + if (!a) + return; + editor.clearSelection(); + editor.moveCursorTo(a.row, a.column); + }; + m.sel = function(editor, range, count, param) { + var a = getPos(editor, range, count, param, true); + if (!a) + return; + editor.selection.selectTo(a.row, a.column); + }; + return m; +} + +var nonWordRe = /[\s.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/; +var wordSeparatorRe = /[.\/\\()\"'-:,.;<>~!@#$%^&*|+=\[\]{}`~?]/; +var whiteRe = /\s/; +var StringStream = function(editor, cursor) { + var sel = editor.selection; + this.range = sel.getRange(); + cursor = cursor || sel.selectionLead; + this.row = cursor.row; + this.col = cursor.column; + var line = editor.session.getLine(this.row); + var maxRow = editor.session.getLength(); + this.ch = line[this.col] || '\n'; + this.skippedLines = 0; + + this.next = function() { + this.ch = line[++this.col] || this.handleNewLine(1); + //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("../../../search").Search; +var search = new Search(); + +function find(editor, needle, dir) { + search.$options.needle = needle; + search.$options.backwards = dir == -1; + return search.find(editor.session); +} + +var Range = require("../../../range").Range; + +module.exports = { + "w": new Motion(function(editor) { + var str = new StringStream(editor); + + if (str.ch && wordSeparatorRe.test(str.ch)) { + while (str.ch && wordSeparatorRe.test(str.ch)) + str.next(); + } else { + while (str.ch && !nonWordRe.test(str.ch)) + str.next(); + } + while (str.ch && whiteRe.test(str.ch) && str.skippedLines < 2) + str.next(); + + str.skippedLines == 2 && str.prev(); + return {column: str.col, row: str.row}; + }), + "W": new Motion(function(editor) { + var str = new StringStream(editor); + while(str.ch && !(whiteRe.test(str.ch) && !whiteRe.test(str.peek(1))) && str.skippedLines < 2) + str.next(); + if (str.skippedLines == 2) + str.prev(); + else + str.next(); + + return {column: str.col, row: str.row}; + }), + "b": new Motion(function(editor) { + var str = new StringStream(editor); + + str.prev(); + while (str.ch && whiteRe.test(str.ch) && str.skippedLines > -2) + str.prev(); + + if (str.ch && wordSeparatorRe.test(str.ch)) { + while (str.ch && wordSeparatorRe.test(str.ch)) + str.prev(); + } else { + while (str.ch && !nonWordRe.test(str.ch)) + str.prev(); + } + str.ch && str.next(); + return {column: str.col, row: str.row}; + }), + "B": new Motion(function(editor) { + var str = new StringStream(editor); + str.prev(); + while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(-1))) && str.skippedLines > -2) + str.prev(); + + if (str.skippedLines == -2) + str.next(); + + return {column: str.col, row: str.row}; + }), + "e": new Motion(function(editor) { + var str = new StringStream(editor); + + str.next(); + while (str.ch && whiteRe.test(str.ch)) + str.next(); + + if (str.ch && wordSeparatorRe.test(str.ch)) { + while (str.ch && wordSeparatorRe.test(str.ch)) + str.next(); + } else { + while (str.ch && !nonWordRe.test(str.ch)) + str.next(); + } + str.ch && str.prev(); + return {column: str.col, row: str.row}; + }), + "E": new Motion(function(editor) { + var str = new StringStream(editor); + str.next(); + while(str.ch && !(!whiteRe.test(str.ch) && whiteRe.test(str.peek(1)))) + str.next(); + + return {column: str.col, row: str.row}; + }), + + "l": { + nav: function(editor) { + editor.navigateRight(); + }, + sel: function(editor) { + var pos = editor.getCursorPosition(); + var col = pos.column; + var lineLen = editor.session.getLine(pos.row).length; + + // Solving the behavior at the end of the line due to the + // different 0 index-based colum positions in ACE. + if (lineLen && col !== lineLen) //In selection mode you can select the newline + editor.selection.selectRight(); + } + }, + "h": { + nav: function(editor) { + var pos = editor.getCursorPosition(); + if (pos.column > 0) + editor.navigateLeft(); + }, + sel: function(editor) { + var pos = editor.getCursorPosition(); + if (pos.column > 0) + editor.selection.selectLeft(); + } + }, + "H": { + nav: function(editor) { + var row = editor.renderer.getScrollTopRow(); + editor.moveCursorTo(row); + }, + sel: function(editor) { + var row = editor.renderer.getScrollTopRow(); + editor.selection.selectTo(row); + } + }, + "M": { + nav: function(editor) { + var topRow = editor.renderer.getScrollTopRow(); + var bottomRow = editor.renderer.getScrollBottomRow(); + var row = topRow + ((bottomRow - topRow) / 2); + editor.moveCursorTo(row); + }, + sel: function(editor) { + var topRow = editor.renderer.getScrollTopRow(); + var bottomRow = editor.renderer.getScrollBottomRow(); + var row = topRow + ((bottomRow - topRow) / 2); + editor.selection.selectTo(row); + } + }, + "L": { + nav: function(editor) { + var row = editor.renderer.getScrollBottomRow(); + editor.moveCursorTo(row); + }, + sel: function(editor) { + var row = editor.renderer.getScrollBottomRow(); + editor.selection.selectTo(row); + } + }, + "k": { + nav: function(editor) { + editor.navigateUp(); + }, + sel: function(editor) { + editor.selection.selectUp(); + } + }, + "j": { + nav: function(editor) { + editor.navigateDown(); + }, + sel: function(editor) { + editor.selection.selectDown(); + } + }, + + "i": { + param: true, + sel: function(editor, range, count, param) { + switch (param) { + case "w": + editor.selection.selectWord(); + break; + case "W": + editor.selection.selectAWord(); + break; + case "(": + case "{": + case "[": + var cursor = editor.getCursorPosition(); + var end = editor.session.$findClosingBracket(param, cursor, /paren/); + if (!end) + return; + var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/); + if (!start) + return; + start.column ++; + editor.selection.setSelectionRange(Range.fromPoints(start, end)); + break; + case "'": + case '"': + case "/": + var end = find(editor, param, 1); + if (!end) + return; + var start = find(editor, param, -1); + if (!start) + return; + editor.selection.setSelectionRange(Range.fromPoints(start.end, end.start)); + break; + } + } + }, + "a": { + param: true, + sel: function(editor, range, count, param) { + switch (param) { + case "w": + editor.selection.selectAWord(); + break; + case "W": + editor.selection.selectAWord(); + break; + case "(": + case "{": + case "[": + var cursor = editor.getCursorPosition(); + var end = editor.session.$findClosingBracket(param, cursor, /paren/); + if (!end) + return; + var start = editor.session.$findOpeningBracket(editor.session.$brackets[param], cursor, /paren/); + if (!start) + return; + end.column ++; + editor.selection.setSelectionRange(Range.fromPoints(start, end)); + break; + case "'": + case "\"": + case "/": + var end = find(editor, param, 1); + if (!end) + return; + var start = find(editor, param, -1); + if (!start) + return; + end.column ++; + editor.selection.setSelectionRange(Range.fromPoints(start.start, end.end)); + break; + } + } + }, + + "f": new Motion({ + param: true, + handlesCount: true, + getPos: function(editor, range, count, param, isSel) { + var cursor = editor.getCursorPosition(); + var column = util.getRightNthChar(editor, cursor, param, count || 1); + + if (typeof column === "number") { + cursor.column += column + (isSel ? 2 : 1); + return cursor; + } + } + }), + "F": new Motion({ + param: true, + handlesCount: true, + getPos: function(editor, range, count, param, isSel) { + var cursor = editor.getCursorPosition(); + var column = util.getLeftNthChar(editor, cursor, param, count || 1); + + if (typeof column === "number") { + cursor.column -= column + 1; + return cursor; + } + } + }), + "t": new Motion({ + param: true, + handlesCount: true, + getPos: function(editor, range, count, param, isSel) { + var cursor = editor.getCursorPosition(); + var column = util.getRightNthChar(editor, cursor, param, count || 1); + + if (typeof column === "number") { + cursor.column += column + (isSel ? 1 : 0); + return cursor; + } + } + }), + "T": new Motion({ + param: true, + handlesCount: true, + getPos: function(editor, range, count, param, isSel) { + var cursor = editor.getCursorPosition(); + var column = util.getLeftNthChar(editor, cursor, param, count || 1); + + if (typeof column === "number") { + cursor.column -= column; + return cursor; + } + } + }), + + "^": { + nav: function(editor) { + editor.navigateLineStart(); + }, + sel: function(editor) { + editor.selection.selectLineStart(); + } + }, + "$": { + nav: function(editor) { + editor.navigateLineEnd(); + }, + sel: function(editor) { + editor.selection.selectLineEnd(); + } + }, + "0": new Motion(function(ed) { + return {row: ed.selection.lead.row, column: 0}; + }), + "G": { + nav: function(editor, range, count, param) { + if (!count && count !== 0) { // Stupid JS + count = editor.session.getLength(); + } + editor.gotoLine(count); + }, + sel: function(editor, range, count, param) { + if (!count && count !== 0) { // Stupid JS + count = editor.session.getLength(); + } + editor.selection.selectTo(count, 0); + } + }, + "g": { + param: true, + nav: function(editor, range, count, param) { + switch(param) { + case "m": + console.log("Middle line"); + break; + case "e": + console.log("End of prev word"); + break; + case "g": + editor.gotoLine(count || 0); + case "u": + editor.gotoLine(count || 0); + case "U": + editor.gotoLine(count || 0); + } + }, + sel: function(editor, range, count, param) { + switch(param) { + case "m": + console.log("Middle line"); + break; + case "e": + console.log("End of prev word"); + break; + case "g": + editor.selection.selectTo(count || 0, 0); + } + } + }, + "o": { + nav: function(editor, range, count, param) { + count = count || 1; + var content = ""; + while (0 < count--) + content += "\n"; + + if (content.length) { + editor.navigateLineEnd() + editor.insert(content); + util.insertMode(editor); + } + } + }, + "O": { + nav: function(editor, range, count, param) { + var row = editor.getCursorPosition().row; + count = count || 1; + var content = ""; + while (0 < count--) + content += "\n"; + + if (content.length) { + if(row > 0) { + editor.navigateUp(); + editor.navigateLineEnd() + editor.insert(content); + } else { + editor.session.insert({row: 0, column: 0}, content); + editor.navigateUp(); + } + util.insertMode(editor); + } + } + }, + "%": new Motion(function(editor){ + var brRe = /[\[\]{}()]/g; + var cursor = editor.getCursorPosition(); + var ch = editor.session.getLine(cursor.row)[cursor.column]; + if (!brRe.test(ch)) { + var range = find(editor, brRe); + if (!range) + return; + cursor = range.start; + } + var match = editor.session.findMatchingBracket({ + row: cursor.row, + column: cursor.column + 1 + }); + + return match; + }), + "{": new Motion(function(ed) { + var session = ed.session; + var row = session.selection.lead.row; + while(row > 0 && !/\S/.test(session.getLine(row))) + row--; + while(/\S/.test(session.getLine(row))) + row--; + return {column: 0, row: row}; + }), + "}": new Motion(function(ed) { + var session = ed.session; + var l = session.getLength(); + var row = session.selection.lead.row; + while(row < l && !/\S/.test(session.getLine(row))) + row++; + while(/\S/.test(session.getLine(row))) + row++; + return {column: 0, row: row}; + }), + "ctrl-d": { + nav: function(editor, range, count, param) { + editor.selection.clearSelection(); + keepScrollPosition(editor, editor.gotoPageDown); + }, + sel: function(editor, range, count, param) { + keepScrollPosition(editor, editor.selectPageDown); + } + }, + "ctrl-u": { + nav: function(editor, range, count, param) { + editor.selection.clearSelection(); + keepScrollPosition(editor, editor.gotoPageUp); + + }, + sel: function(editor, range, count, param) { + keepScrollPosition(editor, editor.selectPageUp); + } + } +}; + +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..702abc6e --- /dev/null +++ b/lib/ace/keyboard/vim/maps/operators.js @@ -0,0 +1,196 @@ +/* ***** 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) { + +"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..af0e07c7 --- /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, ch, n) { + var line = editor.getSession().getLine(cursor.row); + var matches = line.substr(cursor.column + 1).split(ch); + + return n < matches.length ? matches.slice(0, n).join(ch).length : null; + }, + getLeftNthChar: function(editor, cursor, ch, n) { + var line = editor.getSession().getLine(cursor.row); + var matches = line.substr(0, cursor.column).split(ch); + + return n < matches.length ? matches.slice(-1 * n).join(ch).length : null; + }, + toRealChar: function(ch) { + if (ch.length === 1) + return ch; + + if (/^shift-./.test(ch)) + return ch[ch.length - 1].toUpperCase(); + else + return ""; + }, + copyLine: function(editor) { + var pos = editor.getCursorPosition(); + editor.selection.clearSelection(); + editor.moveCursorTo(pos.row, pos.column); + editor.selection.selectLine(); + registers._default.isLine = true; + registers._default.text = editor.getCopyText().replace(/\n$/, ""); + editor.selection.clearSelection(); + editor.moveCursorTo(pos.row, pos.column); + } +}; +}); diff --git a/lib/ace/ext/split.js b/lib/ace/keyboard/vim/registers.js similarity index 92% rename from lib/ace/ext/split.js rename to lib/ace/keyboard/vim/registers.js index 8316562f..ef929a35 100644 --- a/lib/ace/ext/split.js +++ b/lib/ace/keyboard/vim/registers.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -29,12 +29,14 @@ * ***** 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"); +"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..bd0219a4 100644 --- a/lib/ace/layer/cursor.js +++ b/lib/ace/layer/cursor.js @@ -32,15 +32,11 @@ 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; @@ -50,22 +46,9 @@ var Cursor = function(parentEl) { 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) { @@ -91,13 +74,12 @@ var Cursor = function(parentEl) { }; this.setSmoothBlinking = function(smoothBlinking) { - if (smoothBlinking != this.smoothBlinking && !IE8) { + if (smoothBlinking != this.smoothBlinking) { this.smoothBlinking = smoothBlinking; - dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking); - this.$updateCursors(true); - this.$updateCursors = (smoothBlinking - ? this.$updateOpacity - : this.$updateVisibility).bind(this); + if (smoothBlinking) + dom.addCssClass(this.element, "ace_smooth-blinking"); + else + dom.removeCssClass(this.element, "ace_smooth-blinking"); this.restartTimer(); } }; @@ -131,34 +113,35 @@ var Cursor = function(parentEl) { }; this.restartTimer = function() { - var update = this.$updateCursors; clearInterval(this.intervalId); clearTimeout(this.timeoutId); - if (this.smoothBlinking) { + if (this.smoothBlinking) dom.removeCssClass(this.element, "ace_smooth-blinking"); - } - - update(true); + for (var i = this.cursors.length; i--; ) + this.cursors[i].style.opacity = ""; if (!this.isBlinking || !this.blinkInterval || !this.isVisible) return; - if (this.smoothBlinking) { + 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); + for (var i = this.cursors.length; i--; ) { + this.cursors[i].style.opacity = 0; + } + }.bind(this), 0.6 * this.blinkInterval); }.bind(this); this.intervalId = setInterval(function() { - update(true); + for (var i = this.cursors.length; i--; ) { + this.cursors[i].style.opacity = ""; + } blink(); - }, this.blinkInterval); + }.bind(this), this.blinkInterval); blink(); }; @@ -187,23 +170,19 @@ var Cursor = function(parentEl) { selections = [{cursor: null}]; } - for (var i = 0, n = selections.length; i < n; i++) { + for (var i = selections.length; i--; ) { var pixelPos = this.getPixelPosition(selections[i].cursor, true); if ((pixelPos.top > config.height + config.offset || - pixelPos.top < 0) && i > 1) { + pixelPos.top < -config.offset) && i > 1) { continue; } 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); - } + + style.left = pixelPos.left + "px"; + style.top = pixelPos.top + "px"; + style.width = config.characterWidth + "px"; + style.height = config.lineHeight + "px"; } while (this.cursors.length > cursorIndex) this.removeCursor(); @@ -215,8 +194,6 @@ var Cursor = function(parentEl) { this.$pixelPos = pixelPos; this.restartTimer(); }; - - this.drawCursor = null; this.$setOverwrite = function(overwrite) { if (overwrite != this.overwrite) { 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..99fec7b6 100644 --- a/lib/ace/layer/gutter.js +++ b/lib/ace/layer/gutter.js @@ -46,8 +46,6 @@ var Gutter = function(parentEl) { this.$annotations = []; this.$updateAnnotations = this.$updateAnnotations.bind(this); - - this.$cells = []; }; (function() { @@ -58,8 +56,7 @@ var Gutter = function(parentEl) { if (this.session) this.session.removeEventListener("change", this.$updateAnnotations); this.session = session; - if (session) - session.on("change", this.$updateAnnotations); + session.on("change", this.$updateAnnotations); }; this.addGutterDecoration = function(row, className){ @@ -76,7 +73,8 @@ var Gutter = function(parentEl) { this.setAnnotations = function(annotations) { // iterate over sparse array - this.$annotations = []; + this.$annotations = [] + var rowInfo, row; for (var i = 0; i < annotations.length; i++) { var annotation = annotations[i]; var row = annotation.row; @@ -100,150 +98,88 @@ var Gutter = function(parentEl) { } }; - this.$updateAnnotations = function (delta) { + this.$updateAnnotations = function (e) { if (!this.$annotations.length) return; - var firstRow = delta.start.row; - var len = delta.end.row - firstRow; + var delta = e.data; + var range = delta.range; + var firstRow = range.start.row; + var len = range.end.row - firstRow; if (len === 0) { // do nothing - } else if (delta.action == 'remove') { + } else if (delta.action == "removeText" || delta.action == "removeLines") { this.$annotations.splice(firstRow, len + 1, null); } else { - var args = new Array(len + 1); + var args = Array(len + 1); args.unshift(firstRow, 1); this.$annotations.splice.apply(this.$annotations, args); } }; this.update = function(config) { - var session = this.session; - var firstRow = config.firstRow; - var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar - session.getLength() - 1); - var fold = session.getNextFoldLine(firstRow); + var emptyAnno = {className: ""}; + var html = []; + var i = config.firstRow; + var lastRow = config.lastRow; + var fold = this.session.getNextFoldLine(i); var foldStart = fold ? fold.start.row : Infinity; - var foldWidgets = this.$showFoldWidgets && session.foldWidgets; - var breakpoints = session.$breakpoints; - var decorations = session.$decorations; - var firstLineNumber = session.$firstLineNumber; + var foldWidgets = this.$showFoldWidgets && this.session.foldWidgets; + var breakpoints = this.session.$breakpoints; + var decorations = this.session.$decorations; var lastLineNumber = 0; - - var gutterRenderer = session.gutterRenderer || this.$renderer; - var cell = null; - var index = -1; - var row = firstRow; while (true) { - if (row > 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 +199,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..c68d3964 100644 --- a/lib/ace/layer/marker.js +++ b/lib/ace/layer/marker.js @@ -82,66 +82,60 @@ var Marker = function(parentEl) { 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") 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); + this.drawSingleLineMarker(html, range, marker.clazz + " ace_start", config); } } - 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 + " ace_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) { // 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 || ""; stringBuilder.push( - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + "left:", left, "px;'>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " ); // from start of the last line to the selection end @@ -149,32 +143,30 @@ var Marker = function(parentEl) { var width = 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) { + this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength) { var height = config.lineHeight; var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; @@ -186,11 +178,11 @@ var Marker = function(parentEl) { "height:", height, "px;", "width:", width, "px;", "top:", top, "px;", - "left:", left, "px;", extraStyle || "", "'>" + "left:", left,"px;'>" ); }; - this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { + this.drawFullLineMarker = function(stringBuilder, range, clazz, config) { var top = this.$getTop(range.start.row, config); var height = config.lineHeight; if (range.start.row != range.end.row) @@ -200,21 +192,9 @@ var Marker = function(parentEl) { "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + "left:0;right:0;'>" ); - }; - - this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var top = this.$getTop(range.start.row, config); - var height = config.lineHeight; - - stringBuilder.push( - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - ); - }; + } }).call(Marker.prototype); diff --git a/lib/ace/layer/mobilescroll.js b/lib/ace/layer/mobilescroll.js new file mode 100644 index 00000000..631a2d87 --- /dev/null +++ b/lib/ace/layer/mobilescroll.js @@ -0,0 +1,129 @@ +/* ***** 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 MobileScroll = function(parentEl) { + this.parentOverflowEl = dom.createElement("div"); + this.parentOverflowEl.className = "ace_layer ace_mobile_scroll-layer"; + this.element = dom.createElement("div"); + this.parentOverflowEl.appendChild(this.element); + parentEl.appendChild(this.parentOverflowEl); + + var _self = this; + + var movementDiff = 0, lastMovementPos = 0; + var timeDiff = 0, lastTime = 0; + var waitingForLastScroll = false; + var stopInertialScrolling = false; + + this.parentOverflowEl.onscroll = function(e) { + if (stopInertialScrolling) { + _self.parentOverflowEl.scrollTop = _self.session.getScrollTop(); + return false; + } + + if (_self.session) + _self.session.setScrollTop(_self.parentOverflowEl.scrollTop); + }; + + document.addEventListener("touchmove", function(e) { + movementDiff = _self.parentOverflowEl.scrollTop - lastMovementPos; + lastMovementPos = _self.parentOverflowEl.scrollTop; + + timeDiff = e.timeStamp - lastTime; + lastTime = e.timeStamp; + }); + + var movingTimer; + var touchStartedWithAce = false; + document.addEventListener("touchstart", function(e) { + if (e.target.className.split(" ").indexOf("ace_content") === -1) + return true; + + touchStartedWithAce = true; + stopInertialScrolling = false; + + clearInterval(movingTimer); + + waitingForLastScroll = false; + movementDiff = 0, lastMovementPos = 0; + timeDiff = 0, lastTime = 0; + }, false); + + document.addEventListener("touchend", function(e) { + if (!touchStartedWithAce) + return true; + touchStartedWithAce = false; + waitingForLastScroll = true; + + var position = _self.parentOverflowEl.scrollTop; + var velocity = movementDiff; + + movingTimer = setInterval(function() { + position += velocity; + velocity *= 0.949; + _self.session.setScrollTop(position); + _self.parentOverflowEl.scrollTop = position; + if (Math.abs(velocity) < 4) { + clearInterval(movingTimer); + stopInertialScrolling = true; + } + }, 5); + }, false); +}; + +(function() { + this.setSession = function(session) { + this.session = session; + }; + + this.$padding = 0; + this.setPadding = function(padding) { + this.$padding = padding; + this.element.style.padding = "0 " + padding + "px"; + }; + + this.setScrollTop = function(top) { + this.parentOverflowEl.scrollTop = top; + }; + + this.update = function(config) { + this.element.style.height = config.lineHeight * this.session.getScreenLength() + "px"; + }; + +}).call(MobileScroll.prototype); + +exports.MobileScroll = MobileScroll; + +}); diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index 01afb9f3..812dd066 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -41,62 +41,156 @@ 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 = {width: 0, height: 0}; + this.checkForSizeChanges(); + 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.$measureNode.style.fontWeight = "bold"; + var boldSize = this.$measureSizes(); + this.$measureNode.style.fontWeight = ""; + this.$characterSize = size; + this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; + 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 +221,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 +291,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 +357,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 +388,7 @@ var Text = function(parentEl) { break; if (this.$useLineGroups()) - html.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ") + html.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ") this.$renderLine(html, row, false, row == foldStart ? foldLine : false); @@ -310,7 +397,7 @@ var Text = function(parentEl) { row++; } - this.element.innerHTML = html.join(""); + this.element = dom.setInnerHtml(this.element, html.join("")); }; this.$textToken = { @@ -321,12 +408,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 +422,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 +563,7 @@ var Text = function(parentEl) { row = foldLine.end.row stringBuilder.push( - "", + "", row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, "" ); diff --git a/lib/ace/layer/text_test.js b/lib/ace/layer/text_test.js index 3946ec66..b0aad573 100644 --- a/lib/ace/layer/text_test.js +++ b/lib/ace/layer/text_test.js @@ -81,17 +81,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 +107,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/mode/html_worker.js b/lib/ace/lib/browser_focus.js similarity index 54% rename from lib/ace/mode/html_worker.js rename to lib/ace/lib/browser_focus.js index 742c1045..37597015 100644 --- a/lib/ace/mode/html_worker.js +++ b/lib/ace/lib/browser_focus.js @@ -31,62 +31,65 @@ 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 oop = require("./oop"); +var event = require("./event"); +var EventEmitter = require("./event_emitter").EventEmitter; -var errorTypes = { - "expected-doctype-but-got-start-tag": "info", - "expected-doctype-but-got-chars": "info", - "non-html-root": "info", -} +/* + * 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; -var Worker = exports.Worker = function(sender) { - Mirror.call(this, sender); - this.setTimeout(400); - this.context = null; + // 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); + }); + } }; -oop.inherits(Worker, Mirror); +(function(){ -(function() { - - this.setOptions = function(options) { - this.context = options.context; + oop.implement(this, EventEmitter); + + this.isFocused = function() { + return this._isFocused; }; - - this.onUpdate = function() { - var value = this.doc.getValue(); - if (!value) + + this._setFocused = function(isFocused) { + if (this._isFocused == isFocused) 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); + + if (isFocused) + this.lastFocus = new Date().getTime(); + + this._isFocused = isFocused; + this._emit("changeFocus"); }; -}).call(Worker.prototype); +}).call(BrowserFocus.prototype); + +exports.BrowserFocus = BrowserFocus; }); diff --git a/lib/ace/lib/dom.js b/lib/ace/lib/dom.js index 2cbfe23e..04f8bf5f 100644 --- a/lib/ace/lib/dom.js +++ b/lib/ace/lib/dom.js @@ -33,20 +33,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 +94,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 +143,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 +156,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 +177,6 @@ exports.getInnerHeight = function(element) { ); }; - if (window.pageYOffset !== undefined) { exports.getPageScrollTop = function() { return window.pageYOffset; @@ -211,13 +210,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 +225,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 +258,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..3a3b68c5 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; }; @@ -930,18 +803,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 +826,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 +877,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 +1056,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..06574425 100644 --- a/lib/ace/lib/event.js +++ b/lib/ace/lib/event.js @@ -33,6 +33,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 +41,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 +86,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 +99,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 +151,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 +160,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 +177,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 +216,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,35 +274,14 @@ 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; @@ -353,10 +301,10 @@ if (window.postMessage && !useragent.isOldIE) { exports.nextFrame = window.requestAnimationFrame || - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || + window.oRequestAnimationFrame || window.msRequestAnimationFrame || - window.oRequestAnimationFrame; + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame; if (exports.nextFrame) exports.nextFrame = exports.nextFrame.bind(window); diff --git a/lib/ace/lib/event_emitter.js b/lib/ace/lib/event_emitter.js index b9860145..5f4bec86 100644 --- a/lib/ace/lib/event_emitter.js +++ b/lib/ace/lib/event_emitter.js @@ -32,13 +32,11 @@ 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]; @@ -50,77 +48,40 @@ EventEmitter._dispatchEvent = function(eventName, 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 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 +69,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; }; @@ -154,6 +136,7 @@ exports.getMatchOffsets = function(string, regExp) { /* deprecated */ exports.deferredCall = function(fcn) { + var timer = null; var callback = function() { timer = null; @@ -179,10 +162,6 @@ exports.deferredCall = function(fcn) { timer = null; return deferred; }; - - deferred.isPending = function() { - return timer; - }; return deferred; }; @@ -196,15 +175,15 @@ exports.delayedCall = function(fcn, defaultTimeout) { }; var _self = function(timeout) { - if (timer == null) - timer = setTimeout(callback, timeout || defaultTimeout); - }; - - _self.delay = function(timeout) { timer && clearTimeout(timer); timer = setTimeout(callback, timeout || defaultTimeout); }; - _self.schedule = _self; + + _self.delay = delayed; + _self.schedule = function(timeout) { + if (timer == null) + timer = setTimeout(callback, timeout || 0); + }; _self.call = function() { this.cancel(); diff --git a/lib/ace/lib/net.js b/lib/ace/lib/net.js index bba76df8..bdb01ab6 100644 --- a/lib/ace/lib/net.js +++ b/lib/ace/lib/net.js @@ -7,12 +7,13 @@ */ define(function(require, exports, module) { "use strict"; -var dom = require("./dom"); + +var useragent = require("./useragent"); exports.get = function (url, callback) { - var xhr = new XMLHttpRequest(); + var xhr = exports.createXhr(); xhr.open('GET', url, true); - xhr.onreadystatechange = function () { + xhr.onreadystatechange = function (evt) { //Do not explicitly handle errors, those should be //visible via console output in the browser. if (xhr.readyState === 4) { @@ -22,30 +23,47 @@ exports.get = function (url, callback) { xhr.send(null); }; +var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0']; + +exports.createXhr = function() { + //Would love to dump the ActiveX crap in here. Need IE 6 to die first. + var xhr, i, progId; + if (typeof XMLHttpRequest !== "undefined") { + return new XMLHttpRequest(); + } else { + for (i = 0; i < 3; i++) { + progId = progIds[i]; + try { + xhr = new ActiveXObject(progId); + } catch (e) {} + + if (xhr) { + progIds = [progId]; // so faster next time + break; + } + } + } + + if (!xhr) { + throw new Error("createXhr(): XMLHttpRequest not available"); + } + + return xhr; +}; + exports.loadScript = function(path, callback) { - var head = dom.getDocumentHead(); + var head = document.getElementsByTagName('head')[0]; var s = document.createElement('script'); s.src = path; head.appendChild(s); - s.onload = s.onreadystatechange = function(_, isAbort) { - if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") { - s = s.onload = s.onreadystatechange = null; - if (!isAbort) - callback(); - } - }; + if (useragent.isOldIE) + s.onreadystatechange = function () { + this.readyState == 'loaded' && callback(); + }; + else + s.onload = callback; }; -/* - * Convert a url into a fully qualified absolute URL - * This function does not work in IE6 - */ -exports.qualifyURL = function(url) { - var a = document.createElement('a'); - a.href = url; - return a.href; -} - }); diff --git a/lib/ace/lib/oop.js b/lib/ace/lib/oop.js index 85725f0f..f9ba6fe8 100644 --- a/lib/ace/lib/oop.js +++ b/lib/ace/lib/oop.js @@ -31,23 +31,20 @@ 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..14f0ee9b 100644 --- a/lib/ace/lib/useragent.js +++ b/lib/ace/lib/useragent.js @@ -73,19 +73,17 @@ 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 + 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.controllers) && window.navigator.product === "Gecko"; +exports.isGecko = exports.isMozilla = window.controllers && window.navigator.product === "Gecko"; // oldGecko == rev < 2.0 -exports.isOldGecko = exports.isGecko && parseInt((ua.match(/rv\:(\d+)/)||[])[1], 10) < 4; +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]"; @@ -101,6 +99,4 @@ 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/test_highlight_rules.js b/lib/ace/mode/_test/test_highlight_rules.js new file mode 100644 index 00000000..6c28ba39 --- /dev/null +++ b/lib/ace/mode/_test/test_highlight_rules.js @@ -0,0 +1,144 @@ +var fs = require("fs"); +if (!fs.existsSync) + fs.existsSync = require("path").existsSync; + +require("amd-loader"); + +var cwd = __dirname + "/"; + +function generateTestData() { + var root = Array(5).join("../") + "/demo/kitchen-sink/docs"; + var docs = fs.readdirSync(cwd + root); + var specialDocs = fs.readdirSync(cwd); + var modes = fs.readdirSync(cwd + "../").filter(function(x){ + return /^\w+_highlight_rules.js$/.test(x); + }).map(function(x) { + return x.replace(/_highlight_rules.js$/, ""); + }); + + 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 = root + "/" + docName; + } + + var text = fs.readFileSync(cwd + filePath, "utf8"); + try { + var Mode = require("../" + modeName).Mode; + } catch(e) { + console.warn("Can't load mode :" + modeName, e); + return; + } + var tokenizer = new Mode().getTokenizer(); + + var state = "start"; + var data = text.split(/\n|\r|\r\n/).map(function(line) { + var tokens = tokenizer.getLineTokens(line, state); + state = tokens.state; + tokens = tokens.tokens; + return { + state: state, + data: tokens.map(function(x) {return [x.type, x.value]}) + }; + }); + var jsonStr = JSON.stringify(data, null, 1); + jsonStr = jsonStr.replace(/\n {4}/g, " ").replace(/\n {3}]/g, " ]"); + fs.writeFileSync(cwd + "tokens_" + modeName + ".json", jsonStr, "utf8"); + }); +} + +function test(startAt) { + var docs = fs.readdirSync(cwd).filter(function(x) { + return /^tokens_\w+.json$/.test(x); + }); + if (startAt && startAt > 1) + docs = docs.slice(startAt - 1); + docs.forEach(function(x, i) { + var modeName = x.match(/tokens_(.*).json/)[1]; + + console.log(padNumber(i+1, 3) + ") testing: \u001b[33m" + modeName + "\u001b[0m"); + + var text = fs.readFileSync(cwd + x, "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.data.forEach(function(x) { + lineData.types.push(x[0]); + lineData.values.push(x[1]); + }); + + var 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 success = true; + testEqual([ + lineData.state, tokens.state, + lineData.types, types, + lineData.values, values]); + + state = lineData.state; + }); + }); + + console.log("\u001b[32m" + "all ok" + "\u001b[0m"); + + 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; + } + if (err) { + throw "error"; + } + } + + 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], " != ", a2[i], "\u001b[0m"); + else + out.push(a1[i]); + } + console.log(out.join("")); + } + function padNumber(num, digits) { + return (" " + num).slice(-digits); + } +} + +if (process.argv[2] == "gen") + generateTestData(process.argv.splice(3)); +else + test(parseInt(process.argv[2],10) || 0); 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 index 48d4af7d..a4b5095a 100644 --- a/lib/ace/mode/_test/text_javascript.txt +++ b/lib/ace/mode/_test/text_javascript.txt @@ -1,37 +1,3 @@ -//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 index 902d8dce..9aeee5be 100644 --- a/lib/ace/mode/_test/tokens_c9search.json +++ b/lib/ace/mode/_test/tokens_c9search.json @@ -1,131 +1,175 @@ -[[ - ["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 +[ + { + "state": "start", + "data": [ + [ "text", "Searching for 'var' in /workspace/configs" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "string", "configs/default.js" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", " 1" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var fs = require(\"fs\");" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t2" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var argv = require('optimist').argv;" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t3" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var path = require(\"path\");" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t5" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var clientExtensions = {};" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t6" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var clientDirs = fs.readdirSync(__dirname + \"/../plugins-client\");" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t7" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "for (var i = 0; i < clientDirs.length; i++) {" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t8" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var dir = clientDirs[i];" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t12" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var name = dir.split(\".\")[1];" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t16" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var projectDir = (argv.w && path.resolve(process.cwd(), argv.w)) || process.cwd();" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t17" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var fsUrl = \"/workspace\";" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t19" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var port = argv.p || process.env.PORT || 3131;" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t20" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var host = argv.l || \"localhost\";" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t22" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var config = {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "string", "configs/local.js" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t2" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var config = require(\"./default\");" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "string", "configs/packed.js" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "c9searchresults.constant.numeric", "\t1" ], + [ "c9searchresults.text", ": " ], + [ "c9searchresults.text", "var config = require(\"./default\");" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Found 15 matches in 3 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 index a8668b0b..c5725094 100644 --- a/lib/ace/mode/_test/tokens_c_cpp.json +++ b/lib/ace/mode/_test/tokens_c_cpp.json @@ -1,190 +1,124 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "// compound assignment operators" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "#include" ], + [ "text", " " ], + [ "constant", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword.control", "using" ], + [ "text", " " ], + [ "keyword.operator", "namespace" ], + [ "text", " " ], + [ "identifier", "std" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "storage.type", "int" ], + [ "text", " " ], + [ "entity.name.function", "main" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "storage.type", "int" ], + [ "text", " " ], + [ "identifier", "a" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "identifier", "b" ], + [ "keyword.operator", "=" ], + [ "constant.numeric", "3" ], + [ "punctuation.operator", ";" ], + [ "text", " " ], + [ "comment", "/*" ], + [ "comment", " foobar */" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "a" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "b" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "a" ], + [ "keyword.operator", "+" ], + [ "keyword.operator", "=" ], + [ "constant.numeric", "2" ], + [ "punctuation.operator", ";" ], + [ "text", " " ], + [ "comment", "// equivalent to a=a+2" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "cout" ], + [ "text", " " ], + [ "keyword.operator", "<" ], + [ "keyword.operator", "<" ], + [ "text", " " ], + [ "identifier", "a" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword.control", "return" ], + [ "text", " " ], + [ "constant.numeric", "0" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + } +] \ 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 index 824cba59..e83b3d89 100644 --- a/lib/ace/mode/_test/tokens_clojure.json +++ b/lib/ace/mode/_test/tokens_clojure.json @@ -1,162 +1,248 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "keyword", "(" ], + [ "support.function", "defn" ], + [ "text", " " ], + [ "identifier", "parting" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "string", "\"returns a String parting in a given language" ], + [ "string", "\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "(" ], + [ "keyword", "[" ], + [ "keyword", "]" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "identifier", "parting" ], + [ "text", " " ], + [ "string", "\"World" ], + [ "string", "\"" ], + [ "keyword", ")" ], + [ "keyword", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "(" ], + [ "keyword", "[" ], + [ "support.function", "name" ], + [ "keyword", "]" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "identifier", "parting" ], + [ "text", " " ], + [ "support.function", "name" ], + [ "text", " " ], + [ "string", "\"en" ], + [ "string", "\"" ], + [ "keyword", ")" ], + [ "keyword", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "(" ], + [ "keyword", "[" ], + [ "support.function", "name" ], + [ "text", " " ], + [ "identifier", "language" ], + [ "keyword", "]" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "; condp is similar to a case statement in other languages." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "; It is described in more detail later." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "; It is used here to take different actions based on whether the" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "; parameter \"language\" is set to \"en\", \"es\" or something else." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "(" ], + [ "support.function", "condp" ], + [ "text", " " ], + [ "constant.language", "=" ], + [ "text", " " ], + [ "identifier", "language" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "string", "\"en" ], + [ "string", "\"" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "support.function", "str" ], + [ "text", " " ], + [ "string", "\"Goodbye, " ], + [ "string", "\"" ], + [ "text", " " ], + [ "support.function", "name" ], + [ "keyword", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "string", "\"es" ], + [ "string", "\"" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "support.function", "str" ], + [ "text", " " ], + [ "string", "\"Adios, " ], + [ "string", "\"" ], + [ "text", " " ], + [ "support.function", "name" ], + [ "keyword", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "(" ], + [ "keyword", "throw" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "identifier", "IllegalArgumentException" ], + [ "text", "." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "(" ], + [ "support.function", "str" ], + [ "text", " " ], + [ "string", "\"unsupported language " ], + [ "string", "\"" ], + [ "text", " " ], + [ "identifier", "language" ], + [ "keyword", ")" ], + [ "keyword", ")" ], + [ "keyword", ")" ], + [ "keyword", ")" ], + [ "keyword", ")" ], + [ "keyword", ")" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "(" ], + [ "support.function", "println" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "identifier", "parting" ], + [ "keyword", ")" ], + [ "keyword", ")" ], + [ "text", " " ], + [ "comment", "; -> Goodbye, World" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "(" ], + [ "support.function", "println" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "identifier", "parting" ], + [ "text", " " ], + [ "string", "\"Mark" ], + [ "string", "\"" ], + [ "keyword", ")" ], + [ "keyword", ")" ], + [ "text", " " ], + [ "comment", "; -> Goodbye, Mark" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "(" ], + [ "support.function", "println" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "identifier", "parting" ], + [ "text", " " ], + [ "string", "\"Mark" ], + [ "string", "\"" ], + [ "text", " " ], + [ "string", "\"es" ], + [ "string", "\"" ], + [ "keyword", ")" ], + [ "keyword", ")" ], + [ "text", " " ], + [ "comment", "; -> Adios, Mark" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "(" ], + [ "support.function", "println" ], + [ "text", " " ], + [ "keyword", "(" ], + [ "identifier", "parting" ], + [ "text", " " ], + [ "string", "\"Mark" ], + [ "string", "\"" ], + [ "text", ", " ], + [ "string", "\"xy" ], + [ "string", "\"" ], + [ "keyword", ")" ], + [ "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 index b0703b37..e8c97baa 100644 --- a/lib/ace/mode/_test/tokens_coffee.json +++ b/lib/ace/mode/_test/tokens_coffee.json @@ -1,545 +1,188 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "#!/usr/bin/env coffee" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "try" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "throw" ], + [ "text", " " ], + [ "language.support.class", "URIError" ], + [ "text", " " ], + [ "language.support.function", "decodeURI" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "0xC0ffee" ], + [ "text", " " ], + [ "keyword.operator", "*" ], + [ "text", " " ], + [ "constant.numeric", "123456.7e-8" ], + [ "text", " " ], + [ "keyword.operator", "/" ], + [ "text", " " ], + [ "constant.numeric", ".9" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "catch" ], + [ "text", " " ], + [ "identifier", "e" ] + ] + }, + { + "state": "qdoc", + "data": [ + [ "text", " " ], + [ "identifier", "console" ], + [ "identifier", ".log" ], + [ "text", " " ], + [ "string", "'qstring'" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "string", "\"qqstring\"" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "string", "'''" ] + ] + }, + { + "state": "qdoc", + "data": [ + [ "string", " qdoc" ] + ] + }, + { + "state": "qqdoc", + "data": [ + [ "string", " '''" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "string", "\"\"\"" ] + ] + }, + { + "state": "qqdoc", + "data": [ + [ "string", " qqdoc" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", " \"\"\"" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "do" ], + [ "text", " " ], + [ "keyword.operator", "->" ] + ] + }, + { + "state": "comment", + "data": [ + [ "text", " " ], + [ "comment", "###" ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", " herecomment" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", " ###" ] + ] + }, + { + "state": "heregex", + "data": [ + [ "text", " " ], + [ "identifier", "re" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string.regex", "/regex/imgy" ], + [ "identifier", ".test" ], + [ "text", " " ], + [ "string.regex", "///" ] + ] + }, + { + "state": "heregex", + "data": [ + [ "comment.regex", " " ], + [ "string.regex", "heregex" ], + [ "comment.regex", " # comment" ] + ] + }, + { + "state": "start", + "data": [ + [ "string.regex", " ///imgy" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "this" ], + [ "text", " " ], + [ "keyword", "isnt" ], + [ "punctuation.operator", ":" ], + [ "text", " " ], + [ "string", "`just JavaScript`" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "undefined" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "sentence" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "\"#{ 22 / 7 } is a decent approximation of π\"" ] + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_coldfusion.json b/lib/ace/mode/_test/tokens_coldfusion.json index 804e647d..2c2a602c 100644 --- a/lib/ace/mode/_test/tokens_coldfusion.json +++ b/lib/ace/mode/_test/tokens_coldfusion.json @@ -1,26 +1,41 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "cfset" ], + [ "text", " " ], + [ "entity.other.attribute-name", "welcome" ], + [ "keyword.operator", "=" ], + [ "string", "\"Hello World!\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "cfoutput" ], + [ "meta.tag", ">" ], + [ "text", "#welcome#" ], + [ "meta.tag", "" ] + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_csharp.json b/lib/ace/mode/_test/tokens_csharp.json index dcc6d0e9..167fdbe8 100644 --- a/lib/ace/mode/_test/tokens_csharp.json +++ b/lib/ace/mode/_test/tokens_csharp.json @@ -1,31 +1,42 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "keyword", "public" ], + [ "text", " " ], + [ "keyword", "void" ], + [ "text", " " ], + [ "identifier", "HelloWorld" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "//Say Hello!" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "Console" ], + [ "punctuation.operator", "." ], + [ "identifier", "WriteLine" ], + [ "paren.lparen", "(" ], + [ "string", "\"Hello World\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index e1a7ba05..a7b607cc 100644 --- a/lib/ace/mode/_test/tokens_css.json +++ b/lib/ace/mode/_test/tokens_css.json @@ -1,148 +1,231 @@ -[[ - "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 +[ + { + "state": "ruleset", + "data": [ + [ "variable", ".text-layer" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "font-family" ], + [ "text", ": Monaco, " ], + [ "string", "\"Courier New\"" ], + [ "text", ", " ], + [ "support.constant.fonts", "monospace" ], + [ "text", ";" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "font-size" ], + [ "text", ": " ], + [ "constant.numeric", "12" ], + [ "keyword", "px" ], + [ "text", ";" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "cursor" ], + [ "text", ": " ], + [ "support.constant", "text" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "ruleset", + "data": [ + [ "variable", ".blinker" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "animation-duration" ], + [ "text", ": " ], + [ "constant.numeric", "1" ], + [ "keyword", "s" ], + [ "text", ";" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "animation-name" ], + [ "text", ": blink;" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "animation-iteration-count" ], + [ "text", ": infinite;" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "animation-direction" ], + [ "text", ": alternate;" ] + ] + }, + { + "state": "ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "animation-timing-function" ], + [ "text", ": " ], + [ "support.constant", "linear" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "media", + "data": [ + [ "string", "@keyframes blink {" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "constant", "0" ], + [ "text", "% " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "opacity" ], + [ "text", ": " ], + [ "constant.numeric", "0" ], + [ "text", ";" ] + ] + }, + { + "state": "media", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "constant", "40" ], + [ "text", "% " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "opacity" ], + [ "text", ": " ], + [ "constant.numeric", "0" ], + [ "text", ";" ] + ] + }, + { + "state": "media", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "constant", "40" ], + [ "variable", ".5" ], + [ "text", "% " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "opacity" ], + [ "text", ": " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "media", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "constant", "100" ], + [ "text", "% " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "media_ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "opacity" ], + [ "text", ": " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "media", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 6c36f5fa..fa28d05d 100644 --- a/lib/ace/mode/_test/tokens_diff.json +++ b/lib/ace/mode/_test/tokens_diff.json @@ -1,262 +1,732 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "variable", "diff" ], + [ "variable", " --git" ], + [ "keyword", " a/lib/ace/edit_session.js" ], + [ "variable", " b/lib/ace/edit_session.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable", "index 23fc3fc..ed3b273 100644" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant.numeric", "---" ], + [ "meta.tag", " a/lib/ace/edit_session.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant.numeric", "+++" ], + [ "meta.tag", " b/lib/ace/edit_session.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant", "@@" ], + [ "constant.numeric", " -51,6 +51,7 " ], + [ "constant", "@@" ], + [ "comment.doc.tag", " var TextMode = require(\"./mode/text\").Mode;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " var Range = require(\"./range\").Range;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " var Document = require(\"./document\").Document;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " var BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", "var SearchHighlight = require(\"./search_highlight\").SearchHighlight;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " /**" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " * class EditSession" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant", "@@" ], + [ "constant.numeric", " -307,6 +308,13 " ], + [ "constant", "@@" ], + [ "comment.doc.tag", " var EditSession = function(text, mode) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " return token;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " };" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " this.highlight = function(re) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " if (!this.$searchHighlight) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " var highlight = new SearchHighlight(null, \"ace_selected-word\", \"text\");" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " this.$searchHighlight = this.addDynamicMarker(highlight);" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " }" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " this.$searchHighlight.setRegexp(re);" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " }" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " /**" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " * EditSession.setUndoManager(undoManager)" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " * - undoManager (UndoManager): The new undo manager" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant", "@@" ], + [ "constant.numeric", " -556,7 +564,8 " ], + [ "constant", "@@" ], + [ "comment.doc.tag", " var EditSession = function(text, mode) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " type : type || \"line\"," ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " renderer: typeof type == \"function\" ? type : null," ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " clazz : clazz," ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " inFront: !!inFront" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " inFront: !!inFront," ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " id: id" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " }" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " if (inFront) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable", "diff" ], + [ "variable", " --git" ], + [ "keyword", " a/lib/ace/editor.js" ], + [ "variable", " b/lib/ace/editor.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable", "index 834e603..b27ec73 100644" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant.numeric", "---" ], + [ "meta.tag", " a/lib/ace/editor.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant.numeric", "+++" ], + [ "meta.tag", " b/lib/ace/editor.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant", "@@" ], + [ "constant.numeric", " -494,7 +494,7 " ], + [ "constant", "@@" ], + [ "comment.doc.tag", " var Editor = function(renderer, session) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " * Emitted when a selection has changed." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " **/" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " this.onSelectionChange = function(e) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " var session = this.getSession();" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " var session = this.session;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " if (session.$selectionMarker) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " session.removeMarker(session.$selectionMarker);" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant", "@@" ], + [ "constant.numeric", " -509,12 +509,40 " ], + [ "constant", "@@" ], + [ "comment.doc.tag", " var Editor = function(renderer, session) {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " this.$updateHighlightActiveLine();" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " }" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " var self = this;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " if (this.$highlightSelectedWord && !this.$wordHighlightTimer)" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " this.$wordHighlightTimer = setTimeout(function() {" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " self.session.$mode.highlightSelection(self);" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " self.$wordHighlightTimer = null;" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "-" ], + [ "string", " }, 30, this);" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", " var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp()" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", " };" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable", "diff" ], + [ "variable", " --git" ], + [ "keyword", " a/lib/ace/search_highlight.js" ], + [ "variable", " b/lib/ace/search_highlight.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "invisible", "new file mode 100644" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable", "index 0000000..b2df779" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant.numeric", "---" ], + [ "meta.tag", " /dev/null" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant.numeric", "+++" ], + [ "meta.tag", " b/lib/ace/search_highlight.js" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "constant", "@@" ], + [ "constant.numeric", " -0,0 +1,3 " ], + [ "constant", "@@" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.constant", "+" ], + [ "text", "new" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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 index ce8a4d16..5d5668de 100644 --- a/lib/ace/mode/_test/tokens_glsl.json +++ b/lib/ace/mode/_test/tokens_glsl.json @@ -1,127 +1,185 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "keyword", "uniform" ], + [ "text", " " ], + [ "keyword", "float" ], + [ "text", " " ], + [ "identifier", "amplitude" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "attribute" ], + [ "text", " " ], + [ "keyword", "float" ], + [ "text", " " ], + [ "identifier", "displacement" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "varying" ], + [ "text", " " ], + [ "keyword", "vec3" ], + [ "text", " " ], + [ "identifier", "vNormal" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "void" ], + [ "text", " " ], + [ "entity.name.function", "main" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "vNormal" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "normal" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "// multiply our displacement by the" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "// amplitude. The amp will get animated" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "// so we'll have animated displacement" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "vec3" ], + [ "text", " " ], + [ "identifier", "newPosition" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "position" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "normal" ], + [ "text", " " ], + [ "keyword.operator", "*" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "vec3" ], + [ "paren.lparen", "(" ], + [ "identifier", "displacement" ], + [ "text", " " ], + [ "keyword.operator", "*" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "amplitude" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "gl_Position" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "projectionMatrix" ], + [ "text", " " ], + [ "keyword.operator", "*" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "modelViewMatrix" ], + [ "text", " " ], + [ "keyword.operator", "*" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "vec4" ], + [ "paren.lparen", "(" ], + [ "identifier", "newPosition" ], + [ "punctuation.operator", "," ], + [ "constant.numeric", "1.0" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 070c0a17..edfb232a 100644 --- a/lib/ace/mode/_test/tokens_golang.json +++ b/lib/ace/mode/_test/tokens_golang.json @@ -1,256 +1,362 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "// Concurrent computation of pi." ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "// See http://goo.gl/ZuTZM." ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "//" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "// This demonstrates Go's ability to handle" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "// large numbers of concurrent processes." ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "// It is an unreasonable way to calculate pi." ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "package" ], + [ "text", " " ], + [ "identifier", "main" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "import" ], + [ "text", " " ], + [ "paren.lparen", "(" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "string", "\"fmt\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "string", "\"math\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "func" ], + [ "text", " " ], + [ "identifier", "main" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "fmt" ], + [ "punctuation.operator", "." ], + [ "identifier", "Println" ], + [ "paren.lparen", "(" ], + [ "identifier", "pi" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "5000" ], + [ "paren.rparen", ")" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "// pi launches n goroutines to compute an" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "// approximation of pi." ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "func" ], + [ "text", " " ], + [ "identifier", "pi" ], + [ "paren.lparen", "(" ], + [ "identifier", "n" ], + [ "text", " " ], + [ "identifier", "int" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "identifier", "float64" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "ch" ], + [ "text", " " ], + [ "punctuation.operator", ":" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "make" ], + [ "paren.lparen", "(" ], + [ "keyword", "chan" ], + [ "text", " " ], + [ "identifier", "float64" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "go" ], + [ "text", " " ], + [ "identifier", "term" ], + [ "paren.lparen", "(" ], + [ "identifier", "ch" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "identifier", "float64" ], + [ "paren.lparen", "(" ], + [ "identifier", "k" ], + [ "paren.rparen", ")" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "f" ], + [ "text", " " ], + [ "punctuation.operator", ":" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "0.0" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "f" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "keyword.operator", "<" ], + [ "keyword.operator", "-" ], + [ "identifier", "ch" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "return" ], + [ "text", " " ], + [ "identifier", "f" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "func" ], + [ "text", " " ], + [ "identifier", "term" ], + [ "paren.lparen", "(" ], + [ "identifier", "ch" ], + [ "text", " " ], + [ "keyword", "chan" ], + [ "text", " " ], + [ "identifier", "float64" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "identifier", "k" ], + [ "text", " " ], + [ "identifier", "float64" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "ch" ], + [ "text", " " ], + [ "keyword.operator", "<" ], + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_groovy.json b/lib/ace/mode/_test/tokens_groovy.json index c7dae6b1..2c73f16b 100644 --- a/lib/ace/mode/_test/tokens_groovy.json +++ b/lib/ace/mode/_test/tokens_groovy.json @@ -1,410 +1,529 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "//http://groovy.codehaus.org/Martin+Fowler%27s+closure+examples+in+Groovy" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "class" ], + [ "text", " " ], + [ "identifier", "Employee" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "name" ], + [ "text", ", " ], + [ "identifier", "salary" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "boolean" ], + [ "text", " " ], + [ "identifier", "manager" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.function", "String" ], + [ "text", " " ], + [ "identifier", "toString" ], + [ "lparen", "(" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ], + [ "text", " " ], + [ "keyword", "return" ], + [ "text", " " ], + [ "identifier", "name" ], + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ], + [ "rparen", "]" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "managers" ], + [ "lparen", "(" ], + [ "identifier", "emps" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "emps" ], + [ "text", "." ], + [ "identifier", "findAll" ], + [ "text", " " ], + [ "lparen", "{" ], + [ "text", " " ], + [ "identifier", "e" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "e" ], + [ "text", "." ], + [ "identifier", "isManager" ], + [ "lparen", "(" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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]" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "highPaid" ], + [ "lparen", "(" ], + [ "identifier", "emps" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "threshold" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "150" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "emps" ], + [ "text", "." ], + [ "identifier", "findAll" ], + [ "text", " " ], + [ "lparen", "{" ], + [ "text", " " ], + [ "identifier", "e" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "e" ], + [ "text", "." ], + [ "identifier", "salary" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "threshold" ], + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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]" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "paidMore" ], + [ "lparen", "(" ], + [ "identifier", "amount" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "lparen", "{" ], + [ "text", " " ], + [ "identifier", "e" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "e" ], + [ "text", "." ], + [ "identifier", "salary" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "amount" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "highPaid" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "paidMore" ], + [ "lparen", "(" ], + [ "constant.numeric", "150" ], + [ "rparen", ")" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "assert" ], + [ "text", " " ], + [ "identifier", "highPaid" ], + [ "lparen", "(" ], + [ "identifier", "emps" ], + [ "lparen", "[" ], + [ "constant.numeric", "0" ], + [ "rparen", "]" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "comment", "// true" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "filename" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "'test.txt'" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "new" ], + [ "text", " " ], + [ "identifier", "File" ], + [ "lparen", "(" ], + [ "identifier", "filename" ], + [ "rparen", ")" ], + [ "text", "." ], + [ "identifier", "withReader" ], + [ "lparen", "{" ], + [ "text", " " ], + [ "identifier", "reader" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "doSomethingWith" ], + [ "lparen", "(" ], + [ "identifier", "reader" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "readersText" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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 index f0f79a48..bec79d5c 100644 --- a/lib/ace/mode/_test/tokens_haxe.json +++ b/lib/ace/mode/_test/tokens_haxe.json @@ -1,143 +1,195 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "keyword", "class" ], + [ "text", " " ], + [ "identifier", "Haxe" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "public" ], + [ "text", " " ], + [ "keyword", "static" ], + [ "text", " " ], + [ "keyword", "function" ], + [ "text", " " ], + [ "identifier", "main" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "// Say Hello!" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "var" ], + [ "text", " " ], + [ "identifier", "greeting" ], + [ "punctuation.operator", ":" ], + [ "keyword", "String" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "\"Hello World\"" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "trace" ], + [ "paren.lparen", "(" ], + [ "identifier", "greeting" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "trace" ], + [ "paren.lparen", "(" ], + [ "string", "\"Haxe is a great language that can target:\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "for" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "target" ], + [ "text", " " ], + [ "keyword", "in" ], + [ "text", " " ], + [ "identifier", "targets" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "trace" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "string", "\" - \"" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "identifier", "target" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "trace" ], + [ "paren.lparen", "(" ], + [ "string", "\"And many more!\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index c5f75eff..9b031aaf 100644 --- a/lib/ace/mode/_test/tokens_html.json +++ b/lib/ace/mode/_test/tokens_html.json @@ -1,63 +1,150 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "html" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "head" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "css-start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.style", "style" ], + [ "text", " " ], + [ "entity.other.attribute-name", "type" ], + [ "keyword.operator", "=" ], + [ "string", "\"text/css\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "variable", ".text-layer" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "font-family" ], + [ "text", ": Monaco, " ], + [ "string", "\"Courier New\"" ], + [ "text", ", " ], + [ "support.constant.fonts", "monospace" ], + [ "text", ";" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "font-size" ], + [ "text", ": " ], + [ "constant.numeric", "12" ], + [ "keyword", "px" ], + [ "text", ";" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "cursor" ], + [ "text", ": " ], + [ "support.constant", "text" ], + [ "text", ";" ] + ] + }, + { + "state": "css-start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "body" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h1" ], + [ "text", " " ], + [ "entity.other.attribute-name", "style" ], + [ "keyword.operator", "=" ], + [ "string", "\"color:red\"" ], + [ "meta.tag", ">" ], + [ "text", "Juhu Kinners" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + } +] \ 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 index 799ebdb5..376bdc7e 100644 --- a/lib/ace/mode/_test/tokens_java.json +++ b/lib/ace/mode/_test/tokens_java.json @@ -1,95 +1,139 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "keyword", "public" ], + [ "text", " " ], + [ "keyword", "class" ], + [ "text", " " ], + [ "identifier", "InfiniteLoop" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "comment", + "data": [ + [ "text", " " ], + [ "comment", "/*" ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", " * This will cause the program to hang..." ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", " *" ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", " * Taken from:" ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", " * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", " */" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "public" ], + [ "text", " " ], + [ "keyword", "static" ], + [ "text", " " ], + [ "keyword", "void" ], + [ "text", " " ], + [ "identifier", "main" ], + [ "lparen", "(" ], + [ "support.function", "String" ], + [ "lparen", "[" ], + [ "rparen", "]" ], + [ "text", " " ], + [ "identifier", "args" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "double" ], + [ "text", " " ], + [ "identifier", "d" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "support.function", "Double" ], + [ "text", "." ], + [ "identifier", "parseDouble" ], + [ "lparen", "(" ], + [ "string", "\"2.2250738585072012e-308\"" ], + [ "rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "// unreachable code" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.function", "System" ], + [ "text", "." ], + [ "identifier", "out" ], + [ "text", "." ], + [ "identifier", "println" ], + [ "lparen", "(" ], + [ "string", "\"Value: \"" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "identifier", "d" ], + [ "rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 1be3f605..b27744c1 100644 --- a/lib/ace/mode/_test/tokens_javascript.json +++ b/lib/ace/mode/_test/tokens_javascript.json @@ -1,593 +1,555 @@ -[[ - "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 +[ + { + "state": "regex_allowed", + "data": [ + [ "storage.type", "function" ], + [ "text", " " ], + [ "entity.name.function", "foo" ], + [ "paren.lparen", "(" ], + [ "variable.parameter", "items" ], + [ "punctuation.operator", ", " ], + [ "variable.parameter", "nada" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "regex_allowed", + "data": [ + [ "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", "{" ] + ] + }, + { + "state": "regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "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", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ], + [ "text", "\t" ], + [ "comment", "// Real Tab." ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "identifier", "regexp" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string.regexp", "/p" ], + [ "constant.language.escape", "|" ], + [ "string.regexp", "p/" ], + [ "text", " " ], + [ "comment", "// ends here" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "identifier", "r" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string.regexp", "/d" ], + [ "constant.language.escape", "{1,2}" ], + [ "constant.language.escape", "?" ], + [ "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.keyword.operator", "\\f" ], + [ "regexp.keyword.operator", "\\f" ], + [ "string.regexp.charachterclass", "[" ], + [ "regexp.keyword.operator", "\\f" ], + [ "constant.language.escape", "]" ], + [ "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", "$" ], + [ "constant.language.escape", "^" ], + [ "constant.language.escape", "(?:" ], + [ "string.regexp", "d" ], + [ "constant.language.escape", "|" ], + [ "string.regexp", "s" ], + [ "constant.language.escape", ")" ], + [ "constant.language.escape", "(?=" ], + [ "string.regexp", "a" ], + [ "constant.language.escape", "|" ], + [ "constant.language.escape", ")" ], + [ "constant.language.escape", "(?!" ], + [ "string.regexp", "y" ], + [ "constant.language.escape", ")[]" ], + [ "constant.language.escape", "|" ], + [ "constant.language.escape", "$" ], + [ "constant.language.escape", "?" ], + [ "constant.language.escape", "|" ], + [ "invalid", "^*" ], + [ "string.regexp", "/" ], + [ "text", " " ], + [ "identifier", "o" ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "a" ], + [ "keyword.operator", "=" ], + [ "string.regexp", "/a/" ], + [ "text", " " ], + [ "identifier", "jk" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string.regexp", "/ /" ], + [ "text", " " ], + [ "keyword.operator", "/" ], + [ "text", " " ], + [ "string.regexp", "/ /" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment.doc", "/************************************/" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment.doc", "/** total mess, tricky to highlight**/" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "regex_allowed", + "data": [ + [ "storage.type", "function" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "doc-start", + "data": [ + [ "text", "\t" ], + [ "comment.doc", "/**" ] + ] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "\t * docComment" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment.doc", "\t **/" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "identifier", "r" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string.regexp", "/u" ], + [ "regexp.keyword.operator", "\\t" ], + [ "constant.language.escape", "*" ], + [ "string.regexp", "/" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "identifier", "g" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "1." ], + [ "text", "00" ], + [ "identifier", "E" ], + [ "text", "^" ], + [ "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "identifier", "t" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "string", "'d'" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "string", "''" ], + [ "paren.rparen", "]" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "regex_allowed", + "data": [ + [ "storage.type", "function" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "regex_allowed", + "data": [ + [ "text", "\t" ], + [ "comment", "/* eee */" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "qqstring", + "data": [ + [ "string", "\"s\\" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "s" ], + [ "constant.language.escape", "\\u7824" ], + [ "string", "sss" ], + [ "constant.language.escape", "\\u" ], + [ "string", "1\"" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "qstring", + "data": [ + [ "string", "'\\" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "string'" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "'" ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "string" ], + [ "text", "'" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "string", "\"trailing space" ], + [ "constant.language.escape", "\\ " ], + [ "string", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "\" \"" ], + [ "text", " " ], + [ "keyword.operator", "/" ], + [ "identifier", "not" ], + [ "text", " " ], + [ "identifier", "a" ], + [ "text", " " ], + [ "identifier", "regexp" ], + [ "keyword.operator", "/" ], + [ "identifier", "g" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "/**" ] + ] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", " *doc" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment.doc", " */" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "regex_allowed", + "data": [ + [ "identifier", "a" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "regex_allowed", + "data": [ + [ "text", "\t" ], + [ "string", "'a'" ], + [ "punctuation.operator", ":" ], + [ "text", " " ], + [ "identifier", "b" ], + [ "punctuation.operator", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "string", "'g'" ], + [ "text", ": " ], + [ "storage.type", "function" ], + [ "paren.lparen", "(" ], + [ "variable.parameter", "t" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "entity.name.function", "gta" ], + [ "punctuation.operator", ":" ], + [ "storage.type", "function" ], + [ "paren.lparen", "(" ], + [ "variable.parameter", "a" ], + [ "punctuation.operator", "," ], + [ "variable.parameter", "b" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "function_arguments", + "data": [ + [ "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", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "punctuation.operator", " " ], + [ "variable.parameter", "c" ], + [ "punctuation.operator", ", " ], + [ "variable.parameter", "d" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", " " ] + ] + }, + { + "state": "start", + "data": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_json.json b/lib/ace/mode/_test/tokens_json.json index 4420a740..22dc2db7 100644 --- a/lib/ace/mode/_test/tokens_json.json +++ b/lib/ace/mode/_test/tokens_json.json @@ -1,412 +1,611 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"query\"" ], + [ "text", ": " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"count\"" ], + [ "text", ": " ], + [ "constant.numeric", "10" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"created\"" ], + [ "text", ": " ], + [ "string", "\"2011-06-21T08:10:46Z\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"lang\"" ], + [ "text", ": " ], + [ "string", "\"en-US\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"results\"" ], + [ "text", ": " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"photo\"" ], + [ "text", ": " ], + [ "paren.lparen", "[" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"farm\"" ], + [ "text", ": " ], + [ "string", "\"6\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"id\"" ], + [ "text", ": " ], + [ "string", "\"5855620975\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfamily\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfriend\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"ispublic\"" ], + [ "text", ": " ], + [ "string", "\"1\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"owner\"" ], + [ "text", ": " ], + [ "string", "\"32021554@N04\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"secret\"" ], + [ "text", ": " ], + [ "string", "\"f1f5e8515d\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"server\"" ], + [ "text", ": " ], + [ "string", "\"5110\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"title\"" ], + [ "text", ": " ], + [ "string", "\"7087 bandit cat\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"farm\"" ], + [ "text", ": " ], + [ "string", "\"4\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"id\"" ], + [ "text", ": " ], + [ "string", "\"5856170534\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfamily\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfriend\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"ispublic\"" ], + [ "text", ": " ], + [ "string", "\"1\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"owner\"" ], + [ "text", ": " ], + [ "string", "\"32021554@N04\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"secret\"" ], + [ "text", ": " ], + [ "string", "\"ff1efb2a6f\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"server\"" ], + [ "text", ": " ], + [ "string", "\"3217\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"title\"" ], + [ "text", ": " ], + [ "string", "\"6975 rusty cat\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"farm\"" ], + [ "text", ": " ], + [ "string", "\"6\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"id\"" ], + [ "text", ": " ], + [ "string", "\"5856172972\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfamily\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfriend\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"ispublic\"" ], + [ "text", ": " ], + [ "string", "\"1\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"owner\"" ], + [ "text", ": " ], + [ "string", "\"51249875@N03\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"secret\"" ], + [ "text", ": " ], + [ "string", "\"6c6887347c\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"server\"" ], + [ "text", ": " ], + [ "string", "\"5192\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"title\"" ], + [ "text", ": " ], + [ "string", "\"watermarked-cats\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"farm\"" ], + [ "text", ": " ], + [ "string", "\"6\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"id\"" ], + [ "text", ": " ], + [ "string", "\"5856168328\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfamily\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfriend\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"ispublic\"" ], + [ "text", ": " ], + [ "string", "\"1\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"owner\"" ], + [ "text", ": " ], + [ "string", "\"32021554@N04\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"secret\"" ], + [ "text", ": " ], + [ "string", "\"0c1cfdf64c\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"server\"" ], + [ "text", ": " ], + [ "string", "\"5078\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"title\"" ], + [ "text", ": " ], + [ "string", "\"7020 mandy cat\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"farm\"" ], + [ "text", ": " ], + [ "string", "\"3\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"id\"" ], + [ "text", ": " ], + [ "string", "\"5856171774\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfamily\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"isfriend\"" ], + [ "text", ": " ], + [ "string", "\"0\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"ispublic\"" ], + [ "text", ": " ], + [ "string", "\"1\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"owner\"" ], + [ "text", ": " ], + [ "string", "\"32021554@N04\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"secret\"" ], + [ "text", ": " ], + [ "string", "\"7f5a3180ab\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"server\"" ], + [ "text", ": " ], + [ "string", "\"2696\"" ], + [ "text", "," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "\"title\"" ], + [ "text", ": " ], + [ "string", "\"7448 bobby cat\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "]" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index d1a740b0..d7a227c9 100644 --- a/lib/ace/mode/_test/tokens_jsx.json +++ b/lib/ace/mode/_test/tokens_jsx.json @@ -1,51 +1,79 @@ -[[ - "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 +[ + { + "state": "comment", + "data": [ + [ "comment", "/*EXPECTED" ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", "hello world!" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "*/" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "class" ], + [ "text", " " ], + [ "language.support.class", "Test" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "// console.log(\"hello world!\");" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "log" ], + [ "text", " " ], + [ "string", "\"hello world!\"" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 52508e0d..0abe75ed 100644 --- a/lib/ace/mode/_test/tokens_latex.json +++ b/lib/ace/mode/_test/tokens_latex.json @@ -1,127 +1,196 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "keyword", "\\usepackage" ], + [ "lparen", "{" ], + [ "text", "amsmath" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "\\title" ], + [ "lparen", "{" ], + [ "keyword", "\\LaTeX" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "\\date" ], + [ "lparen", "{" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "\\begin" ], + [ "lparen", "{" ], + [ "text", "document" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "\\maketitle" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "\\LaTeX" ], + [ "lparen", "{" ], + [ "rparen", "}" ], + [ "text", " is a document preparation system for the " ], + [ "keyword", "\\TeX" ], + [ "lparen", "{" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " typesetting program. It offers programmable desktop publishing" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " features and extensive facilities for automating most aspects of" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " typesetting and desktop publishing, including numbering and" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " cross-referencing, tables and figures, page layout, bibliographies," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " and much more. " ], + [ "keyword", "\\LaTeX" ], + [ "lparen", "{" ], + [ "rparen", "}" ], + [ "text", " was originally written in 1984 by Leslie" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " Lamport and has become the dominant method for using " ], + [ "keyword", "\\TeX" ], + [ "text", "; few" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " people write in plain " ], + [ "keyword", "\\TeX" ], + [ "lparen", "{" ], + [ "rparen", "}" ], + [ "text", " anymore. The current version is" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "\\LaTeXe" ], + [ "text", "." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "% This is a comment; it will not be shown in the final output." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "% The following shows a little of the typesetting power of LaTeX:" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "\\begin" ], + [ "lparen", "{" ], + [ "text", "align" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " E &= mc^2 " ], + [ "keyword", "\\\\" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " m &= " ], + [ "keyword", "\\frac" ], + [ "lparen", "{" ], + [ "text", "m_0" ], + [ "rparen", "}" ], + [ "lparen", "{" ], + [ "keyword", "\\sqrt" ], + [ "lparen", "{" ], + [ "text", "1-" ], + [ "keyword", "\\frac" ], + [ "lparen", "{" ], + [ "text", "v^2" ], + [ "rparen", "}" ], + [ "lparen", "{" ], + [ "text", "c^2" ], + [ "rparen", "}" ], + [ "rparen", "}" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "\\end" ], + [ "lparen", "{" ], + [ "text", "align" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "\\end" ], + [ "lparen", "{" ], + [ "text", "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 index 81fe0c20..5a9f91b6 100644 --- a/lib/ace/mode/_test/tokens_less.json +++ b/lib/ace/mode/_test/tokens_less.json @@ -1,204 +1,292 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "/*" ], + [ "comment", " styles.less */" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable", "@base" ], + [ "text", ": " ], + [ "constant.numeric", "#f938ab" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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", ")" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " box-shadow: " ], + [ "variable", "@style" ], + [ "text", " " ], + [ "variable", "@c" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " -webkit-box-shadow: " ], + [ "variable", "@style" ], + [ "text", " " ], + [ "variable", "@c" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " -moz-box-shadow: " ], + [ "variable", "@style" ], + [ "text", " " ], + [ "variable", "@c" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "// Box styles" ] + ] + }, + { + "state": "start", + "data": [ + [ "variable.language", ".box" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "color" ], + [ "text", ": " ], + [ "support.function", "saturate" ], + [ "paren.lparen", "(" ], + [ "variable", "@base" ], + [ "text", ", " ], + [ "constant.numeric", "5%" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "border-color" ], + [ "text", ": " ], + [ "support.function", "lighten" ], + [ "paren.lparen", "(" ], + [ "variable", "@base" ], + [ "text", ", " ], + [ "constant.numeric", "30%" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable.language", "a" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "color" ], + [ "text", ": " ], + [ "variable", "@base" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " &" ], + [ "variable.language", ":hover" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "color" ], + [ "text", ": " ], + [ "support.function", "lighten" ], + [ "paren.lparen", "(" ], + [ "variable", "@base" ], + [ "text", ", " ], + [ "constant.numeric", "50%" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_liquid.json b/lib/ace/mode/_test/tokens_liquid.json index 30d003cb..73c37daa 100644 --- a/lib/ace/mode/_test/tokens_liquid.json +++ b/lib/ace/mode/_test/tokens_liquid.json @@ -1,551 +1,698 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "text", "The following examples can be found in full at http://liquidmarkup.org/" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Liquid is an extraction from the e-commerce system Shopify." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "Shopify powers many thousands of e-commerce stores which all call for unique designs." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "For this we developed Liquid which allows our customers complete design freedom while" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "maintaining the integrity of our servers." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Liquid has been in production use since June 2006 and is now used by many other" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "hosted web applications." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "It was developed for usage in Ruby on Rails web applications and integrates seamlessly" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "as a plugin but it also works excellently as a stand alone library." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Here's what it looks like:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "ul" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"products\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "for" ], + [ "text", " " ], + [ "identifier", "product" ], + [ "text", " " ], + [ "keyword", "in" ], + [ "text", " " ], + [ "identifier", "products" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "li" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "variable", "{{" ], + [ "text", " " ], + [ "identifier", "product" ], + [ "text", "." ], + [ "identifier", "title" ], + [ "text", " " ], + [ "variable", "}}" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " Only {{ product.price | format_as_money }}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ], + [ "variable", "{{" ], + [ "text", " " ], + [ "identifier", "product" ], + [ "text", "." ], + [ "identifier", "description" ], + [ "text", " | " ], + [ "identifier", "prettyprint" ], + [ "text", " | " ], + [ "support.function", "truncate" ], + [ "text", ": " ], + [ "constant.numeric", "200" ], + [ "text", " " ], + [ "variable", "}}" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "endfor" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Some more features include:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "text", "Filters" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ], + [ "text", " The word \"tobi\" in uppercase: {{ 'tobi' | upcase }} " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ], + [ "text", "The word \"tobi\" has {{ 'tobi' | size }} letters! " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ], + [ "text", "Change \"Hello world\" to \"Hi world\": {{ 'Hello world' | replace: 'Hello', 'Hi' }} " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ], + [ "text", "The date today is {{ 'now' | date: \"%Y %b %d\" }} " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "text", "If" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "identifier", "user" ], + [ "text", "." ], + [ "identifier", "name" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "'tobi'" ], + [ "text", " " ], + [ "identifier", "or" ], + [ "text", " " ], + [ "identifier", "user" ], + [ "text", "." ], + [ "identifier", "name" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "'marc'" ], + [ "text", " " ], + [ "variable", "%}" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " hi marc or tobi" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "endif" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "text", "Case" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "case" ], + [ "text", " " ], + [ "identifier", "template" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "when" ], + [ "text", " " ], + [ "string", "'index'" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " Welcome" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "when" ], + [ "text", " " ], + [ "string", "'product'" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{{" ], + [ "text", " " ], + [ "identifier", "product" ], + [ "text", "." ], + [ "identifier", "vendor" ], + [ "text", " | " ], + [ "identifier", "link_to_vendor" ], + [ "text", " " ], + [ "variable", "}}" ], + [ "text", " / {{ product.title }}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "else" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{{" ], + [ "text", " " ], + [ "identifier", "page_title" ], + [ "text", " " ], + [ "variable", "}}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "endcase" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "text", "For Loops" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "for" ], + [ "text", " " ], + [ "identifier", "item" ], + [ "text", " " ], + [ "keyword", "in" ], + [ "text", " " ], + [ "identifier", "array" ], + [ "text", " " ], + [ "variable", "%}" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{{" ], + [ "text", " " ], + [ "identifier", "item" ], + [ "text", " " ], + [ "variable", "}}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "endfor" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "text", "Tables" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "tablerow" ], + [ "text", " " ], + [ "identifier", "item" ], + [ "text", " " ], + [ "keyword", "in" ], + [ "text", " " ], + [ "identifier", "items" ], + [ "text", " " ], + [ "identifier", "cols" ], + [ "text", ": " ], + [ "constant.numeric", "3" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "variable.language", "tablerowloop" ], + [ "text", "." ], + [ "identifier", "col_first" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " First column: {{ item.variable }}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "else" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " Different column: {{ item.variable }}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "endif" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "{%" ], + [ "text", " " ], + [ "keyword", "endtablerow" ], + [ "text", " " ], + [ "variable", "%}" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ 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 index b60c7cb1..f249f658 100644 --- a/lib/ace/mode/_test/tokens_lua.json +++ b/lib/ace/mode/_test/tokens_lua.json @@ -1,348 +1,451 @@ -[[ - ["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 +[ + { + "state": "qcomment", + "data": [ + [ "comment", "--[[--" ] + ] + }, + { + "state": "qcomment", + "data": [ + [ "comment", "num_args takes in 5.1 byte code and extracts the number of arguments" ] + ] + }, + { + "state": "qcomment", + "data": [ + [ "comment", "from its function header." ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "--]]" ], + [ "comment", "--" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "function" ], + [ "text", " " ], + [ "identifier", "int" ], + [ "paren.lparen", "(" ], + [ "identifier", "t" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "end" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "function" ], + [ "text", " " ], + [ "identifier", "num_args" ], + [ "paren.lparen", "(" ], + [ "identifier", "func" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ], + [ "paren.rparen", ")" ], + [ "text", ", " ], + [ "identifier", "offset" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "constant.numeric", "26" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "comment", "--Get the params and var flag (whether there's a ... in the param)" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "end" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "-- Usage:" ] + ] + }, + { + "state": "start", + "data": [ + [ "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" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "-- Python styled string format operator" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "local" ], + [ "text", " " ], + [ "identifier", "gm" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.library", "debug" ], + [ "text", "." ], + [ "support.function", "getmetatable" ], + [ "paren.lparen", "(" ], + [ "string", "\"\"" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "identifier", "gm" ], + [ "text", "." ], + [ "support.function", "__mod" ], + [ "keyword.operator", "=" ], + [ "keyword", "function" ], + [ "paren.lparen", "(" ], + [ "identifier", "self" ], + [ "text", ", " ], + [ "identifier", "other" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "support.function", "type" ], + [ "paren.lparen", "(" ], + [ "identifier", "other" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "keyword.operator", "~" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "\"table\"" ], + [ "text", " " ], + [ "keyword", "then" ], + [ "text", " " ], + [ "identifier", "other" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "identifier", "other" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "keyword", "end" ] + ] + }, + { + "state": "start", + "data": [ + [ "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "return" ], + [ "text", " " ], + [ "identifier", "self" ], + [ "keyword.operator", ":" ], + [ "support.function", "format" ], + [ "paren.lparen", "(" ], + [ "support.function", "unpack" ], + [ "paren.lparen", "(" ], + [ "identifier", "other" ], + [ "paren.rparen", ")" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "end" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "qstring3", + "data": [ + [ "support.function", "print" ], + [ "paren.lparen", "(" ], + [ "string", "[===[" ] + ] + }, + { + "state": "qstring3", + "data": [ + [ "string", " blah blah %s, (%d %d)" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "]===]" ], + [ "keyword.operator", "%" ], + [ "paren.lparen", "{" ], + [ "string", "\"blah\"" ], + [ "text", ", " ], + [ "identifier", "num_args" ], + [ "paren.lparen", "(" ], + [ "identifier", "int" ], + [ "paren.rparen", ")" ], + [ "paren.rparen", "}" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "qcomment1", + "data": [ + [ "comment", "--[=[--" ] + ] + }, + { + "state": "qcomment1", + "data": [ + [ "comment", "table.maxn is deprecated, use # instead." ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "--]=]" ], + [ "comment", "--" ] + ] + }, + { + "state": "start", + "data": [ + [ "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" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_luapage.json b/lib/ace/mode/_test/tokens_luapage.json index 1fa765dd..a6395ef0 100644 --- a/lib/ace/mode/_test/tokens_luapage.json +++ b/lib/ace/mode/_test/tokens_luapage.json @@ -1,633 +1,824 @@ -[[ - "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 +[ + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", "" ], + [ "meta.tag", "<" ], + [ "text", "!" ], + [ "entity.other.attribute-name", "DOCTYPE" ], + [ "text", " " ], + [ "entity.other.attribute-name", "html" ], + [ "text", " " ], + [ "entity.other.attribute-name", "PUBLIC" ], + [ "text", " " ], + [ "string", "\"-//W3C//DTD XHTML 1.0 Strict//EN\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "string", "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "html" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "lua-qcomment", + "data": [ + [ "keyword", "<%" ], + [ "text", " " ], + [ "comment", "--[[--" ] + ] + }, + { + "state": "lua-qcomment", + "data": [ + [ "comment", " index.lp from the Kepler Project's LuaDoc HTML doclet." ] + ] + }, + { + "state": "lua-qcomment", + "data": [ + [ "comment", " http://keplerproject.github.com/luadoc/" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "--]]" ], + [ "text", " " ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "head" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "title" ], + [ "meta.tag", ">" ], + [ "text", "Reference" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "link" ], + [ "text", " " ], + [ "entity.other.attribute-name", "rel" ], + [ "keyword.operator", "=" ], + [ "string", "\"stylesheet\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "href" ], + [ "keyword.operator", "=" ], + [ "string", "\"<%=luadoc.doclet.html.link(\"" ], + [ "entity.other.attribute-name", "luadoc" ], + [ "text", "." ], + [ "entity.other.attribute-name", "css" ], + [ "string", "\")%>\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "type" ], + [ "keyword.operator", "=" ], + [ "string", "\"text/css\"" ], + [ "text", " " ], + [ "meta.tag", "/>" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "body" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"container\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"product\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"product_logo\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"product_name\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "big" ], + [ "meta.tag", ">" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "b" ], + [ "meta.tag", ">" ], + [ "meta.tag", "" ], + [ "meta.tag", "" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"product_description\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ], + [ "text", " " ], + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"main\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"navigation\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "}" ], + [ "paren.rparen", ")" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ], + [ "text", " " ], + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"content\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "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" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "text", "Modules" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "table" ], + [ "text", " " ], + [ "entity.other.attribute-name", "class" ], + [ "keyword.operator", "=" ], + [ "string", "\"module_list\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "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" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "tr" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "td" ], + [ "text", " " ], + [ "entity.other.attribute-name", "class" ], + [ "keyword.operator", "=" ], + [ "string", "\"name\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.anchor", "a" ], + [ "text", " " ], + [ "entity.other.attribute-name", "href" ], + [ "keyword.operator", "=" ], + [ "string", "\"<%=luadoc.doclet.html.module_link(modulename, doc)%>\"" ], + [ "meta.tag", ">" ], + [ "keyword", "<%=" ], + [ "identifier", "modulename" ], + [ "keyword", "%>" ], + [ "meta.tag", "" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "td" ], + [ "text", " " ], + [ "entity.other.attribute-name", "class" ], + [ "keyword.operator", "=" ], + [ "string", "\"summary\"" ], + [ "meta.tag", ">" ], + [ "keyword", "<%=" ], + [ "identifier", "doc" ], + [ "text", "." ], + [ "identifier", "modules" ], + [ "paren.lparen", "[" ], + [ "identifier", "modulename" ], + [ "paren.rparen", "]" ], + [ "text", "." ], + [ "identifier", "summary" ], + [ "keyword", "%>" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "keyword", "end" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "keyword", "end" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "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" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "h2" ], + [ "meta.tag", ">" ], + [ "text", "Files" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "table" ], + [ "text", " " ], + [ "entity.other.attribute-name", "class" ], + [ "keyword.operator", "=" ], + [ "string", "\"file_list\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "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" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "tr" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "td" ], + [ "text", " " ], + [ "entity.other.attribute-name", "class" ], + [ "keyword.operator", "=" ], + [ "string", "\"name\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.anchor", "a" ], + [ "text", " " ], + [ "entity.other.attribute-name", "href" ], + [ "keyword.operator", "=" ], + [ "string", "\"<%=luadoc.doclet.html.file_link(filepath)%>\"" ], + [ "meta.tag", ">" ], + [ "keyword", "<%=" ], + [ "identifier", "filepath" ], + [ "keyword", "%>" ], + [ "meta.tag", "" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.table", "td" ], + [ "text", " " ], + [ "entity.other.attribute-name", "class" ], + [ "keyword.operator", "=" ], + [ "string", "\"summary\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "keyword", "end" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "<%" ], + [ "keyword", "end" ], + [ "keyword", "%>" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ], + [ "text", " " ], + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ], + [ "text", " " ], + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"about\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "p" ], + [ "meta.tag", ">" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.anchor", "a" ], + [ "text", " " ], + [ "entity.other.attribute-name", "href" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://validator.w3.org/check?uri=referer\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.image", "img" ], + [ "text", " " ], + [ "entity.other.attribute-name", "src" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://www.w3.org/Icons/valid-xhtml10\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "alt" ], + [ "keyword.operator", "=" ], + [ "string", "\"Valid XHTML 1.0!\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "height" ], + [ "keyword.operator", "=" ], + [ "string", "\"31\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "width" ], + [ "keyword.operator", "=" ], + [ "string", "\"88\"" ], + [ "text", " " ], + [ "meta.tag", "/>" ], + [ "meta.tag", "" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ], + [ "text", " " ], + [ "comment", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ], + [ "text", " " ], + [ "comment", "" ], + [ "text", "\t" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ 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 index 29e878b2..02e22c00 100644 --- a/lib/ace/mode/_test/tokens_markdown.json +++ b/lib/ace/mode/_test/tokens_markdown.json @@ -1,114 +1,1202 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "text", "Ace (Ajax.org Cloud9 Editor)" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.1", "============================" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Ace is a standalone code editor written in JavaScript. Our goal is to create a browser based 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 or JavaScript application. Ace is developed as the primary editor for [" ], + [ "string", "Cloud9 IDE" ], + [ "text", "](" ], + [ "markup.underline", "http://www.cloud9ide.com/" ], + [ "text", ") and the successor of the Mozilla Skywriter (Bespin) Project." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Features" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "--------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* " ], + [ "markup.list", "Syntax highlighting" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Automatic indent and outdent" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* An optional command line" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Handles huge documents (100,000 lines and more are no problem)" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Fully customizable key bindings including VI and Emacs modes" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Themes (TextMate themes can be imported)" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Search and replace with regular expressions" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Highlight matching parentheses" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Toggle between soft tabs and real tabs" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Displays hidden characters" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Drag and drop text using the mouse" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Line wrapping" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Unstructured / user code folding" ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "* Live syntax checker (currently JavaScript/CoffeeScript)" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Take Ace for a spin!" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "--------------------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Check out the Ace live [" ], + [ "string", "demo" ], + [ "text", "](" ], + [ "markup.underline", "http://ajaxorg.github.com/ace/" ], + [ "text", ") or get a [" ], + [ "string", "Cloud9 IDE account" ], + [ "text", "](" ], + [ "markup.underline", "http://run.cloud9ide.com" ], + [ "text", ") to experience Ace while editing one of your own GitHub projects." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "If you want, you can use Ace as a textarea replacement thanks to the [" ], + [ "string", "Ace Bookmarklet" ], + [ "text", "](" ], + [ "markup.underline", "http://ajaxorg.github.com/ace/build/textarea/editor.html" ], + [ "text", ")." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "History" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "-------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Previously known as “Bespin” and “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. Both Ajax.org and Mozilla are actively developing and maintaining Ace." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Getting the code" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "----------------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "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!" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " git clone git://github.com/ajaxorg/ace.git" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " cd ace" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " git submodule update --init --recursive" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Embedding Ace" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "-------------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Ace can be easily embedded into any existing web page. The Ace git repository ships with a pre-packaged version of Ace inside of the " ], + [ "support.function", "`" ], + [ "support.function", "build" ], + [ "support.function", "`" ], + [ "text", " directory. The same packaged files are also available as a separate [" ], + [ "string", "download" ], + [ "text", "](" ], + [ "markup.underline", "https://github.com/ajaxorg/ace/downloads" ], + [ "text", "). Simply copy the contents of the " ], + [ "support.function", "`" ], + [ "support.function", "src" ], + [ "support.function", "`" ], + [ "text", " subdirectory somewhere into your project and take a look at the included demos of how to use Ace." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "The easiest version is simply:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "html-start", + "data": [ + [ "support.function", "```html" ] + ] + }, + { + "state": "html-start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "div" ], + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"editor\"" ], + [ "meta.tag", ">" ], + [ "text", "some text" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "html-start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.script", "script" ], + [ "text", " " ], + [ "entity.other.attribute-name", "src" ], + [ "keyword.operator", "=" ], + [ "string", "\"src/ace.js\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "type" ], + [ "keyword.operator", "=" ], + [ "string", "\"text/javascript\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "charset" ], + [ "keyword.operator", "=" ], + [ "string", "\"utf-8\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "html-js-start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.script", "script" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "html-js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "window" ], + [ "punctuation.operator", "." ], + [ "entity.name.function", "onload" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "storage.type", "function" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "html-js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "editor" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "ace" ], + [ "punctuation.operator", "." ], + [ "identifier", "edit" ], + [ "paren.lparen", "(" ], + [ "string", "\"editor\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "html-js-regex_allowed", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "html-start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "With \"editor\" being the id of the DOM element, which should be converted to an editor. Note that this element must be explicitly sized and positioned " ], + [ "support.function", "`" ], + [ "support.function", "absolute" ], + [ "support.function", "`" ], + [ "text", " or " ], + [ "support.function", "`" ], + [ "support.function", "relative" ], + [ "support.function", "`" ], + [ "text", " for Ace to work. e.g." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "css-start", + "data": [ + [ "support.function", "```css" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "keyword", "#editor" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "position" ], + [ "text", ": " ], + [ "support.constant", "absolute" ], + [ "text", ";" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "width" ], + [ "text", ": " ], + [ "constant.numeric", "500" ], + [ "keyword", "px" ], + [ "text", ";" ] + ] + }, + { + "state": "css-ruleset", + "data": [ + [ "text", " " ], + [ "support.type", "height" ], + [ "text", ": " ], + [ "constant.numeric", "400" ], + [ "keyword", "px" ], + [ "text", ";" ] + ] + }, + { + "state": "css-start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "To change the theme simply include the Theme's JavaScript file" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "html-start", + "data": [ + [ "support.function", "```html" ] + ] + }, + { + "state": "html-start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.script", "script" ], + [ "text", " " ], + [ "entity.other.attribute-name", "src" ], + [ "keyword.operator", "=" ], + [ "string", "\"src/theme-twilight.js\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "type" ], + [ "keyword.operator", "=" ], + [ "string", "\"text/javascript\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "charset" ], + [ "keyword.operator", "=" ], + [ "string", "\"utf-8\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "and configure the editor to use the theme:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "js-start", + "data": [ + [ "support.function", "```javascript" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "editor" ], + [ "punctuation.operator", "." ], + [ "identifier", "setTheme" ], + [ "paren.lparen", "(" ], + [ "string", "\"ace/theme/twilight\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "html-start", + "data": [ + [ "support.function", "```html" ] + ] + }, + { + "state": "html-start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name.script", "script" ], + [ "text", " " ], + [ "entity.other.attribute-name", "src" ], + [ "keyword.operator", "=" ], + [ "string", "\"src/mode-javascript.js\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "type" ], + [ "keyword.operator", "=" ], + [ "string", "\"text/javascript\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "charset" ], + [ "keyword.operator", "=" ], + [ "string", "\"utf-8\"" ], + [ "meta.tag", ">" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Then the mode can be used like this:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "js-start", + "data": [ + [ "support.function", "```javascript" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "JavaScriptMode" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "require" ], + [ "paren.lparen", "(" ], + [ "string", "\"ace/mode/javascript\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", "." ], + [ "identifier", "Mode" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "editor" ], + [ "punctuation.operator", "." ], + [ "identifier", "getSession" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", "." ], + [ "identifier", "setMode" ], + [ "paren.lparen", "(" ], + [ "keyword", "new" ], + [ "text", " " ], + [ "identifier", "JavaScriptMode" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Documentation" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "-------------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "You find a lot more sample code in the [" ], + [ "string", "demo app" ], + [ "text", "](" ], + [ "markup.underline", "https://github.com/ajaxorg/ace/blob/master/demo/demo.js" ], + [ "text", ")." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "There is also some documentation on the [" ], + [ "string", "wiki page" ], + [ "text", "](" ], + [ "markup.underline", "https://github.com/ajaxorg/ace/wiki" ], + [ "text", ")." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "If you still need help, feel free to drop a mail on the [" ], + [ "string", "ace mailing list" ], + [ "text", "](" ], + [ "markup.underline", "http://groups.google.com/group/ace-discuss" ], + [ "text", ")." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Running Ace" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "-----------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "After the checkout Ace works out of the box. No build step is required. Open 'editor.html' in any browser except Google Chrome. Google Chrome doesn't allow XMLHTTPRequests from files loaded from disc (i.e. with a file:/// URL). To open Ace in Chrome simply start the bundled mini HTTP server:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " ./static.py" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Or using Node.JS" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " ./static.js" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "The editor can then be opened at http://localhost:8888/index.html." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Package Ace" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "-----------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. Before you can build you need to make sure that the submodules are up to date." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " git submodule update --init --recursive" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Afterwards Ace can be built by calling" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " ./Makefile.dryice.js normal" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "The packaged Ace will be put in the 'build' folder." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "To build the bookmarklet version execute" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " ./Makefile.dryice.js bm" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Running the Unit Tests" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "----------------------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "The Ace unit tests run on node.js. Before the first run a couple of node modules have to be installed. The easiest way to do this is by using the node package manager (npm). In the Ace base directory simply call" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " npm link ." ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "To run the tests call:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", "```bash" ] + ] + }, + { + "state": "githubblock", + "data": [ + [ "support.function", " node lib/ace/test/all.js" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "```" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "You can also run the tests in your browser by serving:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", " http://localhost:8888/lib/ace/test/tests.html" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "This makes debugging failing tests way more easier." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Contributing" ] + ] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "------------" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "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:" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "1. " ], + [ "markup.list", "[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." ] + ] + }, + { + "state": "listblock", + "data": [ + [ "markup.list", "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" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "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." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Email: fabian.jakobs@web.de" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Fax: +31 (0) 206388953" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Address: Ajax.org B.V." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " Keizersgracht 241" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " 1016 EA, Amsterdam" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " the Netherlands" ] + ] + } +] \ 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 index 73e3cfcd..fa5055c4 100644 --- a/lib/ace/mode/_test/tokens_ocaml.json +++ b/lib/ace/mode/_test/tokens_ocaml.json @@ -1,200 +1,260 @@ -[[ - "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 +[ + { + "state": "comment", + "data": [ + [ "comment", "(*" ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", " * Example of early return implementation taken from" ] + ] + }, + { + "state": "comment", + "data": [ + [ "comment", " * http://ocaml.janestreet.com/?q=node/91" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", " *)" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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", "-" ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "t" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "keyword.operator", "=" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "let" ], + [ "text", " " ], + [ "keyword", "module" ], + [ "text", " " ], + [ "identifier", "M" ], + [ "text", " " ], + [ "keyword.operator", "=" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "struct" ], + [ "text", " " ], + [ "keyword", "exception" ], + [ "text", " " ], + [ "identifier", "Return" ], + [ "text", " " ], + [ "keyword", "of" ], + [ "text", " " ], + [ "identifier", "t" ], + [ "text", " " ], + [ "keyword", "end" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "in" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "-" ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "support.function", "raise" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "M" ], + [ "text", "." ], + [ "identifier", "Return" ], + [ "text", " " ], + [ "identifier", "x" ], + [ "paren.rparen", ")" ], + [ "paren.rparen", ")" ], + [ "text", "; " ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "keyword", "in" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "try" ], + [ "text", " " ], + [ "identifier", "f" ], + [ "text", " " ], + [ "identifier", "return" ], + [ "text", " " ], + [ "keyword", "with" ], + [ "text", " " ], + [ "identifier", "M" ], + [ "text", "." ], + [ "identifier", "Return" ], + [ "text", " " ], + [ "identifier", "x" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "x" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "(* Function that uses the 'early return' functionality provided by `with_return` *)" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "let" ], + [ "text", " " ], + [ "identifier", "sum_until_first_negative" ], + [ "text", " " ], + [ "support.function", "list" ], + [ "text", " " ], + [ "keyword.operator", "=" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "with_return" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "keyword", "fun" ], + [ "text", " " ], + [ "identifier", "r" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "keyword.operator", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "-" ], + [ "keyword.operator", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "identifier", "x" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "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", ")" ], + [ "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 index 30bb39c6..fb33da27 100644 --- a/lib/ace/mode/_test/tokens_perl.json +++ b/lib/ace/mode/_test/tokens_perl.json @@ -1,227 +1,311 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "#!/usr/bin/perl" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "use" ], + [ "text", " " ], + [ "identifier", "strict" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "use" ], + [ "text", " " ], + [ "identifier", "warnings" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "my" ], + [ "text", " " ], + [ "identifier", "$num_primes" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "0" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "my" ], + [ "text", " @" ], + [ "identifier", "primes" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "# Put 2 as the first prime so we won't have an empty array" ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "$primes" ], + [ "lparen", "[" ], + [ "identifier", "$num_primes" ], + [ "rparen", "]" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "2" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "$num_primes" ], + [ "keyword.operator", "++" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "identifier", "MAIN_LOOP" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "for" ], + [ "text", " " ], + [ "keyword", "my" ], + [ "text", " " ], + [ "identifier", "$number_to_check" ], + [ "text", " " ], + [ "lparen", "(" ], + [ "constant.numeric", "3" ], + [ "text", " " ], + [ "keyword.operator", ".." ], + [ "text", " " ], + [ "constant.numeric", "200" ], + [ "rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ], + [ "rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "next" ], + [ "text", " " ], + [ "identifier", "MAIN_LOOP" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "# If we reached this point it means $number_to_check is not" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "# divisable by any prime number that came before it." ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "$primes" ], + [ "lparen", "[" ], + [ "identifier", "$num_primes" ], + [ "rparen", "]" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "$number_to_check" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "$num_primes" ], + [ "keyword.operator", "++" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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", ")" ], + [ "rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.function", "print" ], + [ "text", " " ], + [ "identifier", "$primes" ], + [ "lparen", "[" ], + [ "identifier", "$p" ], + [ "rparen", "]" ], + [ "keyword.operator", "," ], + [ "text", " " ], + [ "string", "\", \"" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.function", "print" ], + [ "text", " " ], + [ "string", "\"\\n\"" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pgsql.json b/lib/ace/mode/_test/tokens_pgsql.json index fef23fd2..6e663093 100644 --- a/lib/ace/mode/_test/tokens_pgsql.json +++ b/lib/ace/mode/_test/tokens_pgsql.json @@ -1,889 +1,1020 @@ -[[ - "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 +[ + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword.statementBegin", "BEGIN" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "/**" ] + ] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "* Samples from PostgreSQL src/tutorial/basics.source" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment.doc", "*/" ] + ] + }, + { + "state": "statement", + "data": [ + [ "keyword.statementBegin", "CREATE" ], + [ "text", " " ], + [ "keyword", "TABLE" ], + [ "text", " " ], + [ "identifier", "weather" ], + [ "text", " " ], + [ "paren.lparen", "(" ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", "\t" ], + [ "identifier", "city" ], + [ "text", "\t\t" ], + [ "keyword", "varchar" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "80" ], + [ "paren.rparen", ")" ], + [ "text", "," ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", "\t" ], + [ "identifier", "temp_lo" ], + [ "text", "\t\t" ], + [ "keyword", "int" ], + [ "text", ",\t\t" ], + [ "comment", "-- low temperature" ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", "\t" ], + [ "identifier", "temp_hi" ], + [ "text", "\t\t" ], + [ "keyword", "int" ], + [ "text", ",\t\t" ], + [ "comment", "-- high temperature" ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", "\t" ], + [ "identifier", "prcp" ], + [ "text", "\t\t" ], + [ "keyword", "real" ], + [ "text", ",\t\t" ], + [ "comment", "-- precipitation" ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", "\t" ], + [ "variable.language", "\"date\"" ], + [ "text", "\t\t" ], + [ "keyword", "date" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", ")" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "statement", + "data": [ + [ "keyword.statementBegin", "CREATE" ], + [ "text", " " ], + [ "keyword", "TABLE" ], + [ "text", " " ], + [ "identifier", "cities" ], + [ "text", " " ], + [ "paren.lparen", "(" ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", "\t" ], + [ "keyword", "name" ], + [ "text", "\t\t" ], + [ "keyword", "varchar" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "80" ], + [ "paren.rparen", ")" ], + [ "text", "," ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", "\t" ], + [ "keyword", "location" ], + [ "text", "\t" ], + [ "keyword", "point" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", ")" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "statement", + "data": [ + [ "keyword.statementBegin", "INSERT" ], + [ "text", " " ], + [ "keyword", "INTO" ], + [ "text", " " ], + [ "identifier", "weather" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "statement", + "data": [ + [ "keyword.statementBegin", "INSERT" ], + [ "text", " " ], + [ "keyword", "INTO" ], + [ "text", " " ], + [ "identifier", "cities" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "VALUES" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "string", "'San Francisco'" ], + [ "text", ", " ], + [ "string", "'(-194.0, 53.0)'" ], + [ "paren.rparen", ")" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "statement", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "statement", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "VALUES" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "string", "'1994-11-29'" ], + [ "text", ", " ], + [ "string", "'Hayward'" ], + [ "text", ", " ], + [ "constant.numeric", "54" ], + [ "text", ", " ], + [ "constant.numeric", "37" ], + [ "paren.rparen", ")" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "statement", + "data": [ + [ "keyword.statementBegin", "SELECT" ], + [ "text", " " ], + [ "identifier", "city" ], + [ "text", ", " ], + [ "identifier", "temp_lo" ], + [ "text", ", " ], + [ "identifier", "temp_hi" ], + [ "text", ", " ], + [ "identifier", "prcp" ], + [ "text", ", " ], + [ "variable.language", "\"date\"" ], + [ "text", ", " ], + [ "keyword", "location" ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", " " ], + [ "keyword", "FROM" ], + [ "text", " " ], + [ "identifier", "weather" ], + [ "text", ", " ], + [ "identifier", "cities" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "WHERE" ], + [ "text", " " ], + [ "identifier", "city" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "keyword", "name" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "/**" ] + ] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "* Dollar quotes starting at the end of the line are colored as SQL unless" ] + ] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "* a special language tag is used. Pearl and Python are currently implemented" ] + ] + }, + { + "state": "doc-start", + "data": [ + [ "comment.doc", "* but lots of others are possible." ] + ] + }, + { + "state": "start", + "data": [ + [ "comment.doc", "*/" ] + ] + }, + { + "state": "statement", + "data": [ + [ "keyword.statementBegin", "create" ], + [ "text", " " ], + [ "keyword", "or" ], + [ "text", " " ], + [ "keyword", "replace" ], + [ "text", " " ], + [ "keyword", "function" ], + [ "text", " " ], + [ "identifier", "blob_content_chunked" ], + [ "paren.lparen", "(" ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", " " ], + [ "keyword", "in" ], + [ "text", " " ], + [ "identifier", "p_data" ], + [ "text", " " ], + [ "keyword", "bytea" ], + [ "text", ", " ] + ] + }, + { + "state": "statement", + "data": [ + [ "text", " " ], + [ "keyword", "in" ], + [ "text", " " ], + [ "identifier", "p_chunk" ], + [ "text", " " ], + [ "keyword", "integer" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "keyword", "returns" ], + [ "text", " " ], + [ "keyword", "setof" ], + [ "text", " " ], + [ "keyword", "bytea" ], + [ "text", " " ], + [ "keyword", "as" ], + [ "text", " " ], + [ "string", "$$" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "comment", "-- Still SQL comments" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "keyword", "declare" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "text", "\t" ], + [ "identifier", "v_size" ], + [ "text", " " ], + [ "keyword", "integer" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "support.function", "octet_length" ], + [ "paren.lparen", "(" ], + [ "identifier", "p_data" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "keyword", "begin" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "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" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "text", "\t" ], + [ "keyword", "end" ], + [ "text", " " ], + [ "identifier", "loop" ], + [ "text", ";" ] + ] + }, + { + "state": "dollarSql", + "data": [ + [ "keyword", "end" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "$$" ], + [ "text", " " ], + [ "keyword", "language" ], + [ "text", " " ], + [ "identifier", "plpgsql" ], + [ "text", " " ], + [ "keyword", "stable" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "-- pl/perl" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "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$" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "text", " " ], + [ "comment", "# perl comment..." ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "text", " " ], + [ "keyword", "my" ], + [ "text", " " ], + [ "lparen", "(" ], + [ "identifier", "$x" ], + [ "keyword.operator", "," ], + [ "identifier", "$y" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " @" ], + [ "identifier", "_" ], + [ "text", ";" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "lparen", "(" ], + [ "keyword.operator", "!" ], + [ "text", " " ], + [ "support.function", "defined" ], + [ "text", " " ], + [ "identifier", "$x" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "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", "}" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "text", " " ], + [ "support.function", "return" ], + [ "text", " " ], + [ "identifier", "$y" ], + [ "text", ";" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "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", "}" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "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", "}" ] + ] + }, + { + "state": "perl-start", + "data": [ + [ "text", " " ], + [ "support.function", "return" ], + [ "text", " " ], + [ "identifier", "$y" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "$perl$" ], + [ "text", " " ], + [ "keyword", "LANGUAGE" ], + [ "text", " " ], + [ "identifier", "plperl" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "-- pl/python" ] + ] + }, + { + "state": "python-start", + "data": [ + [ "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$" ] + ] + }, + { + "state": "python-start", + "data": [ + [ "text", " " ], + [ "comment", "# python comment..." ] + ] + }, + { + "state": "python-start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "identifier", "SD" ], + [ "text", "." ], + [ "identifier", "has_key" ], + [ "paren.lparen", "(" ], + [ "string", "\"plan\"" ], + [ "paren.rparen", ")" ], + [ "text", ":" ] + ] + }, + { + "state": "python-start", + "data": [ + [ "text", " " ], + [ "identifier", "plan" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "SD" ], + [ "paren.lparen", "[" ], + [ "string", "\"plan\"" ], + [ "paren.rparen", "]" ] + ] + }, + { + "state": "python-start", + "data": [ + [ "text", " " ], + [ "keyword", "else" ], + [ "text", ":" ] + ] + }, + { + "state": "python-start", + "data": [ + [ "text", " " ], + [ "identifier", "plan" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "plpy" ], + [ "text", "." ], + [ "identifier", "prepare" ], + [ "paren.lparen", "(" ], + [ "string", "\"SELECT 1\"" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "python-start", + "data": [ + [ "text", " " ], + [ "identifier", "SD" ], + [ "paren.lparen", "[" ], + [ "string", "\"plan\"" ], + [ "paren.rparen", "]" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "plan" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "$python$" ], + [ "text", " " ], + [ "keyword", "LANGUAGE" ], + [ "text", " " ], + [ "identifier", "plpythonu" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "-- psql commands" ] + ] + }, + { + "state": "start", + "data": [ + [ "support.buildin", "\\df cash*" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "-- Some string samples." ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword.statementBegin", "select" ], + [ "text", " " ], + [ "string", "'don'" ], + [ "string", "'t do it now;'" ], + [ "text", " " ], + [ "keyword.operator", "|" ], + [ "keyword.operator", "|" ], + [ "text", " " ], + [ "string", "'maybe later'" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword.statementBegin", "select" ], + [ "text", " " ], + [ "identifier", "E" ], + [ "string", "'dont\\'t do it'" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword.statementBegin", "select" ], + [ "text", " " ], + [ "support.function", "length" ], + [ "paren.lparen", "(" ], + [ "string", "'some other'" ], + [ "string", "'s stuff'" ], + [ "text", " " ], + [ "keyword.operator", "|" ], + [ "keyword.operator", "|" ], + [ "text", " " ], + [ "string", "$$" ], + [ "string", "cat in hat's stuff $$" ], + [ "paren.rparen", ")" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "dollarStatementString", + "data": [ + [ "keyword.statementBegin", "select" ], + [ "text", " " ], + [ "string", "$$ strings" ] + ] + }, + { + "state": "dollarStatementString", + "data": [ + [ "string", "over multiple " ] + ] + }, + { + "state": "dollarStatementString", + "data": [ + [ "string", "lines - use dollar quotes" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "$$" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword.statementBegin", "END" ], + [ "statementEnd", ";" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_php.json b/lib/ace/mode/_test/tokens_php.json index 2134dccb..4af87375 100644 --- a/lib/ace/mode/_test/tokens_php.json +++ b/lib/ace/mode/_test/tokens_php.json @@ -1,171 +1,238 @@ -[[ - "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 +[ + { + "state": "php-start", + "data": [ + [ "support.php_tag", "" ] + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_powershell.json b/lib/ace/mode/_test/tokens_powershell.json index 43b77db4..d2fa444e 100644 --- a/lib/ace/mode/_test/tokens_powershell.json +++ b/lib/ace/mode/_test/tokens_powershell.json @@ -1,184 +1,255 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "# This is a simple comment" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "function" ], + [ "text", " " ], + [ "identifier", "Hello" ], + [ "lparen", "(" ], + [ "variable.instance", "$name" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "Write-host" ], + [ "text", " " ], + [ "string", "\"Hello $name\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "function" ], + [ "text", " " ], + [ "identifier", "add" ], + [ "lparen", "(" ], + [ "variable.instance", "$left" ], + [ "text", ", " ], + [ "variable.instance", "$right" ], + [ "keyword.operator", "=" ], + [ "constant.numeric", "4" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "lparen", "(" ], + [ "variable.instance", "$right" ], + [ "text", " " ], + [ "keyword.operator", "-ne" ], + [ "text", " " ], + [ "constant.numeric", "4" ], + [ "rparen", ")" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "return" ], + [ "text", " " ], + [ "variable.instance", "$left" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "return" ], + [ "text", " " ], + [ "constant.numeric", "3" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "rparen", "}" ], + [ "text", " " ], + [ "keyword", "else" ], + [ "text", " " ], + [ "lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "return" ], + [ "text", " " ], + [ "constant.numeric", "2" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable.instance", "$number" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "1" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "constant.numeric", "2" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "variable.instance", "$number" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "3" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "Write-Host" ], + [ "text", " " ], + [ "identifier", "Hello" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "identifier", "name" ], + [ "text", " " ], + [ "string", "\"World\"" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable.instance", "$an_array" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " @" ], + [ "lparen", "(" ], + [ "constant.numeric", "1" ], + [ "text", ", " ], + [ "constant.numeric", "2" ], + [ "text", ", " ], + [ "constant.numeric", "3" ], + [ "rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "variable.instance", "$a_hash" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " @" ], + [ "lparen", "{" ], + [ "string", "\"something\"" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "\"something else\"" ], + [ "rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword.operator", "&" ], + [ "text", " " ], + [ "identifier", "notepad" ], + [ "text", " .\\" ], + [ "identifier", "readme" ], + [ "text", "." ], + [ "identifier", "md" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ 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 index 293c8ff2..5936fce2 100644 --- a/lib/ace/mode/_test/tokens_python.json +++ b/lib/ace/mode/_test/tokens_python.json @@ -1,152 +1,205 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "#!/usr/local/bin/python" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "import" ], + [ "text", " " ], + [ "identifier", "string" ], + [ "text", ", " ], + [ "identifier", "sys" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "# If no arguments were given, print a helpful message" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "if" ], + [ "text", " " ], + [ "support.function", "len" ], + [ "paren.lparen", "(" ], + [ "identifier", "sys" ], + [ "text", "." ], + [ "identifier", "argv" ], + [ "paren.rparen", ")" ], + [ "keyword.operator", "==" ], + [ "constant.numeric", "1" ], + [ "text", ":" ] + ] + }, + { + "state": "qstring", + "data": [ + [ "text", " " ], + [ "keyword", "print" ], + [ "text", " " ], + [ "string", "'''Usage:" ] + ] + }, + { + "state": "start", + "data": [ + [ "string", "celsius temp1 temp2 ...'''" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "sys" ], + [ "text", "." ], + [ "identifier", "exit" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "0" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "# Loop over the arguments" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "for" ], + [ "text", " " ], + [ "identifier", "i" ], + [ "text", " " ], + [ "keyword", "in" ], + [ "text", " " ], + [ "identifier", "sys" ], + [ "text", "." ], + [ "identifier", "argv" ], + [ "paren.lparen", "[" ], + [ "constant.numeric", "1" ], + [ "text", ":" ], + [ "paren.rparen", "]" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "try" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "fahrenheit" ], + [ "keyword.operator", "=" ], + [ "support.function", "float" ], + [ "paren.lparen", "(" ], + [ "identifier", "string" ], + [ "text", "." ], + [ "identifier", "atoi" ], + [ "paren.lparen", "(" ], + [ "identifier", "i" ], + [ "paren.rparen", ")" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "except" ], + [ "text", " " ], + [ "identifier", "string" ], + [ "text", "." ], + [ "identifier", "atoi_error" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "print" ], + [ "text", " " ], + [ "support.function", "repr" ], + [ "paren.lparen", "(" ], + [ "identifier", "i" ], + [ "paren.rparen", ")" ], + [ "text", ", " ], + [ "string", "\"not a numeric value\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "else" ], + [ "text", ":" ] + ] + }, + { + "state": "start", + "data": [ + [ "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "print" ], + [ "text", " " ], + [ "string", "'%i\\260F = %i\\260C'" ], + [ "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", ")" ], + [ "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 index f9991e9c..02160407 100644 --- a/lib/ace/mode/_test/tokens_ruby.json +++ b/lib/ace/mode/_test/tokens_ruby.json @@ -1,242 +1,104 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "#!/usr/bin/ruby" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "# Program to find the factorial of a number" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "fact" ], + [ "paren.lparen", "(" ], + [ "identifier", "n" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "identifier", "n" ], + [ "text", " " ], + [ "keyword.operator", "==" ], + [ "text", " " ], + [ "constant.numeric", "0" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "else" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "n" ], + [ "text", " " ], + [ "keyword.operator", "*" ], + [ "text", " " ], + [ "identifier", "fact" ], + [ "paren.lparen", "(" ], + [ "identifier", "n" ], + [ "constant.numeric", "-1" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "end" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "end" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "puts" ], + [ "text", " " ], + [ "identifier", "fact" ], + [ "paren.lparen", "(" ], + [ "variable.class", "ARGV" ], + [ "paren.lparen", "[" ], + [ "constant.numeric", "0" ], + [ "paren.rparen", "]" ], + [ "text", "." ], + [ "identifier", "to_i" ], + [ "paren.rparen", ")" ] + ] + } +] \ 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 index 8f0ff637..b9eefe5f 100644 --- a/lib/ace/mode/_test/tokens_scad.json +++ b/lib/ace/mode/_test/tokens_scad.json @@ -1,194 +1,267 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "// ace can highlight scad!" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "module" ], + [ "text", " " ], + [ "identifier", "Element" ], + [ "paren.lparen", "(" ], + [ "identifier", "xpos" ], + [ "text", ", " ], + [ "identifier", "ypos" ], + [ "text", ", " ], + [ "identifier", "zpos" ], + [ "paren.rparen", ")" ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "identifier", "translate" ], + [ "paren.lparen", "(" ], + [ "paren.lparen", "[" ], + [ "identifier", "xpos" ], + [ "text", "," ], + [ "identifier", "ypos" ], + [ "text", "," ], + [ "identifier", "zpos" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", ")" ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "identifier", "union" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t\t" ], + [ "identifier", "cube" ], + [ "paren.lparen", "(" ], + [ "paren.lparen", "[" ], + [ "constant.numeric", "10" ], + [ "text", "," ], + [ "constant.numeric", "10" ], + [ "text", "," ], + [ "constant.numeric", "4" ], + [ "paren.rparen", "]" ], + [ "text", "," ], + [ "identifier", "true" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t\t" ], + [ "identifier", "cylinder" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "10" ], + [ "text", "," ], + [ "constant.numeric", "15" ], + [ "text", "," ], + [ "constant.numeric", "5" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t\t" ], + [ "identifier", "translate" ], + [ "paren.lparen", "(" ], + [ "paren.lparen", "[" ], + [ "constant.numeric", "0" ], + [ "text", "," ], + [ "constant.numeric", "0" ], + [ "text", "," ], + [ "constant.numeric", "10" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", ")" ], + [ "identifier", "sphere" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "5" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "identifier", "union" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "keyword", "for" ], + [ "paren.lparen", "(" ], + [ "identifier", "i" ], + [ "keyword.operator", "=" ], + [ "paren.lparen", "[" ], + [ "constant.numeric", "0" ], + [ "text", ":" ], + [ "constant.numeric", "30" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", ")" ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t# " ], + [ "identifier", "Element" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "0" ], + [ "text", "," ], + [ "constant.numeric", "0" ], + [ "text", "," ], + [ "constant.numeric", "0" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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.rparen", ")" ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "identifier", "rotate" ], + [ "paren.lparen", "(" ], + [ "paren.lparen", "[" ], + [ "identifier", "i" ], + [ "keyword.operator", "*" ], + [ "constant.numeric", "10" ], + [ "text", "," ], + [ "constant.numeric", "0" ], + [ "text", "," ], + [ "constant.numeric", "0" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", ")" ], + [ "identifier", "scale" ], + [ "paren.lparen", "(" ], + [ "paren.lparen", "[" ], + [ "constant.numeric", "1" ], + [ "text", "," ], + [ "constant.numeric", "1" ], + [ "text", "," ], + [ "identifier", "i" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", ")" ], + [ "identifier", "cube" ], + [ "paren.lparen", "(" ], + [ "constant.numeric", "10" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 01dd3ce3..88fa8332 100644 --- a/lib/ace/mode/_test/tokens_scala.json +++ b/lib/ace/mode/_test/tokens_scala.json @@ -1,542 +1,748 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "// http://www.scala-lang.org/node/54" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "package" ], + [ "text", " " ], + [ "identifier", "examples" ], + [ "text", "." ], + [ "identifier", "actors" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "import" ], + [ "text", " " ], + [ "identifier", "scala" ], + [ "text", "." ], + [ "identifier", "actors" ], + [ "text", "." ], + [ "identifier", "Actor" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "import" ], + [ "text", " " ], + [ "identifier", "scala" ], + [ "text", "." ], + [ "identifier", "actors" ], + [ "text", "." ], + [ "identifier", "Actor" ], + [ "text", "." ], + [ "identifier", "_" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "abstract" ], + [ "text", " " ], + [ "keyword", "class" ], + [ "text", " " ], + [ "identifier", "PingMessage" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "case" ], + [ "text", " " ], + [ "keyword", "object" ], + [ "text", " " ], + [ "identifier", "Start" ], + [ "text", " " ], + [ "keyword", "extends" ], + [ "text", " " ], + [ "identifier", "PingMessage" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "case" ], + [ "text", " " ], + [ "keyword", "object" ], + [ "text", " " ], + [ "identifier", "SendPing" ], + [ "text", " " ], + [ "keyword", "extends" ], + [ "text", " " ], + [ "identifier", "PingMessage" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "case" ], + [ "text", " " ], + [ "keyword", "object" ], + [ "text", " " ], + [ "identifier", "Pong" ], + [ "text", " " ], + [ "keyword", "extends" ], + [ "text", " " ], + [ "identifier", "PingMessage" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "abstract" ], + [ "text", " " ], + [ "keyword", "class" ], + [ "text", " " ], + [ "identifier", "PongMessage" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "case" ], + [ "text", " " ], + [ "keyword", "object" ], + [ "text", " " ], + [ "identifier", "Ping" ], + [ "text", " " ], + [ "keyword", "extends" ], + [ "text", " " ], + [ "identifier", "PongMessage" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "case" ], + [ "text", " " ], + [ "keyword", "object" ], + [ "text", " " ], + [ "identifier", "Stop" ], + [ "text", " " ], + [ "keyword", "extends" ], + [ "text", " " ], + [ "identifier", "PongMessage" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "object" ], + [ "text", " " ], + [ "identifier", "pingpong" ], + [ "text", " " ], + [ "keyword", "extends" ], + [ "text", " " ], + [ "identifier", "Application" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "val" ], + [ "text", " " ], + [ "identifier", "pong" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "keyword", "new" ], + [ "text", " " ], + [ "identifier", "Pong" ] + ] + }, + { + "state": "start", + "data": [ + [ "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", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "ping" ], + [ "text", "." ], + [ "identifier", "start" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "pong" ], + [ "text", "." ], + [ "identifier", "start" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "ping" ], + [ "text", " " ], + [ "keyword.operator", "!" ], + [ "text", " " ], + [ "identifier", "Start" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "act" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "println" ], + [ "paren.lparen", "(" ], + [ "string", "\"Ping: Initializing with count \"" ], + [ "keyword.operator", "+" ], + [ "identifier", "count" ], + [ "keyword.operator", "+" ], + [ "string", "\": \"" ], + [ "keyword.operator", "+" ], + [ "identifier", "pong" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "var" ], + [ "text", " " ], + [ "identifier", "pingsLeft" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "count" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "loop" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "react" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "case" ], + [ "text", " " ], + [ "identifier", "Start" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "keyword.operator", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "println" ], + [ "paren.lparen", "(" ], + [ "string", "\"Ping: starting.\"" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "pong" ], + [ "text", " " ], + [ "keyword.operator", "!" ], + [ "text", " " ], + [ "identifier", "Ping" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "pingsLeft" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "pingsLeft" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "case" ], + [ "text", " " ], + [ "identifier", "SendPing" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "keyword.operator", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "pong" ], + [ "text", " " ], + [ "keyword.operator", "!" ], + [ "text", " " ], + [ "identifier", "Ping" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "pingsLeft" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "pingsLeft" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "case" ], + [ "text", " " ], + [ "identifier", "Pong" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "keyword.operator", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "pingsLeft" ], + [ "text", " " ], + [ "keyword.operator", "%" ], + [ "text", " " ], + [ "constant.numeric", "1000" ], + [ "text", " " ], + [ "keyword.operator", "==" ], + [ "text", " " ], + [ "constant.numeric", "0" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "println" ], + [ "paren.lparen", "(" ], + [ "string", "\"Ping: pong from: \"" ], + [ "keyword.operator", "+" ], + [ "identifier", "sender" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "pingsLeft" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "constant.numeric", "0" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "self" ], + [ "text", " " ], + [ "keyword.operator", "!" ], + [ "text", " " ], + [ "identifier", "SendPing" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "else" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "println" ], + [ "paren.lparen", "(" ], + [ "string", "\"Ping: Stop.\"" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "pong" ], + [ "text", " " ], + [ "keyword.operator", "!" ], + [ "text", " " ], + [ "identifier", "Stop" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "exit" ], + [ "paren.lparen", "(" ], + [ "symbol.constant", "'stop" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "class" ], + [ "text", " " ], + [ "identifier", "Pong" ], + [ "text", " " ], + [ "keyword", "extends" ], + [ "text", " " ], + [ "identifier", "Actor" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "def" ], + [ "text", " " ], + [ "identifier", "act" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "var" ], + [ "text", " " ], + [ "identifier", "pongCount" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "0" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "loop" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "react" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "case" ], + [ "text", " " ], + [ "identifier", "Ping" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "keyword.operator", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "pongCount" ], + [ "text", " " ], + [ "keyword.operator", "%" ], + [ "text", " " ], + [ "constant.numeric", "1000" ], + [ "text", " " ], + [ "keyword.operator", "==" ], + [ "text", " " ], + [ "constant.numeric", "0" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "println" ], + [ "paren.lparen", "(" ], + [ "string", "\"Pong: ping \"" ], + [ "keyword.operator", "+" ], + [ "identifier", "pongCount" ], + [ "keyword.operator", "+" ], + [ "string", "\" from \"" ], + [ "keyword.operator", "+" ], + [ "identifier", "sender" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "sender" ], + [ "text", " " ], + [ "keyword.operator", "!" ], + [ "text", " " ], + [ "identifier", "Pong" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "pongCount" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "pongCount" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "case" ], + [ "text", " " ], + [ "identifier", "Stop" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "keyword.operator", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "println" ], + [ "paren.lparen", "(" ], + [ "string", "\"Pong: Stop.\"" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "exit" ], + [ "paren.lparen", "(" ], + [ "symbol.constant", "'stop" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 7e92f153..fddaeda5 100644 --- a/lib/ace/mode/_test/tokens_scss.json +++ b/lib/ace/mode/_test/tokens_scss.json @@ -1,123 +1,181 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "/*" ], + [ "comment", " style.scss */" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable.language", "#navbar" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "$navbar-width" ], + [ "text", ": " ], + [ "constant.numeric", "800px" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "$items" ], + [ "text", ": " ], + [ "constant.numeric", "5" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "$navbar-color" ], + [ "text", ": " ], + [ "constant.numeric", "#ce4dd6" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "width" ], + [ "text", ": " ], + [ "variable", "$navbar-width" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "border-bottom" ], + [ "text", ": " ], + [ "constant.numeric", "2px" ], + [ "text", " " ], + [ "constant.language", "solid" ], + [ "text", " " ], + [ "variable", "$navbar-color" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable.language", "li" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "float" ], + [ "text", ": " ], + [ "support.type", "left" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "width" ], + [ "text", ": " ], + [ "variable", "$navbar-width" ], + [ "text", "/" ], + [ "variable", "$items" ], + [ "text", " " ], + [ "constant", "-" ], + [ "text", " " ], + [ "constant.numeric", "10px" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "background-color" ], + [ "text", ": " ], + [ "support.function", "lighten" ], + [ "paren.lparen", "(" ], + [ "variable", "$navbar-color" ], + [ "text", ", " ], + [ "constant.numeric", "20%" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " &" ], + [ "variable.language", ":hover" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "support.type", "background-color" ], + [ "text", ": " ], + [ "support.function", "lighten" ], + [ "paren.lparen", "(" ], + [ "variable", "$navbar-color" ], + [ "text", ", " ], + [ "constant.numeric", "10%" ], + [ "paren.rparen", ")" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index f2c6b276..582282fb 100644 --- a/lib/ace/mode/_test/tokens_sh.json +++ b/lib/ace/mode/_test/tokens_sh.json @@ -1,334 +1,434 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "#!/bin/sh" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "comment", "# Script to open a browser to current branch" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "# Repo formats:" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "# ssh git@github.com:richoH/gh_pr.git" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "# http https://richoH@github.com/richoH/gh_pr.git" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "# git git://github.com/richoH/gh_pr.git" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "variable", "username=" ], + [ "text", "`" ], + [ "identifier", "git" ], + [ "text", " " ], + [ "identifier", "config" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "keyword.operator", "-" ], + [ "identifier", "get" ], + [ "text", " " ], + [ "identifier", "github" ], + [ "text", "." ], + [ "identifier", "user" ], + [ "text", "`" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "support.function", "get_repo()" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "variable", "repo=" ], + [ "text", "`" ], + [ "constant.language", "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "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$//\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "exit" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "fi" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "variable", "repo=" ], + [ "text", "`" ], + [ "constant.language", "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "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$//\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "exit" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "fi" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "variable", "repo=" ], + [ "text", "`" ], + [ "constant.language", "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" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "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$//\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "exit" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "fi" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "done" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "text", " " ], + [ "variable.language", "$?" ], + [ "text", " " ], + [ "keyword.operator", "-" ], + [ "identifier", "eq" ], + [ "text", " " ], + [ "constant.numeric", "0" ], + [ "text", " " ], + [ "paren.rparen", "]" ], + [ "text", "; " ], + [ "keyword", "then" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "echo" ], + [ "text", " " ], + [ "string", "\"Couldn't find a valid remote\"" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "support.function", "&2" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "exit" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "fi" ] + ] + }, + { + "state": "start", + "data": [ + [ "paren.rparen", "}" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "if" ], + [ "text", " " ], + [ "variable", "repo=" ], + [ "text", "`" ], + [ "identifier", "get_repo" ], + [ "text", " $@`; " ], + [ "keyword", "then" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "variable", "branch=" ], + [ "text", "`" ], + [ "identifier", "git" ], + [ "text", " " ], + [ "identifier", "symbolic" ], + [ "keyword.operator", "-" ], + [ "identifier", "ref" ], + [ "text", " " ], + [ "identifier", "HEAD" ], + [ "text", " " ], + [ "constant.numeric", "2" ], + [ "keyword.operator", ">" ], + [ "keyword.operator", "/" ], + [ "identifier", "dev" ], + [ "keyword.operator", "/" ], + [ "identifier", "null" ], + [ "text", "`" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "echo" ], + [ "text", " " ], + [ "string", "\"http://github.com/$repo/pull/new/${branch##refs/heads/}\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "else" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "constant.language", "exit" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "fi" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ 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 index 09a3ef99..525af9d4 100644 --- a/lib/ace/mode/_test/tokens_sql.json +++ b/lib/ace/mode/_test/tokens_sql.json @@ -1,54 +1,73 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "keyword", "SELECT" ], + [ "text", " " ], + [ "identifier", "city" ], + [ "text", ", " ], + [ "support.function", "COUNT" ], + [ "paren.lparen", "(" ], + [ "identifier", "id" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "keyword", "AS" ], + [ "text", " " ], + [ "identifier", "users_count" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "FROM" ], + [ "text", " " ], + [ "identifier", "users" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "WHERE" ], + [ "text", " " ], + [ "identifier", "group_name" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "'salesman'" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "AND" ], + [ "text", " " ], + [ "identifier", "created" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "string", "'2011-05-21'" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "GROUP" ], + [ "text", " " ], + [ "keyword", "BY" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 66ebae75..ed1beb9b 100644 --- a/lib/ace/mode/_test/tokens_svg.json +++ b/lib/ace/mode/_test/tokens_svg.json @@ -1,684 +1,931 @@ -[[ - "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 +[ + { + "state": "tag_embed_attribute_list", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "svg" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "width" ], + [ "keyword.operator", "=" ], + [ "string", "\"800\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "height" ], + [ "keyword.operator", "=" ], + [ "string", "\"600\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://www.w3.org/2000/svg\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "onload" ], + [ "keyword.operator", "=" ], + [ "string", "\"StartAnimation(evt)\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "title" ], + [ "meta.tag", ">" ], + [ "text", "Test Tube Progress Bar" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "desc" ], + [ "meta.tag", ">" ], + [ "text", "Created for the Web Directions SVG competition" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "script" ], + [ "text", " " ], + [ "entity.other.attribute-name", "type" ], + [ "keyword.operator", "=" ], + [ "string", "\"text/ecmascript\"" ], + [ "meta.tag", ">" ], + [ "keyword.operator", "<" ], + [ "keyword.operator", "!" ], + [ "paren.lparen", "[" ], + [ "identifier", "CDATA" ], + [ "paren.lparen", "[" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "0" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "timer_increment" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "1" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "max_time" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "constant.numeric", "100" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "hickory" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "dickory" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "dock" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "var" ], + [ "text", " " ], + [ "identifier", "i" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-start", + "data": [] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "function" ], + [ "text", " " ], + [ "entity.name.function", "StartAnimation" ], + [ "paren.lparen", "(" ], + [ "variable.parameter", "evt" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "hickory" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "evt" ], + [ "punctuation.operator", "." ], + [ "identifier", "target" ], + [ "punctuation.operator", "." ], + [ "identifier", "ownerDocument" ], + [ "punctuation.operator", "." ], + [ "support.function.dom", "getElementById" ], + [ "paren.lparen", "(" ], + [ "string", "\"hickory\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "dickory" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "evt" ], + [ "punctuation.operator", "." ], + [ "identifier", "target" ], + [ "punctuation.operator", "." ], + [ "identifier", "ownerDocument" ], + [ "punctuation.operator", "." ], + [ "support.function.dom", "getElementById" ], + [ "paren.lparen", "(" ], + [ "string", "\"dickory\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "dock" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "evt" ], + [ "punctuation.operator", "." ], + [ "identifier", "target" ], + [ "punctuation.operator", "." ], + [ "identifier", "ownerDocument" ], + [ "punctuation.operator", "." ], + [ "support.function.dom", "getElementById" ], + [ "paren.lparen", "(" ], + [ "string", "\"dock\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-start", + "data": [] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "ShowAndGrowElement" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "storage.type", "function" ], + [ "text", " " ], + [ "entity.name.function", "ShowAndGrowElement" ], + [ "paren.lparen", "(" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", "+" ], + [ "text", " " ], + [ "identifier", "timer_increment" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "identifier", "max_time" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "keyword", "return" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "comment", "// Scale the text string gradually until it is 20 times larger" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "js-start", + "data": [] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", "<" ], + [ "text", " " ], + [ "constant.numeric", "30" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "hickory" ], + [ "punctuation.operator", "." ], + [ "support.function.dom", "setAttribute" ], + [ "paren.lparen", "(" ], + [ "string", "\"display\"" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "string", "\"\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "js-start", + "data": [] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "constant.numeric", "30" ], + [ "text", " " ], + [ "keyword.operator", "&" ], + [ "keyword.operator", "&" ], + [ "text", " " ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", "<" ], + [ "text", " " ], + [ "constant.numeric", "66" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "dickory" ], + [ "punctuation.operator", "." ], + [ "support.function.dom", "setAttribute" ], + [ "paren.lparen", "(" ], + [ "string", "\"display\"" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "string", "\"\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "(" ], + [ "identifier", "timevalue" ], + [ "text", " " ], + [ "keyword.operator", ">" ], + [ "text", " " ], + [ "constant.numeric", "66" ], + [ "paren.rparen", ")" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "text", " " ], + [ "identifier", "dock" ], + [ "punctuation.operator", "." ], + [ "support.function.dom", "setAttribute" ], + [ "paren.lparen", "(" ], + [ "string", "\"display\"" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "string", "\"\"" ], + [ "paren.rparen", ")" ], + [ "punctuation.operator", ";" ] + ] + }, + { + "state": "js-regex_allowed", + "data": [ + [ "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", ";" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "js-start", + "data": [] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "comment", "// Call ShowAndGrowElement again milliseconds later." ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "identifier", "setTimeout" ], + [ "paren.lparen", "(" ], + [ "string", "\"ShowAndGrowElement()\"" ], + [ "punctuation.operator", "," ], + [ "text", " " ], + [ "identifier", "timer_increment" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "}" ] + ] + }, + { + "state": "js-start", + "data": [ + [ "text", " " ], + [ "variable.language", "window" ], + [ "punctuation.operator", "." ], + [ "identifier", "ShowAndGrowElement" ], + [ "text", " " ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "identifier", "ShowAndGrowElement" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "paren.rparen", "]" ], + [ "paren.rparen", "]" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "rect" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "fill" ], + [ "keyword.operator", "=" ], + [ "string", "\"#2e3436\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "fill-rule" ], + [ "keyword.operator", "=" ], + [ "string", "\"nonzero\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "stroke-width" ], + [ "keyword.operator", "=" ], + [ "string", "\"3\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "y" ], + [ "keyword.operator", "=" ], + [ "string", "\"0\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "x" ], + [ "keyword.operator", "=" ], + [ "string", "\"0\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "height" ], + [ "keyword.operator", "=" ], + [ "string", "\"600\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "width" ], + [ "keyword.operator", "=" ], + [ "string", "\"800\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"rect3590\"" ], + [ "meta.tag", "/>" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "text" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "style" ], + [ "keyword.operator", "=" ], + [ "string", "\"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\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "x" ], + [ "keyword.operator", "=" ], + [ "string", "\"50\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "y" ], + [ "keyword.operator", "=" ], + [ "string", "\"350\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"hickory\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "display" ], + [ "keyword.operator", "=" ], + [ "string", "\"none\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " Hickory," ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "text" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "style" ], + [ "keyword.operator", "=" ], + [ "string", "\"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\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "x" ], + [ "keyword.operator", "=" ], + [ "string", "\"50\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "y" ], + [ "keyword.operator", "=" ], + [ "string", "\"350\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"dickory\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "display" ], + [ "keyword.operator", "=" ], + [ "string", "\"none\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " dickory," ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "text" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "style" ], + [ "keyword.operator", "=" ], + [ "string", "\"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\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "x" ], + [ "keyword.operator", "=" ], + [ "string", "\"50\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "y" ], + [ "keyword.operator", "=" ], + [ "string", "\"350\"" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "id" ], + [ "keyword.operator", "=" ], + [ "string", "\"dock\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "display" ], + [ "keyword.operator", "=" ], + [ "string", "\"none\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " dock!" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_tcl.json b/lib/ace/mode/_test/tokens_tcl.json index 6a032ddc..2f13af3e 100644 --- a/lib/ace/mode/_test/tokens_tcl.json +++ b/lib/ace/mode/_test/tokens_tcl.json @@ -1,385 +1,536 @@ -[[ - "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 +[ + { + "state": "commandItem", + "data": [] + }, + { + "state": "commandItem", + "data": [ + [ "keyword", "proc" ], + [ "text", " " ], + [ "identifier", "dijkstra" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "keyword", "graph" ], + [ "text", " " ], + [ "identifier", "origin" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "comment", "# Initialize" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " " ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "for" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "keyword", "vertex" ], + [ "text", " " ], + [ "identifier", "distmap" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "graph" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "set" ], + [ "text", " " ], + [ "identifier", "dist" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "vertex" ], + [ "text", " " ], + [ "identifier", "Inf" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "set" ], + [ "text", " " ], + [ "identifier", "path" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "vertex" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "text", "}" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " }" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "set" ], + [ "text", " " ], + [ "identifier", "dist" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "origin" ], + [ "text", " 0" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "set" ], + [ "text", " " ], + [ "identifier", "path" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "origin" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "keyword", "list" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "origin" ], + [ "paren.rparen", "]" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " " ], + [ "keyword", "while" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "text", "[" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "size" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "graph" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "comment", "# Find unhandled node with least weight" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "keyword", "set" ], + [ "text", " " ], + [ "identifier", "d" ], + [ "text", " " ], + [ "identifier", "Inf" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "for" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "keyword", "uu" ], + [ "text", " " ], + [ "support.function", "-" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "graph" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "d" ], + [ "text", " " ], + [ "support.function", ">" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "keyword", "set" ], + [ "text", " " ], + [ "identifier", "dd" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "get" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "dist" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "uu" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "keyword", "set" ], + [ "text", " " ], + [ "identifier", "u" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "uu" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "keyword", "set" ], + [ "text", " " ], + [ "identifier", "d" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "dd" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t }" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t}" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "comment", "# No such node; graph must be disconnected" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "d" ], + [ "text", " " ], + [ "support.function", "==" ], + [ "text", " " ], + [ "identifier", "Inf" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "identifier", "break" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "commentfollow", + "data": [ + [ "text", "\t" ], + [ "comment", "# Update the weights for nodes\\" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "\t lead to by the node we've picked" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "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.instancce", "$" ], + [ "variable.instancce", "graph" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "u" ], + [ "paren.rparen", "]" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t " ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "text", "[" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "exists" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "graph" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "v" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t" ], + [ "keyword", "set" ], + [ "text", " " ], + [ "identifier", "alt" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "keyword", "expr" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "d" ], + [ "text", " " ], + [ "support.function", "+" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "dd" ], + [ "paren.rparen", "}" ], + [ "paren.rparen", "]" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t\t" ], + [ "keyword", "if" ], + [ "text", " " ], + [ "paren.lparen", "{" ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "alt" ], + [ "text", " " ], + [ "support.function", "<" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "get" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "dist" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "v" ], + [ "paren.rparen", "]" ], + [ "paren.rparen", "}" ], + [ "text", " " ], + [ "paren.lparen", "{" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t " ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "set" ], + [ "text", " " ], + [ "identifier", "dist" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "v" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "alt" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t\t " ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "set" ], + [ "text", " " ], + [ "identifier", "path" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "v" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "keyword", "list" ], + [ "text", " " ], + [ "support.function", "{*}" ], + [ "paren.lparen", "[" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "get" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "path" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "u" ], + [ "paren.rparen", "]" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "v" ], + [ "paren.rparen", "]" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t\t}" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t }" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "\t}" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "comment", "# Remove chosen node from graph still to be handled" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "\t" ], + [ "keyword", "dict" ], + [ "text", " " ], + [ "identifier", "unset" ], + [ "text", " " ], + [ "identifier", "graph" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "u" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", " }" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "keyword", "return" ], + [ "text", " " ], + [ "paren.lparen", "[" ], + [ "keyword", "list" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "dist" ], + [ "text", " " ], + [ "variable.instancce", "$" ], + [ "variable.instancce", "path" ], + [ "paren.rparen", "]" ] + ] + }, + { + "state": "commandItem", + "data": [ + [ "text", "}" ] + ] + } +] \ 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 index fff7ef42..b74923cd 100644 --- a/lib/ace/mode/_test/tokens_text.json +++ b/lib/ace/mode/_test/tokens_text.json @@ -1,29 +1,58 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "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." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "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 index 59000ce3..beb947bc 100644 --- a/lib/ace/mode/_test/tokens_textile.json +++ b/lib/ace/mode/_test/tokens_textile.json @@ -1,113 +1,195 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "markup.heading.1", "h1" ], + [ "keyword", ". " ], + [ "text", "Textile document" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "h2" ], + [ "keyword", ". " ], + [ "text", "Heading Two" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "markup.heading.3", "h3" ], + [ "keyword", ". " ], + [ "text", "A two-line" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " header" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "markup.heading.2", "h2" ], + [ "keyword", ". " ], + [ "text", "Another two-line" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "header" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "Paragraph:" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "one, two," ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "thee lines!" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "markup.heading", "p" ], + [ "keyword", "(" ], + [ "string", "classone" ], + [ "text", " " ], + [ "string", "two" ], + [ "text", " " ], + [ "string", "three" ], + [ "keyword", ")" ], + [ "keyword", ". " ], + [ "text", "This is a paragraph with classes" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "markup.heading", "p" ], + [ "keyword", "(" ], + [ "keyword", "#" ], + [ "string", "id" ], + [ "keyword", ")" ], + [ "keyword", ". " ], + [ "text", "(one with an id)" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "markup.heading", "p" ], + [ "keyword", "(" ], + [ "string", "one" ], + [ "text", " " ], + [ "string", "two" ], + [ "text", " " ], + [ "string", "three" ], + [ "keyword", "#" ], + [ "string", "my_id" ], + [ "keyword", ")" ], + [ "keyword", ". " ], + [ "text", "..classes + id" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "*" ], + [ "text", " Unordered list" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "**" ], + [ "text", " sublist" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "*" ], + [ "text", " back again!" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "**" ], + [ "text", " sublist again.." ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "#" ], + [ "text", " ordered" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "bg. Blockquote!" ] + ] + }, + { + "state": "start", + "data": [ + [ "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 index 728be4db..b7c9dcfd 100644 --- a/lib/ace/mode/_test/tokens_xml.json +++ b/lib/ace/mode/_test/tokens_xml.json @@ -1,43 +1,705 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "xml-pe", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "query" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns:yahoo" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://www.yahooapis.com/v1/base.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:count" ], + [ "keyword.operator", "=" ], + [ "string", "\"7\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:created" ], + [ "keyword.operator", "=" ], + [ "string", "\"2011-10-11T08:40:23Z\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "diagnostics" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "publiclyCallable" ], + [ "meta.tag", ">" ], + [ "text", "true" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "url" ], + [ "text", " " ], + [ "entity.other.attribute-name", "execution-start-time" ], + [ "keyword.operator", "=" ], + [ "string", "\"0\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "execution-stop-time" ], + [ "keyword.operator", "=" ], + [ "string", "\"25\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "execution-time" ], + [ "keyword.operator", "=" ], + [ "string", "\"25\"" ], + [ "meta.tag", ">" ], + [ "text", "" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "user-time" ], + [ "meta.tag", ">" ], + [ "text", "26" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "service-time" ], + [ "meta.tag", ">" ], + [ "text", "25" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "build-version" ], + [ "meta.tag", ">" ], + [ "text", "21978" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ], + [ "text", " " ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "results" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "place" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xml:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:uri" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/place/24865670\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "woeid" ], + [ "meta.tag", ">" ], + [ "text", "24865670" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "placeTypeName" ], + [ "text", " " ], + [ "entity.other.attribute-name", "code" ], + [ "keyword.operator", "=" ], + [ "string", "\"29\"" ], + [ "meta.tag", ">" ], + [ "text", "Continent" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "name" ], + [ "meta.tag", ">" ], + [ "text", "Africa" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "place" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xml:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:uri" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/place/24865675\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "woeid" ], + [ "meta.tag", ">" ], + [ "text", "24865675" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "placeTypeName" ], + [ "text", " " ], + [ "entity.other.attribute-name", "code" ], + [ "keyword.operator", "=" ], + [ "string", "\"29\"" ], + [ "meta.tag", ">" ], + [ "text", "Continent" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "name" ], + [ "meta.tag", ">" ], + [ "text", "Europe" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "place" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xml:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:uri" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/place/24865673\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "woeid" ], + [ "meta.tag", ">" ], + [ "text", "24865673" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "placeTypeName" ], + [ "text", " " ], + [ "entity.other.attribute-name", "code" ], + [ "keyword.operator", "=" ], + [ "string", "\"29\"" ], + [ "meta.tag", ">" ], + [ "text", "Continent" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "name" ], + [ "meta.tag", ">" ], + [ "text", "South America" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "place" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xml:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:uri" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/place/28289421\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "woeid" ], + [ "meta.tag", ">" ], + [ "text", "28289421" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "placeTypeName" ], + [ "text", " " ], + [ "entity.other.attribute-name", "code" ], + [ "keyword.operator", "=" ], + [ "string", "\"29\"" ], + [ "meta.tag", ">" ], + [ "text", "Continent" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "name" ], + [ "meta.tag", ">" ], + [ "text", "Antarctic" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "place" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xml:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:uri" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/place/24865671\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "woeid" ], + [ "meta.tag", ">" ], + [ "text", "24865671" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "placeTypeName" ], + [ "text", " " ], + [ "entity.other.attribute-name", "code" ], + [ "keyword.operator", "=" ], + [ "string", "\"29\"" ], + [ "meta.tag", ">" ], + [ "text", "Continent" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "name" ], + [ "meta.tag", ">" ], + [ "text", "Asia" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "place" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xml:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:uri" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/place/24865672\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "woeid" ], + [ "meta.tag", ">" ], + [ "text", "24865672" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "placeTypeName" ], + [ "text", " " ], + [ "entity.other.attribute-name", "code" ], + [ "keyword.operator", "=" ], + [ "string", "\"29\"" ], + [ "meta.tag", ">" ], + [ "text", "Continent" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "name" ], + [ "meta.tag", ">" ], + [ "text", "North America" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "tag_embed_attribute_list", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "place" ], + [ "text", " " ], + [ "entity.other.attribute-name", "xmlns" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/schema.rng\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "entity.other.attribute-name", "xml:lang" ], + [ "keyword.operator", "=" ], + [ "string", "\"en-US\"" ], + [ "text", " " ], + [ "entity.other.attribute-name", "yahoo:uri" ], + [ "keyword.operator", "=" ], + [ "string", "\"http://where.yahooapis.com/v1/place/55949070\"" ], + [ "meta.tag", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "woeid" ], + [ "meta.tag", ">" ], + [ "text", "55949070" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "placeTypeName" ], + [ "text", " " ], + [ "entity.other.attribute-name", "code" ], + [ "keyword.operator", "=" ], + [ "string", "\"29\"" ], + [ "meta.tag", ">" ], + [ "text", "Continent" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "<" ], + [ "meta.tag.tag-name", "name" ], + [ "meta.tag", ">" ], + [ "text", "Australia" ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "meta.tag", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "meta.tag", "" ] + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_xquery.json b/lib/ace/mode/_test/tokens_xquery.json index aaf9ab9b..62d9c927 100644 --- a/lib/ace/mode/_test/tokens_xquery.json +++ b/lib/ace/mode/_test/tokens_xquery.json @@ -1,44 +1,64 @@ -[[ - "[\"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 +[ + { + "state": "start", + "data": [ + [ "keyword", "xquery" ], + [ "text", " " ], + [ "keyword", "version" ], + [ "text", " " ], + [ "string", "\"1.0\"" ], + [ "text", ";" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "keyword", "let" ], + [ "text", " " ], + [ "variable", "$message" ], + [ "text", " :" ], + [ "keyword.operator", "=" ], + [ "text", " " ], + [ "string", "\"Hello World!\"" ] + ] + }, + { + "state": "start", + "data": [ + [ "keyword", "return" ], + [ "text", " <" ], + [ "meta.tag", "results" ], + [ "text", ">" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " <" ], + [ "meta.tag", "message" ], + [ "text", ">" ], + [ "lparen", "{" ], + [ "variable", "$message" ], + [ "rparen", "}" ], + [ "text", "" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", "" ] + ] + }, + { + "state": "start", + "data": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_yaml.json b/lib/ace/mode/_test/tokens_yaml.json index 7c9b45f3..9a8c1ce7 100644 --- a/lib/ace/mode/_test/tokens_yaml.json +++ b/lib/ace/mode/_test/tokens_yaml.json @@ -1,150 +1,260 @@ -[[ - "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 +[ + { + "state": "start", + "data": [ + [ "comment", "# This sample document was taken from wikipedia:" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "# http://en.wikipedia.org/wiki/YAML#Sample_document" ] + ] + }, + { + "state": "start", + "data": [ + [ "comment", "---" ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "receipt:" ], + [ "text", " Oz-Ware Purchase Invoice" ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "date:" ], + [ "text", " " ], + [ "constant.numeric", "2007" ], + [ "constant.numeric", "-08" ], + [ "constant.numeric", "-06" ] + ] + }, + { + "state": "start", + "data": [ + [ "identifier", "customer:" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "given:" ], + [ "text", " Dorothy" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "family:" ], + [ "text", " Gale" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "identifier", "items:" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " - " ], + [ "identifier", "part_no:" ], + [ "text", " " ], + [ "string", "'A4786'" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "descrip:" ], + [ "text", " Water Bucket " ], + [ "paren.lparen", "(" ], + [ "text", "Filled" ], + [ "paren.rparen", ")" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "price:" ], + [ "text", " " ], + [ "constant.numeric", "1.47" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "quantity:" ], + [ "text", " " ], + [ "constant.numeric", "4" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", " - " ], + [ "identifier", "part_no:" ], + [ "text", " " ], + [ "string", "'E1628'" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "descrip:" ], + [ "text", " High Heeled " ], + [ "string", "\"Ruby\"" ], + [ "text", " Slippers" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "size:" ], + [ "text", " " ], + [ "constant.numeric", "8" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "price:" ], + [ "text", " " ], + [ "constant.numeric", "100.27" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "quantity:" ], + [ "text", " " ], + [ "constant.numeric", "1" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "bill-" ], + [ "identifier", "to:" ], + [ "text", " " ], + [ "variable", "&id001" ] + ] + }, + { + "state": "qqstring", + "data": [ + [ "text", " " ], + [ "identifier", "street:" ], + [ "text", " " ], + [ "string", "|" ] + ] + }, + { + "state": "qqstring", + "data": [ + [ "string", " 123 Tornado Alley" ] + ] + }, + { + "state": "qqstring", + "data": [ + [ "string", " Suite 16" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "city:" ], + [ "text", " East Centerville" ] + ] + }, + { + "state": "start", + "data": [ + [ "text", " " ], + [ "identifier", "state:" ], + [ "text", " KS" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "start", + "data": [ + [ "text", "ship-" ], + [ "identifier", "to:" ], + [ "text", " " ], + [ "variable", "*id001" ] + ] + }, + { + "state": "start", + "data": [] + }, + { + "state": "qqstring", + "data": [ + [ "identifier", "specialDelivery:" ], + [ "text", " " ], + [ "string", ">" ] + ] + }, + { + "state": "qqstring", + "data": [ + [ "string", " Follow the Yellow Brick" ] + ] + }, + { + "state": "qqstring", + "data": [ + [ "string", " Road to the Emerald City." ] + ] + }, + { + "state": "qqstring", + "data": [ + [ "string", " Pay no attention to the" ] + ] + }, + { + "state": "qqstring", + "data": [ + [ "string", " man behind the curtain." ] + ] + }, + { + "state": "qqstring", + "data": [] + } +] \ No newline at end of file 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 index 894d9763..b4e83f67 100644 --- a/lib/ace/mode/asciidoc.js +++ b/lib/ace/mode/asciidoc.js @@ -33,18 +33,19 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules; var AsciidocFoldMode = require("./folding/asciidoc").FoldMode; var Mode = function() { - this.HighlightRules = AsciidocHighlightRules; + var highlighter = new AsciidocHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); 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); @@ -57,7 +58,6 @@ oop.inherits(Mode, TextMode); 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 index c0d1a305..032cadf4 100644 --- a/lib/ace/mode/asciidoc_highlight_rules.js +++ b/lib/ace/mode/asciidoc_highlight_rules.js @@ -96,9 +96,9 @@ var AsciidocHighlightRules = function() { // 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}/}, + regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/, merge: true}, + {token: "keyword", regex: /<<[\w\d\-$]+,?|>>/, merge: true}, + {token: "constant.character", regex: /\({2,3}.*?\){2,3}/, merge: true}, // Anchor {token: "keyword", regex: /\[\[.+?\]\]/}, // bibliography @@ -122,26 +122,26 @@ var AsciidocHighlightRules = function() { "listingBlock": [ {token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} + {token: "literal", regex: '[^<]+', merge: true}, + {token: "literal", regex: '<', merge: true} ], "literalBlock": [ {token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} + {token: "literal", regex: '[^<]+', merge: true}, + {token: "literal", regex: '<', merge: true} ], "passthroughBlock": [ {token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, + {token: "literal", regex: identifierRe + "|\\d+", merge: true}, {include: "macros"}, - {token: "literal", regex: "."} + {token: "literal", regex: ".", merge: true} ], "smallPassthrough": [ {token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, + {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock", merge: true}, + {token: "literal", regex: identifierRe + "|\\d+", merge: true}, {include: "macros"} ], 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/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..ccacd7ad 100644 --- a/lib/ace/mode/behaviour/cstyle.js +++ b/lib/ace/mode/behaviour/cstyle.js @@ -41,53 +41,98 @@ var SAFE_INSERT_IN_TOKENS = var SAFE_INSERT_BEFORE_TOKENS = ["text", "paren.rparen", "punctuation.operator", "comment"]; -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 autoInsertedBrackets = 0; +var autoInsertedRow = -1; +var autoInsertedLineEnd = ""; +var maybeInsertedBrackets = 0; +var maybeInsertedRow = -1; +var maybeInsertedLineStart = ""; +var maybeInsertedLineEnd = ""; -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { +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, autoInsertedLineEnd[0])) + autoInsertedBrackets = 0; + autoInsertedRow = cursor.row; + autoInsertedLineEnd = bracket + line.substr(cursor.column); + autoInsertedBrackets++; + }; + + CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isMaybeInsertedClosing(cursor, line)) + maybeInsertedBrackets = 0; + maybeInsertedRow = cursor.row; + maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; + maybeInsertedLineEnd = line.substr(cursor.column); + maybeInsertedBrackets++; + }; + + CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { + return autoInsertedBrackets > 0 && + cursor.row === autoInsertedRow && + bracket === autoInsertedLineEnd[0] && + line.substr(cursor.column) === autoInsertedLineEnd; + }; + + CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { + return maybeInsertedBrackets > 0 && + cursor.row === maybeInsertedRow && + line.substr(cursor.column) === maybeInsertedLineEnd && + line.substr(0, cursor.column) == maybeInsertedLineStart; + }; + + CstyleBehaviour.popAutoInsertedClosing = function() { + autoInsertedLineEnd = autoInsertedLineEnd.substr(1); + autoInsertedBrackets--; + }; + + CstyleBehaviour.clearMaybeInsertedClosing = function() { + maybeInsertedBrackets = 0; + maybeInsertedRow = -1; + }; + + this.add("braces", "insertion", function (state, action, editor, session, text) { var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); if (text == '{') { - initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '{', '}'); + return { + text: '{' + selected + '}', + selection: false + }; } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { + if (/[\]\}\)]/.test(line[cursor.column])) { CstyleBehaviour.recordAutoInsert(editor, session, "}"); return { text: '{}', @@ -102,7 +147,6 @@ var CstyleBehaviour = function() { } } } else if (text == '}') { - initContext(editor); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == '}') { var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); @@ -115,57 +159,51 @@ var CstyleBehaviour = function() { } } } else if (text == "\n" || text == "\r\n") { - initContext(editor); var closing = ""; if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); + closing = lang.stringRepeat("}", maybeInsertedBrackets); CstyleBehaviour.clearMaybeInsertedClosing(); } var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); + if (rightChar == '}' || closing !== "") { + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column}, '}'); 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, cursor.column), session.getTabString()); + var next_indent = this.$getIndent(line); + + return { + text: '\n' + indent + '\n' + next_indent + closing, + selection: [1, indent.length, 1, indent.length] + }; + } } }); - this.add("braces", "deletion", function(state, action, editor, session, range) { + 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--; + 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, '(', ')'); + return { + text: '(' + selected + ')', + selection: false + }; } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { CstyleBehaviour.recordAutoInsert(editor, session, ")"); return { @@ -174,7 +212,6 @@ var CstyleBehaviour = function() { }; } } 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); @@ -191,10 +228,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,13 +240,15 @@ 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, '[', ']'); + return { + text: '[' + selected + ']', + selection: false + }; } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { CstyleBehaviour.recordAutoInsert(editor, session, "]"); return { @@ -219,7 +257,6 @@ var CstyleBehaviour = function() { }; } } 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); @@ -236,10 +273,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 +285,72 @@ 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) { + 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)))) { + if (!CstyleBehaviour.isSaneInsertion(editor, session)) + return; + 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 +359,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..c15aa8b4 100644 --- a/lib/ace/mode/behaviour/html.js +++ b/lib/ace/mode/behaviour/html.js @@ -33,13 +33,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..0d03b763 100644 --- a/lib/ace/mode/behaviour/xml.js +++ b/lib/ace/mode/behaviour/xml.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -33,171 +33,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..42342d28 100644 --- a/lib/ace/mode/c9search.js +++ b/lib/ace/mode/c9search.js @@ -33,12 +33,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 +60,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..df31112b 100644 --- a/lib/ace/mode/c9search_highlight_rules.js +++ b/lib/ace/mode/c9search_highlight_rules.js @@ -32,15 +32,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 +41,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 +56,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..0776ef97 100644 --- a/lib/ace/mode/c_cpp.js +++ b/lib/ace/mode/c_cpp.js @@ -33,6 +33,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 +41,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 +118,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..7ab22467 100644 --- a/lib/ace/mode/c_cpp_highlight_rules.js +++ b/lib/ace/mode/c_cpp_highlight_rules.js @@ -1,3 +1,33 @@ +/* ***** 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"; @@ -6,7 +36,7 @@ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocComme 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 cFunctions = exports.cFunctions = "\\s*\\bhypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len)))\\b" var c_cppHighlightRules = function() { @@ -18,13 +48,12 @@ var c_cppHighlightRules = function() { 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" + "class|wchar_t|template" ); 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" + "const|extern|register|restrict|static|volatile|inline|private:|" + + "protected:|public:|friend|explicit|virtual|export|mutable|typename" ); var keywordOperators = ( @@ -33,7 +62,7 @@ var c_cppHighlightRules = function() { ); var builtinConstants = ( - "NULL|true|false|TRUE|FALSE|nullptr" + "NULL|true|false|TRUE|FALSE" ); var keywordMapper = this.$keywords = this.createKeywordMapper({ @@ -50,16 +79,16 @@ var c_cppHighlightRules = function() { // 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 +96,7 @@ var c_cppHighlightRules = function() { regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' }, { token : "string", // multi line string start + merge : true, regex : '["].*\\\\$', next : "qqstring" }, { @@ -74,21 +104,21 @@ 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 : "keyword", // pre-compiler directivs + regex : "(?:#include|#import|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)" }, { token : "support.function.C99.c", regex : cFunctions @@ -119,29 +149,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,38 +170,9 @@ 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 : '.+' } ] }; 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..581350b0 100644 --- a/lib/ace/mode/clojure.js +++ b/lib/ace/mode/clojure.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -33,84 +33,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 +106,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..bbcfe158 100644 --- a/lib/ace/mode/clojure_highlight_rules.js +++ b/lib/ace/mode/clojure_highlight_rules.js @@ -129,6 +129,10 @@ var ClojureHighlightRules = function() { { token : "comment", regex : ";.*$" + }, { + token : "comment", // multi line comment + regex : "^=begin$", + next : "comment" }, { token : "keyword", //parens regex : "[\\(|\\)]" @@ -170,20 +174,33 @@ var ClojureHighlightRules = function() { regex : '"', next: "string" }, { - token : "constant", // symbol - regex : /:[^()\[\]{}'"\^%`,;\s]+/ + token : "string", // symbol + regex : /:[\w*+!\-_?:\/]+/ }, { 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..85b1e918 100644 --- a/lib/ace/mode/coffee.js +++ b/lib/ace/mode/coffee.js @@ -31,6 +31,7 @@ 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 +41,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 +50,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 +96,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..1b7ae57f 100644 --- a/lib/ace/mode/coffee/coffee-script.js +++ b/lib/ace/mode/coffee/coffee-script.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -27,23 +27,17 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ***** 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 +49,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..88473f54 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) 2009-2012 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.3.3 - var buildLocationData, extend, flatten, last, repeat, syntaxErrorToString, _ref; + var extend, flatten, _ref; exports.starts = function(string, literal, start) { return literal === string.substr(start, literal.length); @@ -39,19 +38,6 @@ 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 = []; @@ -110,7 +96,7 @@ 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]; }; @@ -125,147 +111,5 @@ define(function(require, exports, module) { 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..ec661c28 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) 2009-2012 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,43 +21,42 @@ * 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.3.3 - 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() { + function Lexer() {} Lexer.prototype.tokenize = function(code, opts) { - var consumed, i, tag, _ref2; + var i, tag; if (opts == null) { opts = {}; } - this.literate = opts.literate; + 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()) { @@ -69,34 +68,17 @@ define(function(require, exports, module) { 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; + 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 +97,7 @@ define(function(require, exports, module) { } else { tag = 'RELATION'; if (this.value() === '!') { - poppedToken = this.tokens.pop(); + this.tokens.pop(); id = '!' + id; } } @@ -155,13 +137,9 @@ 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]; - } + this.token(tag, id); if (colon) { - colonOffset = input.lastIndexOf(':'); - this.token(':', ':', colonOffset, colon.length); + this.token(':', ':'); } return input.length; }; @@ -183,39 +161,41 @@ define(function(require, exports, module) { } lexedLength = number.length; if (octalLiteral = /^0o([0-7]+)/.exec(number)) { - number = '0x' + parseInt(octalLiteral[1], 8).toString(16); + number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16); } if (binaryLiteral = /^0b([01]+)/.exec(number)) { - number = '0x' + parseInt(binaryLiteral[1], 2).toString(16); + number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16); } - 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) { - 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 (!(string = this.balancedString(this.chunk, '"'))) { + return 0; + } + if (0 < string.indexOf('#{', 1)) { + this.interpolateString(string.slice(1, -1)); + } else { + this.token('STRING', this.escapeLines(string)); + } + break; + default: + return 0; } if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) { this.error("octal escape sequences " + string + " are not allowed"); } + this.line += count(string, '\n'); return string.length; }; @@ -232,13 +212,12 @@ 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; }; @@ -251,9 +230,10 @@ define(function(require, exports, module) { 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,7 +242,8 @@ 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)); + this.line += count(script, '\n'); return script.length; }; @@ -273,6 +254,7 @@ define(function(require, exports, module) { } if (match = HEREGEX.exec(this.chunk)) { length = this.heregexToken(match); + this.line += count(match[0], '\n'); return length; } prev = last(this.tokens); @@ -289,60 +271,49 @@ define(function(require, exports, module) { if (regex === '//') { regex = '/(?:)/'; } - this.token('REGEX', "" + regex + flags, 0, match.length); + 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'))) { + } else { + if (!(value = value.replace(HEREGEX_OMIT, ''))) { continue; } value = value.replace(/\\/g, '\\\\'); - token[0] = 'STRING'; - token[1] = this.makeString(value, '"', true); - tokens.push(token); - } else { - this.error("Unexpected " + tag); + 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); + (_ref5 = this.tokens).push.apply(_ref5, tokens); if (flags) { - flagsOffset = heregex.lastIndexOf(flags); - this.token(',', ',', flagsOffset, 0); - this.token('STRING', '"' + flags + '"', flagsOffset, flags.length); + this.tokens.push([',', ','], ['STRING', '"' + flags + '"']); } - this.token(')', ')', heregex.length - 1, 0); + this.token(')', ')'); return heregex.length; }; @@ -352,6 +323,7 @@ define(function(require, exports, module) { return 0; } indent = match[0]; + this.line += count(indent, '\n'); this.seenFor = false; size = indent.length - 1 - indent.lastIndexOf('\n'); noNewlines = this.unfinished(); @@ -359,7 +331,7 @@ define(function(require, exports, module) { if (noNewlines) { this.suppressNewlines(); } else { - this.newlineToken(0); + this.newlineToken(); } return indent.length; } @@ -369,26 +341,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,11 +367,11 @@ 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) { @@ -415,7 +381,7 @@ define(function(require, exports, module) { this.tokens.pop(); } if (!(this.tag() === 'TERMINATOR' || noNewlines)) { - this.token('TERMINATOR', '\n', outdentLength, 0); + this.token('TERMINATOR', '\n'); } return this; }; @@ -436,12 +402,12 @@ 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); + this.token('TERMINATOR', '\n'); } return this; }; @@ -526,7 +492,7 @@ define(function(require, exports, module) { if (HEREDOC_ILLEGAL.test(doc)) { this.error("block comment cannot contain \"*/\", starting"); } - if (doc.indexOf('\n') < 0) { + if (doc.indexOf('\n') <= 0) { return doc; } } else { @@ -615,14 +581,11 @@ 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; + 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, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength; - offsetInChunk = offsetInChunk || 0; - strOffset = strOffset || 0; - lexedLength = lexedLength || str.length; + heredoc = options.heredoc, regex = options.regex; tokens = []; pi = 0; i = -1; @@ -635,24 +598,22 @@ define(function(require, exports, module) { continue; } if (pi < i) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi)); + 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]); } @@ -661,49 +622,33 @@ define(function(require, exports, module) { pi = i + 1; } if ((i > pi && pi < str.length)) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi)); + tokens.push(['NEOSTRING', str.slice(pi)]); } if (regex) { return tokens; } if (!tokens.length) { - return this.token('STRING', '""', offsetInChunk, lexedLength); + return this.token('STRING', '""'); } if (tokens[0][0] !== 'NEOSTRING') { - tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk)); + tokens.unshift(['', '']); } if (interpolated = tokens.length > 1) { - this.token('(', '(', offsetInChunk, 0); + this.token('(', '('); } for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) { - token = tokens[i]; - tag = token[0], value = token[1]; + _ref3 = tokens[i], tag = _ref3[0], value = _ref3[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 - }; + 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); + this.token(')', ')'); } return tokens; }; @@ -721,48 +666,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 +682,19 @@ 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) { + body = body.replace(/\\([\s\S])/g, function(match, contents) { + if (contents === '\n' || contents === quote) { return contents; } else { return match; @@ -814,16 +704,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; @@ -867,33 +749,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; @@ -921,9 +801,9 @@ define(function(require, exports, module) { BOOL = ['TRUE', 'FALSE']; - NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--']; + NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']']; - NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']'); + NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING'); CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; diff --git a/lib/ace/mode/coffee/nodes.js b/lib/ace/mode/coffee/nodes.js index 52afdf2c..6808bf4e 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) 2009-2012 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.3.3 - 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, some, starts, unfoldSoak, utility, _ref, _ref1, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice; - - Error.stackTraceLimit = Infinity; + __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, some = _ref1.some; exports.extend = extend; - exports.addLocationDataFn = addLocationDataFn; - YES = function() { return true; }; @@ -62,43 +56,11 @@ 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() { + 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) { @@ -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,15 +119,21 @@ 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) { @@ -228,11 +188,10 @@ 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,46 +226,12 @@ 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); function Block(nodes) { @@ -354,12 +279,12 @@ define(function(require, exports, module) { }; 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,79 +305,72 @@ define(function(require, exports, module) { return this; }; - Block.prototype.compileToFragments = function(o, level) { + 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]; + for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { + exp = _ref2[i]; if (!(exp.unwrap() instanceof Comment)) { break; } @@ -463,24 +381,22 @@ 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); + code = this.compileWithDeclarations(o); if (o.bare) { - return fragments; + return code; } - return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n")); + 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]; @@ -495,7 +411,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); @@ -505,24 +421,22 @@ define(function(require, exports, module) { assigns = scope.hasAssignments; if (declars || assigns) { if (i) { - fragments.push(this.makeCode('\n')); + code += '\n'; } - fragments.push(this.makeCode("" + this.tab + "var ")); + code += "" + this.tab + "var "; if (declars) { - fragments.push(this.makeCode(scope.declaredVariables().join(', '))); + code += scope.declaredVariables().join(', '); } if (assigns) { if (declars) { - fragments.push(this.makeCode(",\n" + (this.tab + TAB))); + code += ",\n" + (this.tab + TAB); } - fragments.push(this.makeCode(scope.assignedVariables().join(",\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) { @@ -537,6 +451,7 @@ define(function(require, exports, module) { })(Base); exports.Literal = Literal = (function(_super) { + __extends(Literal, _super); function Literal(value) { @@ -576,10 +491,13 @@ define(function(require, exports, module) { }; Literal.prototype.compileNode = function(o) { - var answer, code, _ref2; + var code, _ref2; code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value; - answer = this.isStatement() ? "" + this.tab + code + ";" : code; - return [this.makeCode(answer)]; + if (this.isStatement()) { + return "" + this.tab + code + ";"; + } else { + return code; + } }; Literal.prototype.toString = function() { @@ -591,6 +509,7 @@ define(function(require, exports, module) { })(Base); exports.Undefined = (function(_super) { + __extends(Undefined, _super); function Undefined() { @@ -602,7 +521,11 @@ define(function(require, exports, module) { Undefined.prototype.isComplex = NO; Undefined.prototype.compileNode = function(o) { - return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')]; + if (o.level >= LEVEL_ACCESS) { + return '(void 0)'; + } else { + return 'void 0'; + } }; return Undefined; @@ -610,6 +533,7 @@ define(function(require, exports, module) { })(Base); exports.Null = (function(_super) { + __extends(Null, _super); function Null() { @@ -621,7 +545,7 @@ define(function(require, exports, module) { Null.prototype.isComplex = NO; Null.prototype.compileNode = function() { - return [this.makeCode("null")]; + return "null"; }; return Null; @@ -629,6 +553,7 @@ define(function(require, exports, module) { })(Base); exports.Bool = (function(_super) { + __extends(Bool, _super); Bool.prototype.isAssignable = NO; @@ -636,7 +561,7 @@ define(function(require, exports, module) { Bool.prototype.isComplex = NO; Bool.prototype.compileNode = function() { - return [this.makeCode(this.val)]; + return this.val; }; function Bool(val) { @@ -648,6 +573,7 @@ define(function(require, exports, module) { })(Base); exports.Return = Return = (function(_super) { + __extends(Return, _super); function Return(expr) { @@ -664,25 +590,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,6 +609,7 @@ define(function(require, exports, module) { })(Base); exports.Value = Value = (function(_super) { + __extends(Value, _super); function Value(base, props, tag) { @@ -715,16 +635,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 +648,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() { @@ -759,10 +667,6 @@ define(function(require, exports, module) { 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); }; @@ -786,11 +690,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; @@ -822,49 +721,53 @@ 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; } - _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 - }); + 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 false; - }; - })(this)(); + return new If(new Existence(fst), snd, { + soak: true + }); + } + return null; + })(); + return this.unfoldedSoak = result || false; }; return Value; @@ -872,6 +775,7 @@ define(function(require, exports, module) { })(Base); exports.Comment = Comment = (function(_super) { + __extends(Comment, _super); function Comment(comment) { @@ -883,13 +787,12 @@ 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 : '') + " */"; + var code; + code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n"); if ((level || o.level) === LEVEL_TOP) { code = o.indent + code; } - return [this.makeCode("\n"), this.makeCode(code)]; + return code; }; return Comment; @@ -897,6 +800,7 @@ define(function(require, exports, module) { })(Base); exports.Call = Call = (function(_super) { + __extends(Call, _super); function Call(variable, args, soak) { @@ -905,9 +809,6 @@ define(function(require, exports, module) { 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,19 +825,24 @@ define(function(require, exports, module) { }; Call.prototype.superReference = function(o) { - var accesses, method; + var accesses, method, name; method = o.scope.namedMethod(); - if (method != null ? method.klass : void 0) { + 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"; } }; @@ -996,71 +902,88 @@ 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; + var arg, args, code, _ref2; if ((_ref2 = this.variable) != null) { _ref2.front = this.front; } - compiledArray = Splat.compileSplattedArray(o, this.args, true); - if (compiledArray.length) { - return this.compileSplat(o, compiledArray); + if (code = Splat.compileSplattedArray(o, this.args, true)) { + return this.compileSplat(o, code); } - 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.superThis(o)) + (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.superThis(o)) + (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.superThis(o)) + ", " + 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,6 +991,7 @@ define(function(require, exports, module) { })(Base); exports.Extends = Extends = (function(_super) { + __extends(Extends, _super); function Extends(child, parent) { @@ -1077,8 +1001,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,6 +1010,7 @@ define(function(require, exports, module) { })(Base); exports.Access = Access = (function(_super) { + __extends(Access, _super); function Access(name, tag) { @@ -1096,16 +1021,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,6 +1038,7 @@ define(function(require, exports, module) { })(Base); exports.Index = Index = (function(_super) { + __extends(Index, _super); function Index(index) { @@ -1123,8 +1047,8 @@ define(function(require, exports, module) { 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,6 +1060,7 @@ define(function(require, exports, module) { })(Base); exports.Range = Range = (function(_super) { + __extends(Range, _super); Range.prototype.children = ['from', 'to']; @@ -1152,14 +1077,14 @@ 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]; + _ref4 = 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]; + _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(NUMBER); + return this.stepNum = this.stepVar.match(SIMPLENUM); } }; @@ -1183,7 +1108,7 @@ define(function(require, exports, module) { 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; @@ -1191,7 +1116,7 @@ define(function(require, exports, module) { if (namedIndex) { stepPart = "" + idxName + " = " + stepPart; } - return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)]; + return "" + varPart + "; " + condPart + "; " + stepPart; }; Range.prototype.compileArray = function(o) { @@ -1205,7 +1130,7 @@ define(function(require, exports, module) { if (this.exclusive) { range.pop(); } - return [this.makeCode("[" + (range.join(', ')) + "]")]; + return "[" + (range.join(', ')) + "]"; } idt = this.tab + TAB; i = o.scope.freeVariable('i'); @@ -1213,7 +1138,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 +1146,14 @@ 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 : '') + ")")]; + return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")"; }; return Range; @@ -1234,6 +1161,7 @@ define(function(require, exports, module) { })(Base); exports.Slice = Slice = (function(_super) { + __extends(Slice, _super); Slice.prototype.children = ['range']; @@ -1244,17 +1172,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,6 +1187,7 @@ define(function(require, exports, module) { })(Base); exports.Obj = Obj = (function(_super) { + __extends(Obj, _super); function Obj(props, generated) { @@ -1272,52 +1198,47 @@ 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, props, _i, _len; props = this.properties; if (!props.length) { - return [this.makeCode(this.front ? '({})' : '{}')]; + return (this.front ? '({})' : '{}'); } if (this.generated) { for (_i = 0, _len = props.length; _i < _len; _i++) { node = props[_i]; 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 _j, _len1, _results; + _results = []; + for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) { + prop = props[i]; + join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; + indent = prop instanceof Comment ? '' : idt; + if (prop instanceof Value && prop["this"]) { + prop = new Assign(prop.properties[0].name, prop, 'object'); } - (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; } }; @@ -1338,6 +1259,7 @@ define(function(require, exports, module) { })(Base); exports.Arr = Arr = (function(_super) { + __extends(Arr, _super); function Arr(objs) { @@ -1346,42 +1268,32 @@ define(function(require, exports, module) { Arr.prototype.children = ['objects']; + Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects; + Arr.prototype.compileNode = function(o) { - var answer, compiledObjs, fragments, index, obj, _i, _len; + var code, obj, objs; if (!this.objects.length) { - return [this.makeCode('[]')]; + return '[]'; } o.indent += TAB; - answer = Splat.compileSplattedArray(o, this.objects); - if (answer.length) { - return answer; + objs = this.filterImplicitObjects(this.objects); + if (code = Splat.compileSplattedArray(o, objs)) { + return code; } - answer = []; - compiledObjs = (function() { - var _i, _len, _ref2, _results; - _ref2 = this.objects; + 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) { @@ -1401,6 +1313,7 @@ define(function(require, exports, module) { })(Base); exports.Class = Class = (function(_super) { + __extends(Class, _super); function Class(variable, parent, body) { @@ -1420,7 +1333,7 @@ define(function(require, exports, module) { } 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); }; @@ -1442,12 +1355,16 @@ define(function(require, exports, module) { }; 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 +1381,23 @@ 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 +1415,23 @@ 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 +1447,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 +1462,37 @@ 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'; + 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; - 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); + if (!(this.ctor instanceof Code)) { + this.body.expressions.unshift(this.ctor); } + this.body.expressions.push(lname); (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives); - klass = new Parens(new Call(func, args)); + this.addBoundFunctions(o); + call = Closure.wrap(this.body); + if (this.parent) { + this.superClass = new Literal(o.scope.freeVariable('super', false)); + this.body.expressions.unshift(new Extends(lname, this.superClass)); + call.args.push(this.parent); + params = call.variable.params || call.variable.base.params; + params.push(new Param(this.superClass)); + } + klass = new Parens(call, true); if (this.variable) { klass = new Assign(this.variable, klass); } - return klass.compileToFragments(o); + return klass.compile(o); }; return Class; @@ -1588,6 +1500,7 @@ define(function(require, exports, module) { })(Base); exports.Assign = Assign = (function(_super) { + __extends(Assign, _super); function Assign(variable, value, context, options) { @@ -1599,7 +1512,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,7 +1531,7 @@ 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); @@ -1630,12 +1543,10 @@ define(function(require, exports, module) { 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 +1557,32 @@ define(function(require, exports, module) { } } if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { - if (match[2]) { + if (match[1]) { this.value.klass = match[1]; } - this.value.name = (_ref3 = (_ref4 = match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; + 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); + val = this.value.compile(o, LEVEL_LIST); if (this.context === 'object') { - return compiledName.concat(this.makeCode(": "), val); + return "" + name + ": " + val; } - answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), 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 +1592,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 +1632,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 +1644,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,60 +1653,47 @@ 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, ', '); + 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"); + 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 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); - } } + 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 ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) { + to = +to.compile(o) - +fromRef; if (!exclusive) { to += 1; } @@ -1806,11 +1707,11 @@ define(function(require, exports, module) { 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 +1720,16 @@ define(function(require, exports, module) { })(Base); exports.Code = Code = (function(_super) { + __extends(Code, _super); function Code(params, body, tag) { this.params = params || []; this.body = body || new Block; this.bound = tag === 'boundfunc'; + if (this.bound) { + this.context = '_this'; + } } Code.prototype.children = ['params', 'body']; @@ -1835,43 +1740,31 @@ 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]; + _ref3 = this.params; + for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { + param = _ref3[_j]; if (!param.splat) { continue; } - _ref5 = this.params; - for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) { - p = _ref5[_k].name; + _ref4 = this.params; + for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) { + p = _ref4[_k].name; if (p["this"]) { p = p.properties[0].name; } @@ -1880,20 +1773,20 @@ define(function(require, exports, module) { } } 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) { @@ -1919,60 +1812,60 @@ define(function(require, exports, module) { 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); - }); + 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(') {')); + code += '(' + params.join(', ') + ') {'; if (!this.body.isEmpty()) { - answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab)); + code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab; } - answer.push(this.makeCode('}')); + code += '}'; if (this.ctor) { - return [this.makeCode(this.tab)].concat(__slice.call(answer)); + 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,6 +1879,7 @@ define(function(require, exports, module) { })(Base); exports.Param = Param = (function(_super) { + __extends(Param, _super); function Param(name, value, splat) { @@ -1994,14 +1888,14 @@ define(function(require, exports, module) { 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) { @@ -2022,7 +1916,6 @@ define(function(require, exports, module) { if (this.splat) { node = new Splat(node); } - node.updateLocationDataIfMissing(this.locationData); return this.reference = node; }; @@ -2030,44 +1923,47 @@ define(function(require, exports, module) { return this.name.isComplex(); }; - Param.prototype.eachName = function(iterator, name) { - var atParam, node, obj, _i, _len, _ref2; + 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); + 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()); + names.push(obj.value.unwrap().value); } else if (obj instanceof Splat) { - node = obj.name.unwrap(); - iterator(node.value, node); + names.push(obj.name.unwrap().value); } else if (obj instanceof Value) { if (obj.isArray() || obj.isObject()) { - this.eachName(iterator, obj.base); + names.push.apply(names, this.names(obj.base)); } else if (obj["this"]) { - atParam(obj); + names.push.apply(names, atParam(obj)); } else { - iterator(obj.base.value, obj.base); + names.push(obj.base.value); } } else { - obj.error("illegal parameter " + (obj.compile())); + throw SyntaxError("illegal parameter " + (obj.compile())); } } + return names; }; return Param; @@ -2075,6 +1971,7 @@ define(function(require, exports, module) { })(Base); exports.Splat = Splat = (function(_super) { + __extends(Splat, _super); Splat.prototype.children = ['name']; @@ -2089,8 +1986,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 +1999,29 @@ 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 []; + return ''; } if (list.length === 1) { - node = list[0]; - fragments = node.compileToFragments(o, LEVEL_LIST); + code = list[0].compile(o, LEVEL_LIST); if (apply) { - return fragments; + return code; } - return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")")); + 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 +2029,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,6 +2041,7 @@ define(function(require, exports, module) { })(Base); exports.While = While = (function(_super) { + __extends(While, _super); function While(condition, options) { @@ -2173,29 +2070,29 @@ 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; } 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')); @@ -2210,13 +2107,13 @@ define(function(require, exports, module) { } } } - 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("}")); + code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}"); if (this.returns) { - answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";")); + code += "\n" + this.tab + "return " + rvar + ";"; } - return answer; + return code; }; return While; @@ -2338,16 +2235,16 @@ 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 (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); @@ -2358,20 +2255,20 @@ define(function(require, exports, module) { 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)); + 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) { @@ -2385,33 +2282,27 @@ 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); + 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)); + parts.push(this.first.compile(o, LEVEL_OP)); if (this.flip) { parts.reverse(); } - return this.joinFragmentArrays(parts, ''); + return parts.join(''); }; Op.prototype.toString = function(idt) { @@ -2423,6 +2314,7 @@ define(function(require, exports, module) { })(Base); exports.In = In = (function(_super) { + __extends(In, _super); function In(object, array) { @@ -2454,40 +2346,42 @@ define(function(require, exports, module) { }; In.prototype.compileOrTest = function(o) { - var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4; + var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3; if (this.array.base.objects.length === 0) { - return [this.makeCode("" + (!!this.negated))]; + 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; + code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0'); + if (sub === ref) { + return code; } - fragments = sub.concat(this.makeCode(', '), fragments); + code = sub + ', ' + code; if (o.level < LEVEL_LIST) { - return fragments; + return code; } else { - return this.wrapInBraces(fragments); + return "(" + code + ")"; } }; @@ -2500,11 +2394,12 @@ define(function(require, exports, module) { })(Base); exports.Try = Try = (function(_super) { + __extends(Try, _super); - function Try(attempt, errorVariable, recovery, ensure) { + function Try(attempt, error, recovery, ensure) { this.attempt = attempt; - this.errorVariable = errorVariable; + this.error = error; this.recovery = recovery; this.ensure = ensure; } @@ -2529,12 +2424,26 @@ define(function(require, exports, module) { }; 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,6 +2451,7 @@ define(function(require, exports, module) { })(Base); exports.Throw = Throw = (function(_super) { + __extends(Throw, _super); function Throw(expression) { @@ -2557,7 +2467,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,6 +2475,7 @@ define(function(require, exports, module) { })(Base); exports.Existence = Existence = (function(_super) { + __extends(Existence, _super); function Existence(expression) { @@ -2585,7 +2496,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,6 +2508,7 @@ define(function(require, exports, module) { })(Base); exports.Parens = Parens = (function(_super) { + __extends(Parens, _super); function Parens(body) { @@ -2610,18 +2526,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,6 +2546,7 @@ define(function(require, exports, module) { })(Base); exports.For = For = (function(_super) { + __extends(For, _super); function For(body, source) { @@ -2642,18 +2559,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,7 +2575,7 @@ 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) { @@ -2669,8 +2583,8 @@ define(function(require, exports, module) { } 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); } @@ -2684,8 +2598,7 @@ define(function(require, exports, module) { 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); + stepvar = scope.freeVariable("step"); } if (this.pattern) { name = ivar; @@ -2695,7 +2608,7 @@ define(function(require, exports, module) { 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 +2616,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) { @@ -2754,28 +2649,28 @@ define(function(require, exports, module) { if (this.pattern) { body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]"))); } - defPartFragments = [].concat(this.makeCode(defPart), this.pluckDirectCall(o, body)); + 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")); + if (body) { + body = '\n' + body + '\n'; } - return [].concat(defPartFragments, this.makeCode("" + (resultPart || '') + this.tab + "for ("), forPartFragments, this.makeCode(") {" + guardPart + varPart), bodyFragments, this.makeCode("" + this.tab + "}" + (returnResult || ''))); + 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]; @@ -2783,18 +2678,18 @@ define(function(require, exports, module) { if (!(expr instanceof Call)) { 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')))) { + val = expr.variable.unwrapAll(); + if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) { continue; } - fn = ((_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]; + _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,6 +2699,7 @@ define(function(require, exports, module) { })(While); exports.Switch = Switch = (function(_super) { + __extends(Switch, _super); function Switch(subject, cases, otherwise) { @@ -2817,7 +2713,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,8 +2722,8 @@ 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; @@ -2850,23 +2746,23 @@ define(function(require, exports, module) { }; 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]; + 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(); } - fragments = fragments.concat(this.makeCode(idt1 + "case "), cond.compileToFragments(o, LEVEL_PAREN), this.makeCode(":\n")); + code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n"); } - if ((body = block.compileToFragments(o, LEVEL_TOP)).length > 0) { - fragments = fragments.concat(body, this.makeCode('\n')); + if (body = block.compile(o, LEVEL_TOP)) { + code += body + '\n'; } if (i === this.cases.length - 1 && !this.otherwise) { break; @@ -2875,13 +2771,12 @@ define(function(require, exports, module) { 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,6 +2784,7 @@ define(function(require, exports, module) { })(Base); exports.If = If = (function(_super) { + __extends(If, _super); function If(condition, body, options) { @@ -2920,7 +2816,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 +2856,37 @@ define(function(require, exports, module) { }; If.prototype.compileStatement = function(o) { - var answer, body, child, cond, exeq, ifPart, indent; + var body, child, cond, exeq, ifPart; child = del(o, 'chainChild'); exeq = del(o, 'isExistentialEquals'); if (exeq) { return new If(this.condition.invert(), this.elseBodyNode(), { type: 'if' - }).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 + "}")); + cond = this.condition.compile(o, LEVEL_PAREN); + o.indent += TAB; + body = this.ensureBlock(this.body); + ifPart = "if (" + cond + ") {\n" + (body.compile(o)) + "\n" + this.tab + "}"; if (!child) { - ifPart.unshift(this.makeCode(this.tab)); + ifPart = this.tab + ifPart; } 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; + 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,6 +2898,48 @@ 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) || (node instanceof Call && node.isSuper); + } + }; + + unfoldSoak = function(o, parent, name) { + var ifn; + if (!(ifn = parent[name].unfoldSoak(o))) { + return; + } + parent[name] = ifn.body; + ifn.body = new Value(parent); + return ifn; + }; + UTILITIES = { "extends": function() { return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"; @@ -3052,16 +2978,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 +2994,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..3fb271e6 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) 2009-2012 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,105 +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) { -/* 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 */ 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,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"Index":69,"INDEX_START":70,"IndexValue":71,"INDEX_END":72,"INDEX_SOAK":73,"Slice":74,"{":75,"AssignList":76,"}":77,"CLASS":78,"EXTENDS":79,"OptFuncExist":80,"Arguments":81,"SUPER":82,"FUNC_EXIST":83,"CALL_START":84,"CALL_END":85,"ArgList":86,"THIS":87,"@":88,"[":89,"]":90,"RangeDots":91,"..":92,"Arg":93,"SimpleArgs":94,"TRY":95,"Catch":96,"FINALLY":97,"CATCH":98,"THROW":99,"(":100,")":101,"WhileSource":102,"WHILE":103,"WHEN":104,"UNTIL":105,"Loop":106,"LOOP":107,"ForBody":108,"FOR":109,"ForStart":110,"ForSource":111,"ForVariables":112,"OWN":113,"ForValue":114,"FORIN":115,"FOROF":116,"BY":117,"SWITCH":118,"Whens":119,"ELSE":120,"When":121,"LEADING_WHEN":122,"IfBlock":123,"IF":124,"POST_IF":125,"UNARY":126,"-":127,"+":128,"--":129,"++":130,"?":131,"MATH":132,"SHIFT":133,"COMPARE":134,"LOGIC":135,"RELATION":136,"COMPOUND_ASSIGN":137,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",70:"INDEX_START",72:"INDEX_END",73:"INDEX_SOAK",75:"{",77:"}",78:"CLASS",79:"EXTENDS",82:"SUPER",83:"FUNC_EXIST",84:"CALL_START",85:"CALL_END",87:"THIS",88:"@",89:"[",90:"]",92:"..",95:"TRY",97:"FINALLY",98:"CATCH",99:"THROW",100:"(",101:")",103:"WHILE",104:"WHEN",105:"UNTIL",107:"LOOP",109:"FOR",113:"OWN",115:"FORIN",116:"FOROF",117:"BY",118:"SWITCH",120:"ELSE",122:"LEADING_WHEN",124:"IF",125:"POST_IF",126:"UNARY",127:"-",128:"+",129:"--",130:"++",131:"?",132:"MATH",133:"SHIFT",134:"COMPARE",135:"LOGIC",136:"RELATION",137:"COMPOUND_ASSIGN"}, +productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[10,2],[10,1],[11,1],[15,5],[15,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[13,1],[13,1],[13,1],[13,1],[13,1],[62,2],[62,2],[62,2],[62,1],[62,1],[69,3],[69,2],[71,1],[71,1],[59,4],[76,0],[76,1],[76,3],[76,4],[76,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[80,0],[80,1],[81,2],[81,4],[65,1],[65,1],[44,2],[58,2],[58,4],[91,1],[91,1],[64,5],[74,3],[74,2],[74,2],[74,1],[86,1],[86,3],[86,4],[86,4],[86,6],[93,1],[93,1],[94,1],[94,3],[19,2],[19,3],[19,4],[19,5],[96,3],[24,2],[63,3],[63,5],[102,2],[102,4],[102,2],[102,4],[20,2],[20,2],[20,2],[20,1],[106,2],[106,2],[21,2],[21,2],[21,2],[108,2],[108,2],[110,2],[110,3],[114,1],[114,1],[114,1],[114,1],[112,1],[112,3],[111,2],[111,2],[111,4],[111,4],[111,4],[111,6],[111,6],[22,5],[22,7],[22,4],[22,6],[119,1],[119,2],[121,3],[121,4],[123,3],[123,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,3]], +performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { var $0 = $$.length - 1; switch (yystate) { -case 1:return this.$ = 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 +53,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,43 +79,43 @@ 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.$ = new yy.Undefined; break; -case 34:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Bool($$[$0])); +case 34:this.$ = new yy.Null; break; -case 35:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0])); +case 35:this.$ = new yy.Bool($$[$0]); break; -case 36:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0])); +case 36:this.$ = new yy.Assign($$[$0-2], $$[$0]); break; -case 37:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1])); +case 37:this.$ = new yy.Assign($$[$0-3], $$[$0]); break; -case 38:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 38:this.$ = new yy.Assign($$[$0-4], $$[$0-1]); 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.Value($$[$0]); 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.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object'); break; -case 41:this.$ = $$[$0]; +case 41:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object'); break; case 42:this.$ = $$[$0]; break; @@ -197,41 +123,41 @@ case 43:this.$ = $$[$0]; break; case 44:this.$ = $$[$0]; break; -case 45:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Return($$[$0])); +case 45:this.$ = $$[$0]; break; -case 46:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Return); +case 46:this.$ = new yy.Return($$[$0]); break; -case 47:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Comment($$[$0])); +case 47:this.$ = new yy.Return; break; -case 48:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Code($$[$0-3], $$[$0], $$[$0-1])); +case 48:this.$ = new yy.Comment($$[$0]); break; -case 49:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Code([], $$[$0], $$[$0-1])); +case 49:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]); break; -case 50:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('func'); +case 50:this.$ = new yy.Code([], $$[$0], $$[$0-1]); break; -case 51:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('boundfunc'); +case 51:this.$ = 'func'; break; -case 52:this.$ = $$[$0]; +case 52:this.$ = 'boundfunc'; break; case 53:this.$ = $$[$0]; break; -case 54:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); +case 54:this.$ = $$[$0]; break; -case 55:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +case 55:this.$ = []; break; -case 56:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); +case 56:this.$ = [$$[$0]]; break; -case 57:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); +case 57:this.$ = $$[$0-2].concat($$[$0]); break; -case 58:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); +case 58:this.$ = $$[$0-3].concat($$[$0]); break; -case 59:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Param($$[$0])); +case 59:this.$ = $$[$0-5].concat($$[$0-2]); break; -case 60:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Param($$[$0-1], null, true)); +case 60:this.$ = new yy.Param($$[$0]); break; -case 61:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Param($$[$0-2], $$[$0])); +case 61:this.$ = new yy.Param($$[$0-1], null, true); break; -case 62:this.$ = $$[$0]; +case 62:this.$ = new yy.Param($$[$0-2], $$[$0]); break; case 63:this.$ = $$[$0]; break; @@ -239,131 +165,131 @@ case 64:this.$ = $$[$0]; break; case 65:this.$ = $$[$0]; break; -case 66:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Splat($$[$0-1])); +case 66:this.$ = $$[$0]; break; -case 67:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 67:this.$ = new yy.Splat($$[$0-1]); break; -case 68:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].add($$[$0])); +case 68:this.$ = new yy.Value($$[$0]); break; -case 69:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value($$[$0-1], [].concat($$[$0]))); +case 69:this.$ = $$[$0-1].add($$[$0]); break; -case 70:this.$ = $$[$0]; +case 70:this.$ = new yy.Value($$[$0-1], [].concat($$[$0])); break; case 71:this.$ = $$[$0]; break; -case 72:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 72:this.$ = $$[$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.Value($$[$0]); break; -case 77:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 77:this.$ = new yy.Value($$[$0]); break; -case 78:this.$ = $$[$0]; +case 78:this.$ = new yy.Value($$[$0]); break; -case 79:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0])); +case 79:this.$ = $$[$0]; break; -case 80:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0], 'soak')); +case 80:this.$ = new yy.Access($$[$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.$ = new yy.Access($$[$0], 'soak'); 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]))]); +case 82:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])]; break; -case 83:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Access(new yy.Literal('prototype'))); +case 83:this.$ = new yy.Access(new yy.Literal('prototype')); break; case 84:this.$ = $$[$0]; break; -case 85:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); +case 85:this.$ = $$[$0-1]; break; -case 86:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(yy.extend($$[$0], { +case 86:this.$ = yy.extend($$[$0], { soak: true - })); + }); break; -case 87:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Index($$[$0])); +case 87:this.$ = new yy.Index($$[$0]); break; -case 88:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Slice($$[$0])); +case 88:this.$ = new yy.Slice($$[$0]); break; -case 89:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Obj($$[$0-2], $$[$0-3].generated)); +case 89:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated); break; -case 90:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); +case 90:this.$ = []; break; -case 91:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +case 91:this.$ = [$$[$0]]; break; -case 92:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); +case 92:this.$ = $$[$0-2].concat($$[$0]); break; -case 93:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); +case 93:this.$ = $$[$0-3].concat($$[$0]); break; -case 94:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); +case 94:this.$ = $$[$0-5].concat($$[$0-2]); break; -case 95:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Class); +case 95:this.$ = new yy.Class; break; -case 96:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class(null, null, $$[$0])); +case 96:this.$ = new yy.Class(null, null, $$[$0]); break; -case 97:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class(null, $$[$0])); +case 97:this.$ = new yy.Class(null, $$[$0]); break; -case 98:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class(null, $$[$0-1], $$[$0])); +case 98:this.$ = new yy.Class(null, $$[$0-1], $$[$0]); break; -case 99:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class($$[$0])); +case 99:this.$ = new yy.Class($$[$0]); break; -case 100:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class($$[$0-1], null, $$[$0])); +case 100:this.$ = new yy.Class($$[$0-1], null, $$[$0]); break; -case 101:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class($$[$0-2], $$[$0])); +case 101:this.$ = new yy.Class($$[$0-2], $$[$0]); break; -case 102:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Class($$[$0-3], $$[$0-1], $$[$0])); +case 102:this.$ = 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])); +case 103:this.$ = 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])); +case 104:this.$ = 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'))])); +case 105:this.$ = 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])); +case 106:this.$ = new yy.Call('super', $$[$0]); break; -case 107:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(false); +case 107:this.$ = false; break; -case 108:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(true); +case 108:this.$ = true; break; -case 109:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([]); +case 109:this.$ = []; break; -case 110:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); +case 110:this.$ = $$[$0-2]; break; -case 111:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); +case 111:this.$ = new yy.Value(new yy.Literal('this')); break; -case 112:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); +case 112:this.$ = 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')); +case 113:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this'); break; -case 114:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Arr([])); +case 114:this.$ = new yy.Arr([]); break; -case 115:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Arr($$[$0-2])); +case 115:this.$ = new yy.Arr($$[$0-2]); break; -case 116:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('inclusive'); +case 116:this.$ = 'inclusive'; break; -case 117:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('exclusive'); +case 117:this.$ = 'exclusive'; break; -case 118:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Range($$[$0-3], $$[$0-1], $$[$0-2])); +case 118:this.$ = 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])); +case 119:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]); break; -case 120:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range($$[$0-1], null, $$[$0])); +case 120:this.$ = new yy.Range($$[$0-1], null, $$[$0]); break; -case 121:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range(null, $$[$0], $$[$0-1])); +case 121:this.$ = new yy.Range(null, $$[$0], $$[$0-1]); break; -case 122:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Range(null, null, $$[$0])); +case 122:this.$ = new yy.Range(null, null, $$[$0]); break; -case 123:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +case 123:this.$ = [$$[$0]]; break; -case 124:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); +case 124:this.$ = $$[$0-2].concat($$[$0]); break; -case 125:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); +case 125:this.$ = $$[$0-3].concat($$[$0]); break; -case 126:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); +case 126:this.$ = $$[$0-2]; break; -case 127:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); +case 127:this.$ = $$[$0-5].concat($$[$0-2]); break; case 128:this.$ = $$[$0]; break; @@ -371,354 +297,398 @@ case 129:this.$ = $$[$0]; break; case 130:this.$ = $$[$0]; break; -case 131:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([].concat($$[$0-2], $$[$0])); +case 131:this.$ = [].concat($$[$0-2], $$[$0]); break; -case 132:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Try($$[$0])); +case 132:this.$ = new yy.Try($$[$0]); break; -case 133:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Try($$[$0-1], $$[$0][0], $$[$0][1])); +case 133:this.$ = 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])); +case 134:this.$ = 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])); +case 135:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]); break; -case 136:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-1], $$[$0]]); +case 136:this.$ = [$$[$0-1], $$[$0]]; break; -case 137:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Value($$[$0-1])), $$[$0]]); +case 137:this.$ = new yy.Throw($$[$0]); break; -case 138:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([null, $$[$0]]); +case 138:this.$ = new yy.Parens($$[$0-1]); break; -case 139:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Throw($$[$0])); +case 139:this.$ = new yy.Parens($$[$0-2]); break; -case 140:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Parens($$[$0-1])); +case 140:this.$ = new yy.While($$[$0]); 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], { +case 141:this.$ = 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 142:this.$ = new yy.While($$[$0], { + invert: true + }); +break; +case 143:this.$ = new yy.While($$[$0-2], { + invert: true, + guard: $$[$0] + }); +break; +case 144:this.$ = $$[$0-1].addBody($$[$0]); +break; +case 145:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); +break; +case 146:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); +break; +case 147:this.$ = $$[$0]; +break; +case 148:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]); +break; +case 149:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]])); +break; +case 150:this.$ = new yy.For($$[$0-1], $$[$0]); +break; +case 151:this.$ = new yy.For($$[$0-1], $$[$0]); +break; +case 152:this.$ = new yy.For($$[$0], $$[$0-1]); +break; +case 153:this.$ = { + source: new yy.Value($$[$0]) + }; +break; +case 154:this.$ = (function () { $$[$0].own = $$[$0-1].own; $$[$0].name = $$[$0-1][0]; $$[$0].index = $$[$0-1][1]; return $$[$0]; - }())); + }()); break; -case 157:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0]); +case 155:this.$ = $$[$0]; break; -case 158:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { +case 156:this.$ = (function () { $$[$0].own = true; return $$[$0]; - }())); + }()); break; -case 159:this.$ = $$[$0]; +case 157:this.$ = $$[$0]; break; -case 160:this.$ = $$[$0]; +case 158:this.$ = $$[$0]; break; -case 161:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 159:this.$ = new yy.Value($$[$0]); break; -case 162:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 160:this.$ = new yy.Value($$[$0]); break; -case 163:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +case 161:this.$ = [$$[$0]]; break; -case 164:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-2], $$[$0]]); +case 162:this.$ = [$$[$0-2], $$[$0]]; break; -case 165:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ +case 163:this.$ = { source: $$[$0] - }); + }; break; -case 166:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ +case 164:this.$ = { source: $$[$0], object: true - }); + }; break; -case 167:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ +case 165:this.$ = { source: $$[$0-2], guard: $$[$0] - }); + }; break; -case 168:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ +case 166:this.$ = { source: $$[$0-2], guard: $$[$0], object: true - }); + }; break; -case 169:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ +case 167:this.$ = { source: $$[$0-2], step: $$[$0] - }); + }; break; -case 170:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ +case 168:this.$ = { source: $$[$0-4], guard: $$[$0-2], step: $$[$0] - }); + }; break; -case 171:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ +case 169:this.$ = { source: $$[$0-4], step: $$[$0-2], guard: $$[$0] + }; +break; +case 170:this.$ = new yy.Switch($$[$0-3], $$[$0-1]); +break; +case 171:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]); +break; +case 172:this.$ = new yy.Switch(null, $$[$0-1]); +break; +case 173:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]); +break; +case 174:this.$ = $$[$0]; +break; +case 175:this.$ = $$[$0-1].concat($$[$0]); +break; +case 176:this.$ = [[$$[$0-1], $$[$0]]]; +break; +case 177:this.$ = [[$$[$0-2], $$[$0-1]]]; +break; +case 178:this.$ = new yy.If($$[$0-1], $$[$0], { + type: $$[$0-2] }); break; -case 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 179: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 180:this.$ = $$[$0]; break; -case 182:this.$ = $$[$0]; +case 181: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 182: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 183: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 184:this.$ = new yy.Op($$[$0-1], $$[$0]); break; -case 187:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('-', $$[$0])); +case 185:this.$ = new yy.Op('-', $$[$0]); break; -case 188:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('+', $$[$0])); +case 186:this.$ = new yy.Op('+', $$[$0]); break; -case 189:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0])); +case 187:this.$ = new yy.Op('--', $$[$0]); break; -case 190:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0])); +case 188:this.$ = new yy.Op('++', $$[$0]); break; -case 191:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0-1], null, true)); +case 189: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 190:this.$ = new yy.Op('++', $$[$0-1], null, true); break; -case 193:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Existence($$[$0-1])); +case 191:this.$ = new yy.Existence($$[$0-1]); break; -case 194:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('+', $$[$0-2], $$[$0])); +case 192:this.$ = new yy.Op('+', $$[$0-2], $$[$0]); break; -case 195:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('-', $$[$0-2], $$[$0])); +case 193: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 194: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 195: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 196: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 197:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); break; -case 200:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { +case 198:this.$ = (function () { if ($$[$0-1].charAt(0) === '!') { return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert(); } else { return new yy.Op($$[$0-1], $$[$0-2], $$[$0]); } - }())); + }()); break; -case 201:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0], $$[$0-1])); +case 199: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 200: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 201: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:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[3]},{1:[2,2],6:[1,74]},{6:[1,75]},{1:[2,4],6:[2,4],26:[2,4],101:[2,4]},{4:77,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,76],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,7],6:[2,7],26:[2,7],101:[2,7],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,8],6:[2,8],26:[2,8],101:[2,8],102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,12],73:[1,100],77:[2,12],80:92,83:[1,94],84:[2,107],85:[2,12],90:[2,12],92:[2,12],101:[2,12],103:[2,12],104:[2,12],105:[2,12],109:[2,12],117:[2,12],125:[2,12],127:[2,12],128:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,13],73:[1,100],77:[2,13],80:101,83:[1,94],84:[2,107],85:[2,13],90:[2,13],92:[2,13],101:[2,13],103:[2,13],104:[2,13],105:[2,13],109:[2,13],117:[2,13],125:[2,13],127:[2,13],128:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],72:[2,14],77:[2,14],85:[2,14],90:[2,14],92:[2,14],101:[2,14],103:[2,14],104:[2,14],105:[2,14],109:[2,14],117:[2,14],125:[2,14],127:[2,14],128:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],72:[2,15],77:[2,15],85:[2,15],90:[2,15],92:[2,15],101:[2,15],103:[2,15],104:[2,15],105:[2,15],109:[2,15],117:[2,15],125:[2,15],127:[2,15],128:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],72:[2,16],77:[2,16],85:[2,16],90:[2,16],92:[2,16],101:[2,16],103:[2,16],104:[2,16],105:[2,16],109:[2,16],117:[2,16],125:[2,16],127:[2,16],128:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],72:[2,17],77:[2,17],85:[2,17],90:[2,17],92:[2,17],101:[2,17],103:[2,17],104:[2,17],105:[2,17],109:[2,17],117:[2,17],125:[2,17],127:[2,17],128:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],72:[2,18],77:[2,18],85:[2,18],90:[2,18],92:[2,18],101:[2,18],103:[2,18],104:[2,18],105:[2,18],109:[2,18],117:[2,18],125:[2,18],127:[2,18],128:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],72:[2,19],77:[2,19],85:[2,19],90:[2,19],92:[2,19],101:[2,19],103:[2,19],104:[2,19],105:[2,19],109:[2,19],117:[2,19],125:[2,19],127:[2,19],128:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],72:[2,20],77:[2,20],85:[2,20],90:[2,20],92:[2,20],101:[2,20],103:[2,20],104:[2,20],105:[2,20],109:[2,20],117:[2,20],125:[2,20],127:[2,20],128:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],72:[2,21],77:[2,21],85:[2,21],90:[2,21],92:[2,21],101:[2,21],103:[2,21],104:[2,21],105:[2,21],109:[2,21],117:[2,21],125:[2,21],127:[2,21],128:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],72:[2,22],77:[2,22],85:[2,22],90:[2,22],92:[2,22],101:[2,22],103:[2,22],104:[2,22],105:[2,22],109:[2,22],117:[2,22],125:[2,22],127:[2,22],128:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],72:[2,23],77:[2,23],85:[2,23],90:[2,23],92:[2,23],101:[2,23],103:[2,23],104:[2,23],105:[2,23],109:[2,23],117:[2,23],125:[2,23],127:[2,23],128:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23]},{1:[2,9],6:[2,9],26:[2,9],101:[2,9],103:[2,9],105:[2,9],109:[2,9],125:[2,9]},{1:[2,10],6:[2,10],26:[2,10],101:[2,10],103:[2,10],105:[2,10],109:[2,10],125:[2,10]},{1:[2,11],6:[2,11],26:[2,11],101:[2,11],103:[2,11],105:[2,11],109:[2,11],125:[2,11]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,103],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],70:[2,75],72:[2,75],73:[2,75],77:[2,75],83:[2,75],84:[2,75],85:[2,75],90:[2,75],92:[2,75],101:[2,75],103:[2,75],104:[2,75],105:[2,75],109:[2,75],117:[2,75],125:[2,75],127:[2,75],128:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],70:[2,76],72:[2,76],73:[2,76],77:[2,76],83:[2,76],84:[2,76],85:[2,76],90:[2,76],92:[2,76],101:[2,76],103:[2,76],104:[2,76],105:[2,76],109:[2,76],117:[2,76],125:[2,76],127:[2,76],128:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],70:[2,77],72:[2,77],73:[2,77],77:[2,77],83:[2,77],84:[2,77],85:[2,77],90:[2,77],92:[2,77],101:[2,77],103:[2,77],104:[2,77],105:[2,77],109:[2,77],117:[2,77],125:[2,77],127:[2,77],128:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],70:[2,78],72:[2,78],73:[2,78],77:[2,78],83:[2,78],84:[2,78],85:[2,78],90:[2,78],92:[2,78],101:[2,78],103:[2,78],104:[2,78],105:[2,78],109:[2,78],117:[2,78],125:[2,78],127:[2,78],128:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],70:[2,79],72:[2,79],73:[2,79],77:[2,79],83:[2,79],84:[2,79],85:[2,79],90:[2,79],92:[2,79],101:[2,79],103:[2,79],104:[2,79],105:[2,79],109:[2,79],117:[2,79],125:[2,79],127:[2,79],128:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],70:[2,105],72:[2,105],73:[2,105],77:[2,105],81:104,83:[2,105],84:[1,105],85:[2,105],90:[2,105],92:[2,105],101:[2,105],103:[2,105],104:[2,105],105:[2,105],109:[2,105],117:[2,105],125:[2,105],127:[2,105],128:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105]},{6:[2,55],25:[2,55],27:109,28:[1,73],44:110,48:106,49:[2,55],54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{5:115,25:[1,5]},{8:116,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:118,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:119,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:120,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:124,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,72],73:[2,72],77:[2,72],79:[1,128],83:[2,72],84:[2,72],85:[2,72],90:[2,72],92:[2,72],101:[2,72],103:[2,72],104:[2,72],105:[2,72],109:[2,72],117:[2,72],125:[2,72],127:[2,72],128:[2,72],129:[1,125],130:[1,126],131:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[1,127]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],72:[2,180],77:[2,180],85:[2,180],90:[2,180],92:[2,180],101:[2,180],103:[2,180],104:[2,180],105:[2,180],109:[2,180],117:[2,180],120:[1,129],125:[2,180],127:[2,180],128:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180]},{5:130,25:[1,5]},{5:131,25:[1,5]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],72:[2,147],77:[2,147],85:[2,147],90:[2,147],92:[2,147],101:[2,147],103:[2,147],104:[2,147],105:[2,147],109:[2,147],117:[2,147],125:[2,147],127:[2,147],128:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147]},{5:132,25:[1,5]},{8:133,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,134],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,95],5:135,6:[2,95],13:121,14:122,25:[1,5],26:[2,95],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,49:[2,95],54:[2,95],57:[2,95],58:47,59:48,61:137,63:25,64:26,65:27,72:[2,95],75:[1,70],77:[2,95],79:[1,136],82:[1,28],85:[2,95],87:[1,58],88:[1,59],89:[1,57],90:[2,95],92:[2,95],100:[1,56],101:[2,95],103:[2,95],104:[2,95],105:[2,95],109:[2,95],117:[2,95],125:[2,95],127:[2,95],128:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95]},{8:138,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,47],6:[2,47],8:139,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,47],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,47],102:39,103:[2,47],105:[2,47],106:40,107:[1,67],108:41,109:[2,47],110:69,118:[1,42],123:37,124:[1,64],125:[2,47],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],54:[2,48],77:[2,48],101:[2,48],103:[2,48],105:[2,48],109:[2,48],125:[2,48]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],70:[2,73],72:[2,73],73:[2,73],77:[2,73],83:[2,73],84:[2,73],85:[2,73],90:[2,73],92:[2,73],101:[2,73],103:[2,73],104:[2,73],105:[2,73],109:[2,73],117:[2,73],125:[2,73],127:[2,73],128:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[2,74],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],70:[2,74],72:[2,74],73:[2,74],77:[2,74],83:[2,74],84:[2,74],85:[2,74],90:[2,74],92:[2,74],101:[2,74],103:[2,74],104:[2,74],105:[2,74],109:[2,74],117:[2,74],125:[2,74],127:[2,74],128:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],70:[2,29],72:[2,29],73:[2,29],77:[2,29],83:[2,29],84:[2,29],85:[2,29],90:[2,29],92:[2,29],101:[2,29],103:[2,29],104:[2,29],105:[2,29],109:[2,29],117:[2,29],125:[2,29],127:[2,29],128:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],70:[2,30],72:[2,30],73:[2,30],77:[2,30],83:[2,30],84:[2,30],85:[2,30],90:[2,30],92:[2,30],101:[2,30],103:[2,30],104:[2,30],105:[2,30],109:[2,30],117:[2,30],125:[2,30],127:[2,30],128:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],70:[2,31],72:[2,31],73:[2,31],77:[2,31],83:[2,31],84:[2,31],85:[2,31],90:[2,31],92:[2,31],101:[2,31],103:[2,31],104:[2,31],105:[2,31],109:[2,31],117:[2,31],125:[2,31],127:[2,31],128:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],70:[2,32],72:[2,32],73:[2,32],77:[2,32],83:[2,32],84:[2,32],85:[2,32],90:[2,32],92:[2,32],101:[2,32],103:[2,32],104:[2,32],105:[2,32],109:[2,32],117:[2,32],125:[2,32],127:[2,32],128:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],70:[2,33],72:[2,33],73:[2,33],77:[2,33],83:[2,33],84:[2,33],85:[2,33],90:[2,33],92:[2,33],101:[2,33],103:[2,33],104:[2,33],105:[2,33],109:[2,33],117:[2,33],125:[2,33],127:[2,33],128:[2,33],131:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],70:[2,34],72:[2,34],73:[2,34],77:[2,34],83:[2,34],84:[2,34],85:[2,34],90:[2,34],92:[2,34],101:[2,34],103:[2,34],104:[2,34],105:[2,34],109:[2,34],117:[2,34],125:[2,34],127:[2,34],128:[2,34],131:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],66:[2,35],67:[2,35],68:[2,35],70:[2,35],72:[2,35],73:[2,35],77:[2,35],83:[2,35],84:[2,35],85:[2,35],90:[2,35],92:[2,35],101:[2,35],103:[2,35],104:[2,35],105:[2,35],109:[2,35],117:[2,35],125:[2,35],127:[2,35],128:[2,35],131:[2,35],132:[2,35],133:[2,35],134:[2,35],135:[2,35],136:[2,35]},{4:140,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,141],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:142,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],70:[2,111],72:[2,111],73:[2,111],77:[2,111],83:[2,111],84:[2,111],85:[2,111],90:[2,111],92:[2,111],101:[2,111],103:[2,111],104:[2,111],105:[2,111],109:[2,111],117:[2,111],125:[2,111],127:[2,111],128:[2,111],131:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:148,28:[1,73],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],70:[2,112],72:[2,112],73:[2,112],77:[2,112],83:[2,112],84:[2,112],85:[2,112],90:[2,112],92:[2,112],101:[2,112],103:[2,112],104:[2,112],105:[2,112],109:[2,112],117:[2,112],125:[2,112],127:[2,112],128:[2,112],131:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112]},{25:[2,51]},{25:[2,52]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],70:[2,68],72:[2,68],73:[2,68],77:[2,68],79:[2,68],83:[2,68],84:[2,68],85:[2,68],90:[2,68],92:[2,68],101:[2,68],103:[2,68],104:[2,68],105:[2,68],109:[2,68],117:[2,68],125:[2,68],127:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],70:[2,71],72:[2,71],73:[2,71],77:[2,71],79:[2,71],83:[2,71],84:[2,71],85:[2,71],90:[2,71],92:[2,71],101:[2,71],103:[2,71],104:[2,71],105:[2,71],109:[2,71],117:[2,71],125:[2,71],127:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71]},{8:149,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:150,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:151,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:152,8:153,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{27:158,28:[1,73],44:159,58:160,59:161,64:154,75:[1,70],88:[1,113],89:[1,57],112:155,113:[1,156],114:157},{111:162,115:[1,163],116:[1,164]},{6:[2,90],11:168,25:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:165,77:[2,90],88:[1,113]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],70:[2,27],72:[2,27],73:[2,27],77:[2,27],83:[2,27],84:[2,27],85:[2,27],90:[2,27],92:[2,27],101:[2,27],103:[2,27],104:[2,27],105:[2,27],109:[2,27],117:[2,27],125:[2,27],127:[2,27],128:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],43:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],70:[2,28],72:[2,28],73:[2,28],77:[2,28],83:[2,28],84:[2,28],85:[2,28],90:[2,28],92:[2,28],101:[2,28],103:[2,28],104:[2,28],105:[2,28],109:[2,28],117:[2,28],125:[2,28],127:[2,28],128:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],40:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],70:[2,26],72:[2,26],73:[2,26],77:[2,26],79:[2,26],83:[2,26],84:[2,26],85:[2,26],90:[2,26],92:[2,26],101:[2,26],103:[2,26],104:[2,26],105:[2,26],109:[2,26],115:[2,26],116:[2,26],117:[2,26],125:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,6],6:[2,6],7:172,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,6],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],72:[2,24],77:[2,24],85:[2,24],90:[2,24],92:[2,24],97:[2,24],98:[2,24],101:[2,24],103:[2,24],104:[2,24],105:[2,24],109:[2,24],117:[2,24],120:[2,24],122:[2,24],125:[2,24],127:[2,24],128:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24]},{6:[1,74],26:[1,173]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],72:[2,191],77:[2,191],85:[2,191],90:[2,191],92:[2,191],101:[2,191],103:[2,191],104:[2,191],105:[2,191],109:[2,191],117:[2,191],125:[2,191],127:[2,191],128:[2,191],131:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191]},{8:174,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:175,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:176,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:177,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:178,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:179,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:180,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:181,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],72:[2,146],77:[2,146],85:[2,146],90:[2,146],92:[2,146],101:[2,146],103:[2,146],104:[2,146],105:[2,146],109:[2,146],117:[2,146],125:[2,146],127:[2,146],128:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],72:[2,151],77:[2,151],85:[2,151],90:[2,151],92:[2,151],101:[2,151],103:[2,151],104:[2,151],105:[2,151],109:[2,151],117:[2,151],125:[2,151],127:[2,151],128:[2,151],131:[2,151],132:[2,151],133:[2,151],134:[2,151],135:[2,151],136:[2,151]},{8:182,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],72:[2,145],77:[2,145],85:[2,145],90:[2,145],92:[2,145],101:[2,145],103:[2,145],104:[2,145],105:[2,145],109:[2,145],117:[2,145],125:[2,145],127:[2,145],128:[2,145],131:[2,145],132:[2,145],133:[2,145],134:[2,145],135:[2,145],136:[2,145]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],72:[2,150],77:[2,150],85:[2,150],90:[2,150],92:[2,150],101:[2,150],103:[2,150],104:[2,150],105:[2,150],109:[2,150],117:[2,150],125:[2,150],127:[2,150],128:[2,150],131:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150]},{81:183,84:[1,105]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],70:[2,69],72:[2,69],73:[2,69],77:[2,69],79:[2,69],83:[2,69],84:[2,69],85:[2,69],90:[2,69],92:[2,69],101:[2,69],103:[2,69],104:[2,69],105:[2,69],109:[2,69],117:[2,69],125:[2,69],127:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69]},{84:[2,108]},{27:184,28:[1,73]},{27:185,28:[1,73]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:186,28:[1,73],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],70:[2,83],72:[2,83],73:[2,83],77:[2,83],79:[2,83],83:[2,83],84:[2,83],85:[2,83],90:[2,83],92:[2,83],101:[2,83],103:[2,83],104:[2,83],105:[2,83],109:[2,83],117:[2,83],125:[2,83],127:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],70:[2,84],72:[2,84],73:[2,84],77:[2,84],79:[2,84],83:[2,84],84:[2,84],85:[2,84],90:[2,84],92:[2,84],101:[2,84],103:[2,84],104:[2,84],105:[2,84],109:[2,84],117:[2,84],125:[2,84],127:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84]},{8:188,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],57:[1,192],58:47,59:48,61:36,63:25,64:26,65:27,71:187,74:189,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],91:190,92:[1,191],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{69:193,70:[1,99],73:[1,100]},{81:194,84:[1,105]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],70:[2,70],72:[2,70],73:[2,70],77:[2,70],79:[2,70],83:[2,70],84:[2,70],85:[2,70],90:[2,70],92:[2,70],101:[2,70],103:[2,70],104:[2,70],105:[2,70],109:[2,70],117:[2,70],125:[2,70],127:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70]},{6:[1,196],8:195,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,197],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],70:[2,106],72:[2,106],73:[2,106],77:[2,106],83:[2,106],84:[2,106],85:[2,106],90:[2,106],92:[2,106],101:[2,106],103:[2,106],104:[2,106],105:[2,106],109:[2,106],117:[2,106],125:[2,106],127:[2,106],128:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[1,198],86:199,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],49:[1,201],53:203,54:[1,202]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{6:[2,60],25:[2,60],26:[2,60],40:[1,205],49:[2,60],54:[2,60],57:[1,204]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{6:[2,66],25:[2,66],26:[2,66],40:[2,66],49:[2,66],54:[2,66],57:[2,66]},{27:148,28:[1,73]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,50],6:[2,50],25:[2,50],26:[2,50],49:[2,50],54:[2,50],57:[2,50],72:[2,50],77:[2,50],85:[2,50],90:[2,50],92:[2,50],101:[2,50],103:[2,50],104:[2,50],105:[2,50],109:[2,50],117:[2,50],125:[2,50],127:[2,50],128:[2,50],131:[2,50],132:[2,50],133:[2,50],134:[2,50],135:[2,50],136:[2,50]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],72:[2,184],77:[2,184],85:[2,184],90:[2,184],92:[2,184],101:[2,184],102:87,103:[2,184],104:[2,184],105:[2,184],108:88,109:[2,184],110:69,117:[2,184],125:[2,184],127:[2,184],128:[2,184],131:[1,78],132:[2,184],133:[2,184],134:[2,184],135:[2,184],136:[2,184]},{102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],72:[2,185],77:[2,185],85:[2,185],90:[2,185],92:[2,185],101:[2,185],102:87,103:[2,185],104:[2,185],105:[2,185],108:88,109:[2,185],110:69,117:[2,185],125:[2,185],127:[2,185],128:[2,185],131:[1,78],132:[2,185],133:[2,185],134:[2,185],135:[2,185],136:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],72:[2,186],77:[2,186],85:[2,186],90:[2,186],92:[2,186],101:[2,186],102:87,103:[2,186],104:[2,186],105:[2,186],108:88,109:[2,186],110:69,117:[2,186],125:[2,186],127:[2,186],128:[2,186],131:[1,78],132:[2,186],133:[2,186],134:[2,186],135:[2,186],136:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,187],73:[2,72],77:[2,187],83:[2,72],84:[2,72],85:[2,187],90:[2,187],92:[2,187],101:[2,187],103:[2,187],104:[2,187],105:[2,187],109:[2,187],117:[2,187],125:[2,187],127:[2,187],128:[2,187],131:[2,187],132:[2,187],133:[2,187],134:[2,187],135:[2,187],136:[2,187]},{62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:92,83:[1,94],84:[2,107]},{62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:101,83:[1,94],84:[2,107]},{66:[2,75],67:[2,75],68:[2,75],70:[2,75],73:[2,75],83:[2,75],84:[2,75]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,188],73:[2,72],77:[2,188],83:[2,72],84:[2,72],85:[2,188],90:[2,188],92:[2,188],101:[2,188],103:[2,188],104:[2,188],105:[2,188],109:[2,188],117:[2,188],125:[2,188],127:[2,188],128:[2,188],131:[2,188],132:[2,188],133:[2,188],134:[2,188],135:[2,188],136:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],72:[2,189],77:[2,189],85:[2,189],90:[2,189],92:[2,189],101:[2,189],103:[2,189],104:[2,189],105:[2,189],109:[2,189],117:[2,189],125:[2,189],127:[2,189],128:[2,189],131:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],72:[2,190],77:[2,190],85:[2,190],90:[2,190],92:[2,190],101:[2,190],103:[2,190],104:[2,190],105:[2,190],109:[2,190],117:[2,190],125:[2,190],127:[2,190],128:[2,190],131:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190]},{8:206,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,207],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:208,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:209,25:[1,5],124:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],72:[2,132],77:[2,132],85:[2,132],90:[2,132],92:[2,132],96:211,97:[1,212],98:[1,213],101:[2,132],103:[2,132],104:[2,132],105:[2,132],109:[2,132],117:[2,132],125:[2,132],127:[2,132],128:[2,132],131:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],72:[2,144],77:[2,144],85:[2,144],90:[2,144],92:[2,144],101:[2,144],103:[2,144],104:[2,144],105:[2,144],109:[2,144],117:[2,144],125:[2,144],127:[2,144],128:[2,144],131:[2,144],132:[2,144],133:[2,144],134:[2,144],135:[2,144],136:[2,144]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],72:[2,152],77:[2,152],85:[2,152],90:[2,152],92:[2,152],101:[2,152],103:[2,152],104:[2,152],105:[2,152],109:[2,152],117:[2,152],125:[2,152],127:[2,152],128:[2,152],131:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152]},{25:[1,214],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{119:215,121:216,122:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],72:[2,96],77:[2,96],85:[2,96],90:[2,96],92:[2,96],101:[2,96],103:[2,96],104:[2,96],105:[2,96],109:[2,96],117:[2,96],125:[2,96],127:[2,96],128:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96]},{8:218,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,99],5:219,6:[2,99],25:[1,5],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,99],73:[2,72],77:[2,99],79:[1,220],83:[2,72],84:[2,72],85:[2,99],90:[2,99],92:[2,99],101:[2,99],103:[2,99],104:[2,99],105:[2,99],109:[2,99],117:[2,99],125:[2,99],127:[2,99],128:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],72:[2,137],77:[2,137],85:[2,137],90:[2,137],92:[2,137],101:[2,137],102:87,103:[2,137],104:[2,137],105:[2,137],108:88,109:[2,137],110:69,117:[2,137],125:[2,137],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,46],6:[2,46],26:[2,46],101:[2,46],102:87,103:[2,46],105:[2,46],108:88,109:[2,46],110:69,125:[2,46],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,74],101:[1,221]},{4:222,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],90:[2,128],91:223,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],70:[2,114],72:[2,114],73:[2,114],77:[2,114],83:[2,114],84:[2,114],85:[2,114],90:[2,114],92:[2,114],101:[2,114],103:[2,114],104:[2,114],105:[2,114],109:[2,114],115:[2,114],116:[2,114],117:[2,114],125:[2,114],127:[2,114],128:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114]},{6:[2,53],25:[2,53],53:225,54:[1,226],90:[2,53]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],85:[2,123],90:[2,123]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:227,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],85:[2,129],90:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],70:[2,113],72:[2,113],73:[2,113],77:[2,113],79:[2,113],83:[2,113],84:[2,113],85:[2,113],90:[2,113],92:[2,113],101:[2,113],103:[2,113],104:[2,113],105:[2,113],109:[2,113],115:[2,113],116:[2,113],117:[2,113],125:[2,113],127:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113]},{5:228,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],72:[2,140],77:[2,140],85:[2,140],90:[2,140],92:[2,140],101:[2,140],102:87,103:[1,65],104:[1,229],105:[1,66],108:88,109:[1,68],110:69,117:[2,140],125:[2,140],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],72:[2,142],77:[2,142],85:[2,142],90:[2,142],92:[2,142],101:[2,142],102:87,103:[1,65],104:[1,230],105:[1,66],108:88,109:[1,68],110:69,117:[2,142],125:[2,142],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],72:[2,148],77:[2,148],85:[2,148],90:[2,148],92:[2,148],101:[2,148],103:[2,148],104:[2,148],105:[2,148],109:[2,148],117:[2,148],125:[2,148],127:[2,148],128:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],72:[2,149],77:[2,149],85:[2,149],90:[2,149],92:[2,149],101:[2,149],102:87,103:[1,65],104:[2,149],105:[1,66],108:88,109:[1,68],110:69,117:[2,149],125:[2,149],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],72:[2,153],77:[2,153],85:[2,153],90:[2,153],92:[2,153],101:[2,153],103:[2,153],104:[2,153],105:[2,153],109:[2,153],117:[2,153],125:[2,153],127:[2,153],128:[2,153],131:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153]},{115:[2,155],116:[2,155]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],112:231,114:157},{54:[1,232],115:[2,161],116:[2,161]},{54:[2,157],115:[2,157],116:[2,157]},{54:[2,158],115:[2,158],116:[2,158]},{54:[2,159],115:[2,159],116:[2,159]},{54:[2,160],115:[2,160],116:[2,160]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],72:[2,154],77:[2,154],85:[2,154],90:[2,154],92:[2,154],101:[2,154],103:[2,154],104:[2,154],105:[2,154],109:[2,154],117:[2,154],125:[2,154],127:[2,154],128:[2,154],131:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154]},{8:233,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:234,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],53:235,54:[1,236],77:[2,53]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],77:[2,91]},{6:[2,39],25:[2,39],26:[2,39],43:[1,237],54:[2,39],77:[2,39]},{6:[2,42],25:[2,42],26:[2,42],54:[2,42],77:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],77:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],77:[2,44]},{6:[2,45],25:[2,45],26:[2,45],43:[2,45],54:[2,45],77:[2,45]},{1:[2,5],6:[2,5],26:[2,5],101:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],49:[2,25],54:[2,25],57:[2,25],72:[2,25],77:[2,25],85:[2,25],90:[2,25],92:[2,25],97:[2,25],98:[2,25],101:[2,25],103:[2,25],104:[2,25],105:[2,25],109:[2,25],117:[2,25],120:[2,25],122:[2,25],125:[2,25],127:[2,25],128:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],72:[2,192],77:[2,192],85:[2,192],90:[2,192],92:[2,192],101:[2,192],102:87,103:[2,192],104:[2,192],105:[2,192],108:88,109:[2,192],110:69,117:[2,192],125:[2,192],127:[2,192],128:[2,192],131:[1,78],132:[1,81],133:[2,192],134:[2,192],135:[2,192],136:[2,192]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],72:[2,193],77:[2,193],85:[2,193],90:[2,193],92:[2,193],101:[2,193],102:87,103:[2,193],104:[2,193],105:[2,193],108:88,109:[2,193],110:69,117:[2,193],125:[2,193],127:[2,193],128:[2,193],131:[1,78],132:[1,81],133:[2,193],134:[2,193],135:[2,193],136:[2,193]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],72:[2,194],77:[2,194],85:[2,194],90:[2,194],92:[2,194],101:[2,194],102:87,103:[2,194],104:[2,194],105:[2,194],108:88,109:[2,194],110:69,117:[2,194],125:[2,194],127:[2,194],128:[2,194],131:[1,78],132:[2,194],133:[2,194],134:[2,194],135:[2,194],136:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],72:[2,195],77:[2,195],85:[2,195],90:[2,195],92:[2,195],101:[2,195],102:87,103:[2,195],104:[2,195],105:[2,195],108:88,109:[2,195],110:69,117:[2,195],125:[2,195],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[2,195],134:[2,195],135:[2,195],136:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],72:[2,196],77:[2,196],85:[2,196],90:[2,196],92:[2,196],101:[2,196],102:87,103:[2,196],104:[2,196],105:[2,196],108:88,109:[2,196],110:69,117:[2,196],125:[2,196],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,196],135:[2,196],136:[1,85]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],72:[2,197],77:[2,197],85:[2,197],90:[2,197],92:[2,197],101:[2,197],102:87,103:[2,197],104:[2,197],105:[2,197],108:88,109:[2,197],110:69,117:[2,197],125:[2,197],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[2,197],136:[1,85]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],72:[2,198],77:[2,198],85:[2,198],90:[2,198],92:[2,198],101:[2,198],102:87,103:[2,198],104:[2,198],105:[2,198],108:88,109:[2,198],110:69,117:[2,198],125:[2,198],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,198],135:[2,198],136:[2,198]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],72:[2,183],77:[2,183],85:[2,183],90:[2,183],92:[2,183],101:[2,183],102:87,103:[1,65],104:[2,183],105:[1,66],108:88,109:[1,68],110:69,117:[2,183],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],72:[2,182],77:[2,182],85:[2,182],90:[2,182],92:[2,182],101:[2,182],102:87,103:[1,65],104:[2,182],105:[1,66],108:88,109:[1,68],110:69,117:[2,182],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],66:[2,103],67:[2,103],68:[2,103],70:[2,103],72:[2,103],73:[2,103],77:[2,103],83:[2,103],84:[2,103],85:[2,103],90:[2,103],92:[2,103],101:[2,103],103:[2,103],104:[2,103],105:[2,103],109:[2,103],117:[2,103],125:[2,103],127:[2,103],128:[2,103],131:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],70:[2,80],72:[2,80],73:[2,80],77:[2,80],79:[2,80],83:[2,80],84:[2,80],85:[2,80],90:[2,80],92:[2,80],101:[2,80],103:[2,80],104:[2,80],105:[2,80],109:[2,80],117:[2,80],125:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],70:[2,81],72:[2,81],73:[2,81],77:[2,81],79:[2,81],83:[2,81],84:[2,81],85:[2,81],90:[2,81],92:[2,81],101:[2,81],103:[2,81],104:[2,81],105:[2,81],109:[2,81],117:[2,81],125:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],70:[2,82],72:[2,82],73:[2,82],77:[2,82],79:[2,82],83:[2,82],84:[2,82],85:[2,82],90:[2,82],92:[2,82],101:[2,82],103:[2,82],104:[2,82],105:[2,82],109:[2,82],117:[2,82],125:[2,82],127:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82]},{72:[1,238]},{57:[1,192],72:[2,87],91:239,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{72:[2,88]},{8:240,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,122],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{12:[2,116],28:[2,116],30:[2,116],31:[2,116],33:[2,116],34:[2,116],35:[2,116],36:[2,116],37:[2,116],38:[2,116],45:[2,116],46:[2,116],47:[2,116],51:[2,116],52:[2,116],72:[2,116],75:[2,116],78:[2,116],82:[2,116],87:[2,116],88:[2,116],89:[2,116],95:[2,116],99:[2,116],100:[2,116],103:[2,116],105:[2,116],107:[2,116],109:[2,116],118:[2,116],124:[2,116],126:[2,116],127:[2,116],128:[2,116],129:[2,116],130:[2,116]},{12:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],72:[2,117],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],70:[2,86],72:[2,86],73:[2,86],77:[2,86],79:[2,86],83:[2,86],84:[2,86],85:[2,86],90:[2,86],92:[2,86],101:[2,86],103:[2,86],104:[2,86],105:[2,86],109:[2,86],117:[2,86],125:[2,86],127:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],70:[2,104],72:[2,104],73:[2,104],77:[2,104],83:[2,104],84:[2,104],85:[2,104],90:[2,104],92:[2,104],101:[2,104],103:[2,104],104:[2,104],105:[2,104],109:[2,104],117:[2,104],125:[2,104],127:[2,104],128:[2,104],131:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],72:[2,36],77:[2,36],85:[2,36],90:[2,36],92:[2,36],101:[2,36],102:87,103:[2,36],104:[2,36],105:[2,36],108:88,109:[2,36],110:69,117:[2,36],125:[2,36],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:241,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:242,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],49:[2,109],54:[2,109],57:[2,109],66:[2,109],67:[2,109],68:[2,109],70:[2,109],72:[2,109],73:[2,109],77:[2,109],83:[2,109],84:[2,109],85:[2,109],90:[2,109],92:[2,109],101:[2,109],103:[2,109],104:[2,109],105:[2,109],109:[2,109],117:[2,109],125:[2,109],127:[2,109],128:[2,109],131:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109],136:[2,109]},{6:[2,53],25:[2,53],53:243,54:[1,226],85:[2,53]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],57:[1,244],85:[2,128],90:[2,128],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{50:245,51:[1,60],52:[1,61]},{6:[2,54],25:[2,54],26:[2,54],27:109,28:[1,73],44:110,55:246,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[1,247],25:[1,248]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61]},{8:249,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],72:[2,199],77:[2,199],85:[2,199],90:[2,199],92:[2,199],101:[2,199],102:87,103:[2,199],104:[2,199],105:[2,199],108:88,109:[2,199],110:69,117:[2,199],125:[2,199],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:250,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],72:[2,201],77:[2,201],85:[2,201],90:[2,201],92:[2,201],101:[2,201],102:87,103:[2,201],104:[2,201],105:[2,201],108:88,109:[2,201],110:69,117:[2,201],125:[2,201],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],72:[2,181],77:[2,181],85:[2,181],90:[2,181],92:[2,181],101:[2,181],103:[2,181],104:[2,181],105:[2,181],109:[2,181],117:[2,181],125:[2,181],127:[2,181],128:[2,181],131:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181]},{8:251,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],72:[2,133],77:[2,133],85:[2,133],90:[2,133],92:[2,133],97:[1,252],101:[2,133],103:[2,133],104:[2,133],105:[2,133],109:[2,133],117:[2,133],125:[2,133],127:[2,133],128:[2,133],131:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133]},{5:253,25:[1,5]},{27:254,28:[1,73]},{119:255,121:216,122:[1,217]},{26:[1,256],120:[1,257],121:258,122:[1,217]},{26:[2,174],120:[2,174],122:[2,174]},{8:260,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],94:259,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,97],5:261,6:[2,97],25:[1,5],26:[2,97],49:[2,97],54:[2,97],57:[2,97],72:[2,97],77:[2,97],85:[2,97],90:[2,97],92:[2,97],101:[2,97],102:87,103:[1,65],104:[2,97],105:[1,66],108:88,109:[1,68],110:69,117:[2,97],125:[2,97],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],49:[2,100],54:[2,100],57:[2,100],72:[2,100],77:[2,100],85:[2,100],90:[2,100],92:[2,100],101:[2,100],103:[2,100],104:[2,100],105:[2,100],109:[2,100],117:[2,100],125:[2,100],127:[2,100],128:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100]},{8:262,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],66:[2,138],67:[2,138],68:[2,138],70:[2,138],72:[2,138],73:[2,138],77:[2,138],83:[2,138],84:[2,138],85:[2,138],90:[2,138],92:[2,138],101:[2,138],103:[2,138],104:[2,138],105:[2,138],109:[2,138],117:[2,138],125:[2,138],127:[2,138],128:[2,138],131:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138]},{6:[1,74],26:[1,263]},{8:264,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,67],12:[2,117],25:[2,67],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],54:[2,67],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],90:[2,67],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{6:[1,266],25:[1,267],90:[1,265]},{6:[2,54],8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[2,54],26:[2,54],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[2,54],87:[1,58],88:[1,59],89:[1,57],90:[2,54],93:268,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],26:[2,53],53:269,54:[1,226]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],49:[2,178],54:[2,178],57:[2,178],72:[2,178],77:[2,178],85:[2,178],90:[2,178],92:[2,178],101:[2,178],103:[2,178],104:[2,178],105:[2,178],109:[2,178],117:[2,178],120:[2,178],125:[2,178],127:[2,178],128:[2,178],131:[2,178],132:[2,178],133:[2,178],134:[2,178],135:[2,178],136:[2,178]},{8:270,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:271,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{115:[2,156],116:[2,156]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],114:272},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],49:[2,163],54:[2,163],57:[2,163],72:[2,163],77:[2,163],85:[2,163],90:[2,163],92:[2,163],101:[2,163],102:87,103:[2,163],104:[1,273],105:[2,163],108:88,109:[2,163],110:69,117:[1,274],125:[2,163],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],49:[2,164],54:[2,164],57:[2,164],72:[2,164],77:[2,164],85:[2,164],90:[2,164],92:[2,164],101:[2,164],102:87,103:[2,164],104:[1,275],105:[2,164],108:88,109:[2,164],110:69,117:[2,164],125:[2,164],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,277],25:[1,278],77:[1,276]},{6:[2,54],11:168,25:[2,54],26:[2,54],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:279,42:167,44:171,46:[1,46],77:[2,54],88:[1,113]},{8:280,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,281],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],70:[2,85],72:[2,85],73:[2,85],77:[2,85],79:[2,85],83:[2,85],84:[2,85],85:[2,85],90:[2,85],92:[2,85],101:[2,85],103:[2,85],104:[2,85],105:[2,85],109:[2,85],117:[2,85],125:[2,85],127:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85]},{8:282,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,120],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,121],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],72:[2,37],77:[2,37],85:[2,37],90:[2,37],92:[2,37],101:[2,37],102:87,103:[2,37],104:[2,37],105:[2,37],108:88,109:[2,37],110:69,117:[2,37],125:[2,37],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,283],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],85:[1,284]},{6:[2,67],25:[2,67],26:[2,67],54:[2,67],85:[2,67],90:[2,67]},{5:285,25:[1,5]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{27:109,28:[1,73],44:110,55:286,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,55],25:[2,55],26:[2,55],27:109,28:[1,73],44:110,48:287,54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,62],25:[2,62],26:[2,62],49:[2,62],54:[2,62],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,288],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:289,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:290,25:[1,5]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],72:[2,134],77:[2,134],85:[2,134],90:[2,134],92:[2,134],101:[2,134],103:[2,134],104:[2,134],105:[2,134],109:[2,134],117:[2,134],125:[2,134],127:[2,134],128:[2,134],131:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134]},{5:291,25:[1,5]},{26:[1,292],120:[1,293],121:258,122:[1,217]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],72:[2,172],77:[2,172],85:[2,172],90:[2,172],92:[2,172],101:[2,172],103:[2,172],104:[2,172],105:[2,172],109:[2,172],117:[2,172],125:[2,172],127:[2,172],128:[2,172],131:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172]},{5:294,25:[1,5]},{26:[2,175],120:[2,175],122:[2,175]},{5:295,25:[1,5],54:[1,296]},{25:[2,130],54:[2,130],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],49:[2,98],54:[2,98],57:[2,98],72:[2,98],77:[2,98],85:[2,98],90:[2,98],92:[2,98],101:[2,98],103:[2,98],104:[2,98],105:[2,98],109:[2,98],117:[2,98],125:[2,98],127:[2,98],128:[2,98],131:[2,98],132:[2,98],133:[2,98],134:[2,98],135:[2,98],136:[2,98]},{1:[2,101],5:297,6:[2,101],25:[1,5],26:[2,101],49:[2,101],54:[2,101],57:[2,101],72:[2,101],77:[2,101],85:[2,101],90:[2,101],92:[2,101],101:[2,101],102:87,103:[1,65],104:[2,101],105:[1,66],108:88,109:[1,68],110:69,117:[2,101],125:[2,101],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{101:[1,298]},{90:[1,299],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],70:[2,115],72:[2,115],73:[2,115],77:[2,115],83:[2,115],84:[2,115],85:[2,115],90:[2,115],92:[2,115],101:[2,115],103:[2,115],104:[2,115],105:[2,115],109:[2,115],115:[2,115],116:[2,115],117:[2,115],125:[2,115],127:[2,115],128:[2,115],131:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],93:300,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:301,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],85:[2,124],90:[2,124]},{6:[1,266],25:[1,267],26:[1,302]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],72:[2,141],77:[2,141],85:[2,141],90:[2,141],92:[2,141],101:[2,141],102:87,103:[1,65],104:[2,141],105:[1,66],108:88,109:[1,68],110:69,117:[2,141],125:[2,141],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],72:[2,143],77:[2,143],85:[2,143],90:[2,143],92:[2,143],101:[2,143],102:87,103:[1,65],104:[2,143],105:[1,66],108:88,109:[1,68],110:69,117:[2,143],125:[2,143],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{115:[2,162],116:[2,162]},{8:303,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:304,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:305,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,89],6:[2,89],25:[2,89],26:[2,89],40:[2,89],49:[2,89],54:[2,89],57:[2,89],66:[2,89],67:[2,89],68:[2,89],70:[2,89],72:[2,89],73:[2,89],77:[2,89],83:[2,89],84:[2,89],85:[2,89],90:[2,89],92:[2,89],101:[2,89],103:[2,89],104:[2,89],105:[2,89],109:[2,89],115:[2,89],116:[2,89],117:[2,89],125:[2,89],127:[2,89],128:[2,89],131:[2,89],132:[2,89],133:[2,89],134:[2,89],135:[2,89],136:[2,89]},{11:168,27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:306,42:167,44:171,46:[1,46],88:[1,113]},{6:[2,90],11:168,25:[2,90],26:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:307,88:[1,113]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],77:[2,92]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],77:[2,40],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:308,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,119],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,38],6:[2,38],25:[2,38],26:[2,38],49:[2,38],54:[2,38],57:[2,38],72:[2,38],77:[2,38],85:[2,38],90:[2,38],92:[2,38],101:[2,38],103:[2,38],104:[2,38],105:[2,38],109:[2,38],117:[2,38],125:[2,38],127:[2,38],128:[2,38],131:[2,38],132:[2,38],133:[2,38],134:[2,38],135:[2,38],136:[2,38]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],70:[2,110],72:[2,110],73:[2,110],77:[2,110],83:[2,110],84:[2,110],85:[2,110],90:[2,110],92:[2,110],101:[2,110],103:[2,110],104:[2,110],105:[2,110],109:[2,110],117:[2,110],125:[2,110],127:[2,110],128:[2,110],131:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],72:[2,49],77:[2,49],85:[2,49],90:[2,49],92:[2,49],101:[2,49],103:[2,49],104:[2,49],105:[2,49],109:[2,49],117:[2,49],125:[2,49],127:[2,49],128:[2,49],131:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{6:[2,53],25:[2,53],26:[2,53],53:309,54:[1,202]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],72:[2,200],77:[2,200],85:[2,200],90:[2,200],92:[2,200],101:[2,200],103:[2,200],104:[2,200],105:[2,200],109:[2,200],117:[2,200],125:[2,200],127:[2,200],128:[2,200],131:[2,200],132:[2,200],133:[2,200],134:[2,200],135:[2,200],136:[2,200]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],49:[2,179],54:[2,179],57:[2,179],72:[2,179],77:[2,179],85:[2,179],90:[2,179],92:[2,179],101:[2,179],103:[2,179],104:[2,179],105:[2,179],109:[2,179],117:[2,179],120:[2,179],125:[2,179],127:[2,179],128:[2,179],131:[2,179],132:[2,179],133:[2,179],134:[2,179],135:[2,179],136:[2,179]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],72:[2,135],77:[2,135],85:[2,135],90:[2,135],92:[2,135],101:[2,135],103:[2,135],104:[2,135],105:[2,135],109:[2,135],117:[2,135],125:[2,135],127:[2,135],128:[2,135],131:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],72:[2,136],77:[2,136],85:[2,136],90:[2,136],92:[2,136],97:[2,136],101:[2,136],103:[2,136],104:[2,136],105:[2,136],109:[2,136],117:[2,136],125:[2,136],127:[2,136],128:[2,136],131:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],72:[2,170],77:[2,170],85:[2,170],90:[2,170],92:[2,170],101:[2,170],103:[2,170],104:[2,170],105:[2,170],109:[2,170],117:[2,170],125:[2,170],127:[2,170],128:[2,170],131:[2,170],132:[2,170],133:[2,170],134:[2,170],135:[2,170],136:[2,170]},{5:310,25:[1,5]},{26:[1,311]},{6:[1,312],26:[2,176],120:[2,176],122:[2,176]},{8:313,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],49:[2,102],54:[2,102],57:[2,102],72:[2,102],77:[2,102],85:[2,102],90:[2,102],92:[2,102],101:[2,102],103:[2,102],104:[2,102],105:[2,102],109:[2,102],117:[2,102],125:[2,102],127:[2,102],128:[2,102],131:[2,102],132:[2,102],133:[2,102],134:[2,102],135:[2,102],136:[2,102]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],66:[2,139],67:[2,139],68:[2,139],70:[2,139],72:[2,139],73:[2,139],77:[2,139],83:[2,139],84:[2,139],85:[2,139],90:[2,139],92:[2,139],101:[2,139],103:[2,139],104:[2,139],105:[2,139],109:[2,139],117:[2,139],125:[2,139],127:[2,139],128:[2,139],131:[2,139],132:[2,139],133:[2,139],134:[2,139],135:[2,139],136:[2,139]},{1:[2,118],6:[2,118],25:[2,118],26:[2,118],49:[2,118],54:[2,118],57:[2,118],66:[2,118],67:[2,118],68:[2,118],70:[2,118],72:[2,118],73:[2,118],77:[2,118],83:[2,118],84:[2,118],85:[2,118],90:[2,118],92:[2,118],101:[2,118],103:[2,118],104:[2,118],105:[2,118],109:[2,118],117:[2,118],125:[2,118],127:[2,118],128:[2,118],131:[2,118],132:[2,118],133:[2,118],134:[2,118],135:[2,118],136:[2,118]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],85:[2,125],90:[2,125]},{6:[2,53],25:[2,53],26:[2,53],53:314,54:[1,226]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],85:[2,126],90:[2,126]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],72:[2,165],77:[2,165],85:[2,165],90:[2,165],92:[2,165],101:[2,165],102:87,103:[2,165],104:[2,165],105:[2,165],108:88,109:[2,165],110:69,117:[1,315],125:[2,165],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],72:[2,167],77:[2,167],85:[2,167],90:[2,167],92:[2,167],101:[2,167],102:87,103:[2,167],104:[1,316],105:[2,167],108:88,109:[2,167],110:69,117:[2,167],125:[2,167],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],72:[2,166],77:[2,166],85:[2,166],90:[2,166],92:[2,166],101:[2,166],102:87,103:[2,166],104:[2,166],105:[2,166],108:88,109:[2,166],110:69,117:[2,166],125:[2,166],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],77:[2,93]},{6:[2,53],25:[2,53],26:[2,53],53:317,54:[1,236]},{26:[1,318],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,247],25:[1,248],26:[1,319]},{26:[1,320]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],72:[2,173],77:[2,173],85:[2,173],90:[2,173],92:[2,173],101:[2,173],103:[2,173],104:[2,173],105:[2,173],109:[2,173],117:[2,173],125:[2,173],127:[2,173],128:[2,173],131:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173]},{26:[2,177],120:[2,177],122:[2,177]},{25:[2,131],54:[2,131],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],26:[1,321]},{8:322,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:323,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[1,277],25:[1,278],26:[1,324]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],77:[2,41]},{6:[2,59],25:[2,59],26:[2,59],49:[2,59],54:[2,59]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],72:[2,171],77:[2,171],85:[2,171],90:[2,171],92:[2,171],101:[2,171],103:[2,171],104:[2,171],105:[2,171],109:[2,171],117:[2,171],125:[2,171],127:[2,171],128:[2,171],131:[2,171],132:[2,171],133:[2,171],134:[2,171],135:[2,171],136:[2,171]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],85:[2,127],90:[2,127]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],72:[2,168],77:[2,168],85:[2,168],90:[2,168],92:[2,168],101:[2,168],102:87,103:[2,168],104:[2,168],105:[2,168],108:88,109:[2,168],110:69,117:[2,168],125:[2,168],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],72:[2,169],77:[2,169],85:[2,169],90:[2,169],92:[2,169],101:[2,169],102:87,103:[2,169],104:[2,169],105:[2,169],108:88,109:[2,169],110:69,117:[2,169],125:[2,169],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],77:[2,94]}], +defaultActions: {60:[2,51],61:[2,52],75:[2,3],94:[2,108],189:[2,88]}, parseError: function parseError(str, hash) { - 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], // semantic value stack + lstack = [], // location stack + table = this.table, + yytext = '', + yylineno = 0, + yyleng = 0, + recovering = 0, + TERROR = 2, + EOF = 1; + + //this.reductionCount = this.shiftCount = 0; + 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; + + function popStack (n) { + stack.length = stack.length - 2*n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } + function lex() { var token; - token = self.lexer.lex() || EOF; + token = self.lexer.lex() || 1; // $end = 1 + // if token isn't its numeric value, convert if (typeof token !== 'number') { token = self.symbols_[token] || token; } return token; } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + + var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected; while (true) { - state = stack[stack.length - 1]; + // retreive state number from top of stack + state = stack[stack.length-1]; + + // use default actions if available if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { - if (symbol === null || typeof symbol == 'undefined') { + if (symbol == null) symbol = lex(); - } + // read action for current state and first input action = table[state] && table[state][symbol]; } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; + + // handle parse error + _handle_error: + if (typeof action === 'undefined' || !action.length || !action[0]) { + + if (!recovering) { + // Report error 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 /*EOF*/ ? "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); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { + + // just recovered from another error + if (recovering == 3) { + if (symbol == EOF) { + throw new Error(errStr || 'Parsing halted.'); + } + + // discard current lookahead and grab another yyleng = this.lexer.yyleng; yytext = this.lexer.yytext; yylineno = this.lexer.yylineno; yyloc = this.lexer.yylloc; - if (recovering > 0) { - recovering--; + symbol = lex(); + } + + // try to recover from error + while (1) { + // check for error recovery rule in this state + if ((TERROR.toString()) in table[state]) { + break; } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; + if (state == 0) { + throw new Error(errStr || 'Parsing halted.'); + } + popStack(1); + state = stack[stack.length-1]; } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; + + preErrorSymbol = symbol; // save the lookahead token + symbol = TERROR; // insert generic error symbol as new lookahead + state = stack[stack.length-1]; + action = table[state] && table[state][TERROR]; + recovering = 3; // allow 3 real symbols to be shifted before reporting a new error } + + // this shouldn't happen, unless resolve defaults are off + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol); + } + + switch (action[0]) { + + case 1: // shift + //this.shiftCount++; + + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); // push state + symbol = null; + if (!preErrorSymbol) { // normal execution/no error + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { // error just occurred, resume old lookahead f/ before error + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + + case 2: // reduce + //this.reductionCount++; + + len = this.productions_[action[1]][1]; + + // perform semantic action + yyval.$ = vstack[vstack.length-len]; // default to $$ = $1 + // default location, uses first token for firsts, last for lasts + yyval._$ = { + first_line: lstack[lstack.length-(len||1)].first_line, + last_line: lstack[lstack.length-1].last_line, + first_column: lstack[lstack.length-(len||1)].first_column, + last_column: lstack[lstack.length-1].last_column + }; + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + + if (typeof r !== 'undefined') { + return r; + } + + // pop off stack + if (len) { + stack = stack.slice(0,-1*len*2); + vstack = vstack.slice(0, -1*len); + lstack = lstack.slice(0, -1*len); + } + + stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce) + vstack.push(yyval.$); + lstack.push(yyval._$); + // goto new state = table[STATE][NONTERMINAL] + newState = table[stack[stack.length-2]][stack[stack.length-1]]; + stack.push(newState); + break; + + case 3: // accept + return true; + } + } + 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..6e06f844 100644 --- a/lib/ace/mode/coffee/parser_test.js +++ b/lib/ace/mode/coffee/parser_test.js @@ -38,46 +38,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..f500e3d5 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) 2009-2012 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,35 +21,29 @@ * 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.3.3 - 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() { + 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; }; @@ -98,6 +92,17 @@ define(function(require, exports, module) { } }; + Rewriter.prototype.removeMidExpressionNewlines = function() { + return this.scanTokens(function(token, i, tokens) { + var _ref; + if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) { + return 1; + } + tokens.splice(i, 1); + return 0; + }); + }; + Rewriter.prototype.closeOpenCalls = function() { var action, condition; condition = function(token, i) { @@ -132,289 +137,144 @@ define(function(require, exports, module) { }); }; - 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) { + Rewriter.prototype.addImplicitBraces = function() { + var action, condition, sameLine, stack, start, startIndent, startIndex, startsLine; + stack = []; + start = null; + startsLine = null; + sameLine = true; + startIndent = 0; + startIndex = 0; + condition = function(token, i) { + var one, tag, three, two, _ref, _ref1; + _ref = this.tokens.slice(i + 1, +(i + 3) + 1 || 9e9), one = _ref[0], two = _ref[1], three = _ref[2]; + if ('HERECOMMENT' === (one != null ? one[0] : void 0)) { return false; } - } - 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; - 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; 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 (__indexOf.call(LINEBREAKS, tag) >= 0) { + sameLine = false; } - 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); + return (((tag === 'TERMINATOR' || tag === 'OUTDENT') || (__indexOf.call(IMPLICIT_END, tag) >= 0 && sameLine && !(i - startIndex === 1))) && ((!startsLine && this.tag(i - 1) !== ',') || !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':'))) || (tag === ',' && one && ((_ref1 = one[0]) !== 'IDENTIFIER' && _ref1 !== 'NUMBER' && _ref1 !== 'STRING' && _ref1 !== '@' && _ref1 !== 'TERMINATOR' && _ref1 !== 'OUTDENT')); + }; + action = function(token, i) { + var tok; + tok = this.generate('}', '}', token[2]); + return this.tokens.splice(i, 0, tok); + }; + return this.scanTokens(function(token, i, tokens) { + var ago, idx, prevTag, tag, tok, value, _ref, _ref1; + if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) { + stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]); + return 1; } if (__indexOf.call(EXPRESSION_END, tag) >= 0) { - 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; + startIndex = i + 1; + 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 (!(token.generated || token.explicit)) { + 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[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; + tokens.splice(i, 0, this.generate('CALL_START', '(', token[2])); + this.detectEnd(i + 1, condition, action); + if (prev[0] === '?') { + prev[0] = 'FUNC_EXIST'; } - token[2] = { - first_line: line, - first_column: column, - last_line: line, - last_column: column - }; - return 1; + 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]; + _ref1 = this.indentation(token, true), indent = _ref1[0], outdent = _ref1[1]; if (starter === 'THEN') { indent.fromThen = true; } @@ -433,10 +293,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)) { @@ -453,23 +311,25 @@ define(function(require, exports, module) { }); }; - 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]; + indent = ['INDENT', 2, token[2]]; + outdent = ['OUTDENT', 2, token[2]]; if (implicit) { indent.generated = outdent.generated = true; } - if (!implicit) { - indent.explicit = outdent.explicit = 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 +354,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', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++']; IMPLICIT_UNSPACED_CALL = ['+', '-']; + IMPLICIT_BLOCK = ['->', '=>', '{', '[', ',']; + IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; @@ -510,7 +372,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..11c0f795 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) 2009-2012 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,17 +21,17 @@ * 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.3.3 var Scope, extend, last, _ref; _ref = require('./helpers'), extend = _ref.extend, last = _ref.last; exports.Scope = Scope = (function() { + Scope.root = null; function Scope(parent, expressions, method) { @@ -65,8 +65,7 @@ define(function(require, exports, module) { }; Scope.prototype.namedMethod = function() { - var _ref1; - if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) { + if (this.method.name || !this.parent) { return this.method; } return this.parent.namedMethod(); diff --git a/lib/ace/mode/coffee_highlight_rules.js b/lib/ace/mode/coffee_highlight_rules.js index 94c9476f..80fb7ffa 100644 --- a/lib/ace/mode/coffee_highlight_rules.js +++ b/lib/ace/mode/coffee_highlight_rules.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -38,10 +38,15 @@ define(function(require, exports, module) { function CoffeeHighlightRules() { var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; + var stringfill = { + token : "string", + merge : true, + regex : ".+" + }; var keywords = ( "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + - "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + + "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" ); @@ -82,74 +87,58 @@ define(function(require, exports, module) { "variable.language": variableLanguage }, "identifier"); - var functionRule = { - token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], - regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source + var functionRules = { + "({args})->": { + token: ["paren.lparen", "text", "paren.lparen", "text", "variable.parameter", "text", "paren.rparen", "text", "paren.rparen", "text", "storage.type"], + regex: "(\\()(\\s*)(\\{)(\\s*)([$@A-Za-z_\\x7f-\\uffff][$@\\w\\s,\\x7f-\\uffff]*)(\\s*)(\\})(\\s*)(\\))(\\s*)([\\-=]>)" + }, + "({})->": { + token: ["paren.lparen", "text", "paren.lparen", "text", "paren.rparen", "text", "paren.rparen", "text", "storage.type"], + regex: "(\\()(\\s*)(\\{)(\\s*)(\\})(\\s*)(\\))(\\s*)([\\-=]>)" + }, + "(args)->": { + token: ["paren.lparen", "text", "variable.parameter", "text", "paren.rparen", "text", "storage.type"], + regex: "(\\()(\\s*)([$@A-Za-z_\\x7f-\\uffff][\\s\\x21-\\uffff]*)(\\s*)(\\))(\\s*)([\\-=]>)" + }, + "()->": { + token: ["paren.lparen", "text", "paren.rparen", "text", "storage.type"], + regex: "(\\()(\\s*)(\\))(\\s*)([\\-=]>)" + } }; - var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; - this.$rules = { start : [ { 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" }, { @@ -157,29 +146,101 @@ define(function(require, exports, module) { regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\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", "identifier" + ], + regex : "(\\.)(" + 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 + "))?" + 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 + //class A + token : [ + "keyword", "text", "language.support.class" + ], + regex : "(class)(\\s+)(" + identifier + ")" + }, { + //play = ({args}) -> + token : [ + "entity.name.function", "text", "keyword.operator", "text" + ].concat(functionRules["({args})->"].token), + regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["({args})->"].regex + }, { + //play : ({args}) -> + token : [ + "entity.name.function", "text", "punctuation.operator", "text" + ].concat(functionRules["({args})->"].token), + regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["({args})->"].regex + }, { + //play = ({}) -> + token : [ + "entity.name.function", "text", "keyword.operator", "text" + ].concat(functionRules["({})->"].token), + regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["({})->"].regex + }, { + //play : ({}) -> + token : [ + "entity.name.function", "text", "punctuation.operator", "text" + ].concat(functionRules["({})->"].token), + regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["({})->"].regex + }, { + //play = (args) -> + token : [ + "entity.name.function", "text", "keyword.operator", "text" + ].concat(functionRules["(args)->"].token), + regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["(args)->"].regex + }, { + //play : (args) -> + token : [ + "entity.name.function", "text", "punctuation.operator", "text" + ].concat(functionRules["(args)->"].token), + regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["(args)->"].regex + }, { + //play = () -> + token : [ + "entity.name.function", "text", "keyword.operator", "text" + ].concat(functionRules["()->"].token), + regex : "(" + identifier + ")(\\s*)(=)(\\s*)" + functionRules["()->"].regex + }, { + //play : () -> + token : [ + "entity.name.function", "text", "punctuation.operator", "text" + ].concat(functionRules["()->"].token), + regex : "(" + identifier + ")(\\s*)(:)(\\s*)" + functionRules["()->"].regex + }, { + //play = -> + token : [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type" + ], + regex : "(" + identifier + ")(\\s*)(=)(\\s*)([\\-=]>)" + }, { + //play : -> + token : [ + "entity.name.function", "text", "punctuation.operator", "text", "storage.type" + ], + regex : "(" + identifier + ")(\\s*)(:)(\\s*)([\\-=]>)" }, - functionRule, - { + functionRules["({args})->"], + functionRules["({})->"], + functionRules["(args)->"], + functionRules["()->"] + , { + token : "identifier", + regex : "(?:(?:\\.|::)\\s*)" + identifier + }, { token : "variable", regex : "@(?:" + identifier + ")?" }, { @@ -187,7 +248,7 @@ define(function(require, exports, module) { regex : identifier }, { token : "punctuation.operator", - regex : "\\,|\\." + regex : "\\?|\\:|\\,|\\." }, { token : "storage.type", regex : "[\\-=]>" @@ -205,6 +266,38 @@ define(function(require, exports, module) { 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", @@ -215,18 +308,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..a7cb85db --- /dev/null +++ b/lib/ace/mode/coffee_highlight_rules_test.js @@ -0,0 +1,266 @@ +/* ***** 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 Mode = require("./coffee").Mode; +var assert = require("../test/assertions"); + +module.exports = { + setUp : function() { + this.tokenizer = new Mode().getTokenizer(); + this.testTokens = function(tokens, correct) { + assert.equal(tokens.length, correct.length); + correct.forEach(function(type, i) { + assert.equal(tokens[i].type, type); + }); + }; + }, + + "test: tokenize keyword": function() { + var tokens = this.tokenizer.getLineTokens("for", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, "keyword"); + }, + + "test: tokenize regexp": function() { + var tokens = this.tokenizer.getLineTokens('/"[a]/', "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, "string.regex"); + }, + + "test: tokenize function: 'foo = ({args}) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo = ({args}) ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "keyword.operator", "text", + "paren.lparen", "paren.lparen", "variable.parameter", "paren.rparen", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo = ({a1, a2}) ->", "start").tokens; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo = ({@a1, a2}) ->", "start").tokens; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: 'foo : ({args}) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo : ({args}) ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "punctuation.operator", "text", + "paren.lparen", "paren.lparen", "variable.parameter", "paren.rparen", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: invalid case: 'foo = ({args}) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo = ({0abc}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + + tokens = this.tokenizer.getLineTokens("foo = ({/abc}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + + tokens = this.tokenizer.getLineTokens("foo = ({abc/}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + + tokens = this.tokenizer.getLineTokens("foo = ({#abc}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + + tokens = this.tokenizer.getLineTokens("foo = ({abc#}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + + tokens = this.tokenizer.getLineTokens("foo = ({)abc}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + + tokens = this.tokenizer.getLineTokens("foo = ({abc)}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + + tokens = this.tokenizer.getLineTokens("foo = ({a{bc}) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + }, + + "test: tokenize function: 'foo = ({}) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo = ({}) ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "keyword.operator", "text", + "paren.lparen", "paren.lparen", "paren.rparen", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo = ({ }) ->", "start").tokens; + correct = [ + "entity.name.function", "text", "keyword.operator", "text", + "paren.lparen", "paren.lparen", "text", "paren.rparen", "paren.rparen", "text", "storage.type" + ]; + assert.equal(tokens.length, 11); + this.testTokens(tokens, correct); + }, + + "test: tokenize function: 'foo : ({}) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo : ({}) ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "punctuation.operator", "text", + "paren.lparen", "paren.lparen", "paren.rparen", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: 'foo = (args) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo = (args) ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "keyword.operator", "text", + "paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo = (arg1, arg2) ->", "start").tokens; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo = (arg1 = 1, arg2 = 'name') ->", "start").tokens; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo = (@arg1 = /abc/, arg2 = 'name') ->", "start").tokens; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: invalid case: 'foo=(args) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo=(/args) ->", "start").tokens; + assert.notEqual(tokens[0].type, "entity.name.function"); + }, + + "test: tokenize function: 'foo = () ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo = () ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "keyword.operator", "text", + "paren.lparen", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo = ( ) ->", "start").tokens; + correct = [ + "entity.name.function", "text", "keyword.operator", "text", + "paren.lparen", "text", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: 'foo : () ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo : () ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "punctuation.operator", "text", + "paren.lparen", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + + tokens = this.tokenizer.getLineTokens("foo : ( ) ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "punctuation.operator", "text", + "paren.lparen", "text", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: 'window.foo = (args) ->'": function() { + var tokens = this.tokenizer.getLineTokens("window.foo = (args) ->", "start").tokens; + var correct = [ + "variable.language", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", + "paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: 'foo = ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo = ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "keyword.operator", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize function: 'foo : ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo : ->", "start").tokens; + var correct = [ + "entity.name.function", "text", "punctuation.operator", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize callback function: 'foo bar: 1, (args) ->'": function() { + var tokens = this.tokenizer.getLineTokens("foo bar: 1, (args) ->", "start").tokens; + var correct = [ + "identifier", "text", "identifier", "punctuation.operator", "text", "constant.numeric", "punctuation.operator", "text", + "paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize class: 'class Foo'": function() { + var tokens = this.tokenizer.getLineTokens("class Foo", "start").tokens; + var correct = [ + "keyword", "text", "language.support.class" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize class 'class Foo extends Bar'": function() { + var tokens = this.tokenizer.getLineTokens("class Foo extends Bar", "start").tokens; + var correct = [ + "keyword", "text", "language.support.class", "text", "keyword", "text", "language.support.class" + ]; + this.testTokens(tokens, correct); + }, + + "test: tokenize illegal name property: 'foo.static.function'": function() { + var tokens = this.tokenizer.getLineTokens("foo.static.function", "start").tokens; + var correct = [ + "identifier", "punctuation.operator", "identifier", "punctuation.operator", "identifier" + ]; + this.testTokens(tokens, correct); + }, + + // 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..e656cae9 100644 --- a/lib/ace/mode/coffee_worker.js +++ b/lib/ace/mode/coffee_worker.js @@ -40,7 +40,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 +49,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..fc62a89e 100644 --- a/lib/ace/mode/coldfusion.js +++ b/lib/ace/mode/coldfusion.js @@ -32,29 +32,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..7f4a1e3f 100644 --- a/lib/ace/mode/coldfusion_highlight_rules.js +++ b/lib/ace/mode/coldfusion_highlight_rules.js @@ -32,18 +32,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 : "<(?=script)", + next : "script" + }, { + token : "meta.tag", + regex : "<(?=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..97bfb83e 100644 --- a/lib/ace/mode/coldfusion_test.js +++ b/lib/ace/mode/coldfusion_test.js @@ -45,12 +45,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..22bbd82c 100644 --- a/lib/ace/mode/csharp_highlight_rules.js +++ b/lib/ace/mode/csharp_highlight_rules.js @@ -25,19 +25,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" @@ -49,13 +47,12 @@ var CSharpHighlightRules = function() { regex : "(?:true|false)\\b" }, { token : keywordMapper, + // TODO: Unicode escape sequences + // TODO: Unicode identifiers regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { token : "keyword.operator", regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)" - }, { - token : "keyword", - regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)" }, { token : "punctuation.operator", regex : "\\?|\\:|\\,|\\;|\\." @@ -77,6 +74,7 @@ var CSharpHighlightRules = function() { next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ] @@ -84,7 +82,6 @@ var CSharpHighlightRules = function() { 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..447a8181 100644 --- a/lib/ace/mode/css.js +++ b/lib/ace/mode/css.js @@ -33,16 +33,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 +49,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; } @@ -81,7 +79,7 @@ oop.inherits(Mode, TextMode); var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker"); worker.attachToDocument(session.getDocument()); - worker.on("annotate", function(e) { + worker.on("csslint", function(e) { session.setAnnotations(e.data); }); @@ -92,7 +90,6 @@ oop.inherits(Mode, TextMode); 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..4f38daef 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: 12-September-2012 01:46:26 */ + /*! 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.9, Build time: 23-July-2012 10:52:31 */ 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.9, Build time: 23-July-2012 10:52:31 */ (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)); } 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,40 +2627,40 @@ 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, @@ -2739,22 +2668,22 @@ Parser.prototype = function(){ error = null, invalid = null, propertyName= ""; - + 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 @@ -2763,16 +2692,16 @@ Parser.prototype = function(){ propertyName = property.toString(); if (this.options.starHack && property.hack == "*" || this.options.underscoreHack && property.hack == "_") { - + propertyName = property.text; } - + try { this._validateProperty(propertyName, expr); } catch (ex) { invalid = ex; } - + this.fire({ type: "property", property: property, @@ -2781,49 +2710,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 = [], + //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 +2761,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 +2771,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 +2789,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 +2826,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 +2855,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 +2921,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 +2971,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 +2991,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 +3007,16 @@ Parser.prototype = function(){ } this._readWhitespace(); } - + return token; }, - + //----------------------------------------------------------------- // Animations methods //----------------------------------------------------------------- - + _keyframes: function(){ - + /* * keyframes: * : KEYFRAMES_SYM S* keyframe_name S* '{' S* keyframe_rule* '}' { @@ -3112,53 +3026,53 @@ Parser.prototype = function(){ token, tt, name, - prefix = ""; - + prefix = ""; + tokenStream.mustMatch(Tokens.KEYFRAMES_SYM); token = tokenStream.token(); if (/^@\-([^\-]+)\-/.test(token.value)) { prefix = RegExp.$1; } - + this._readWhitespace(); name = this._keyframe_name(); - + this._readWhitespace(); tokenStream.mustMatch(Tokens.LBRACE); - + this.fire({ type: "startkeyframes", name: name, prefix: prefix, line: token.startLine, col: token.startCol - }); - + }); + this._readWhitespace(); tt = tokenStream.peek(); - + //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 - }); - + }); + this._readWhitespace(); - tokenStream.mustMatch(Tokens.RBRACE); - + tokenStream.mustMatch(Tokens.RBRACE); + }, - + _keyframe_name: function(){ - + /* * keyframe_name: * : IDENT @@ -3169,41 +3083,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 +3127,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 +3141,7 @@ Parser.prototype = function(){ return keyList; }, - + _key: function(){ /* * There is a restriction that IDENT can be only "from" or "to". @@ -3237,30 +3151,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 +3207,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 +3235,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 +3255,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 +3286,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 +3308,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 +3318,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 +3385,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 +3409,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 +3440,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 +3462,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..61fe0199 100644 --- a/lib/ace/mode/html_test.js +++ b/lib/ace/mode/html_test.js @@ -45,12 +45,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/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 index d298dac4..4432f96c 100644 --- a/lib/ace/mode/jade.js +++ b/lib/ace/mode/jade.js @@ -38,19 +38,20 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules; var FoldMode = require("./folding/coffee").FoldMode; var Mode = function() { - this.HighlightRules = JadeHighlightRules; + var highlighter = new JadeHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.foldingRules = new FoldMode(); }; oop.inherits(Mode, TextMode); -(function() { - this.lineCommentStart = "//"; - this.$id = "ace/mode/jade"; +(function() { + // Extra logic goes here. }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/jade_highlight_rules.js b/lib/ace/mode/jade_highlight_rules.js index c46c0be7..1f8b5875 100644 --- a/lib/ace/mode/jade_highlight_rules.js +++ b/lib/ace/mode/jade_highlight_rules.js @@ -73,24 +73,23 @@ var JadeHighlightRules = function() { { "start": [ { - token: "keyword.control.import.include.jade", - regex: "\\s*\\binclude\\b" + "token": "keyword.control.import.include.jade", + "regex": "\\s*\\binclude\\b" }, { - token: "keyword.other.doctype.jade", - regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" + "token": "keyword.other.doctype.jade", + "regex": "^!!!\\s*(?:[a-zA-Z0-9-_]+)?" }, { - token : "punctuation.section.comment", - regex : "^\\s*\/\/(?:\\s*[^-\\s]|\\s+\\S)(?:.*$)" + "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"; + "token" : function(space, text) { + return "punctuation.section.comment"; }, - regex: /^\s*\/\//, - next: "comment_block" + "regex" : "^((\\s*)\/\/)(?:\\s*$)", + "next": "comment_block" }, mixin_embed("markdown", "markdown-"), mixin_embed("sass", "sass-"), @@ -98,100 +97,101 @@ var JadeHighlightRules = function() { mixin_embed("coffee", "coffee-"), /* { - token: { + "token": { "2": { "name": "entity.name.function.jade" } }, - regex: "^(\\s*)(\\:cdata)", - next: "state_9" + "regex": "^(\\s*)(\\:cdata)", + "next": "state_9" },*/ // match stuff like: mixin dialog-title-desc(title, desc) { - token: [ "storage.type.function.jade", + "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*\\()(.*?)(\\))" + "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": [ "storage.type.function.jade", "entity.name.function.jade"], + "regex": "^(\\s*mixin)( [\\w\\-]+)" }, { - token: "source.js.embedded.jade", - regex: "^\\s*(?:-|=|!=)", - next: "js-start" + "token": "source.js.embedded.jade", + "regex": "^\\s*(?:-|=|!=)", + "next": "js-start" }, /*{ - token: "entity.name.tag.script.jade", - regex: "^\\s*script", - next: "js_code_tag" + "token": "entity.name.tag.script.jade", + "regex": "^\\s*script", + "next": "js_code_tag" },*/ { - token: "string.interpolated.jade", - regex: "[#!]\\{[^\\}]+\\}" + "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": ["meta.tag.any.jade", "entity.variable.tag.jade"], + "regex": /^\s*(?!\w+\:)(?:[\w]+|(?=\.|#)])/, + "next": "tag_single" }, { - token: "suport.type.attribute.id.jade", - regex: "#\\w+" + "token": "suport.type.attribute.id.jade", + "regex": "#\\w+" }, { - token: "suport.type.attribute.class.jade", - regex: "\\.\\w+" + "token": "suport.type.attribute.class.jade", + "regex": "\\.\\w+" }, { - token: "punctuation", - regex: "\\s*(?:\\()", - next: "tag_attributes" + "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(); + { + "token": function(text) { return "text"; - } else { - this.next = ""; - return "comment"; - } - }, next: "start"}, - {defaultToken: "comment"} + }, + "regex": "^(\\1\\S|$)", + "captures": "1", + "next": "start" + }, + { + "token": "comment.block.jade", + "merge" : true, + "regex" : ".+" + } ], /* "state_9": [ { - token: "TODO", - regex: "^(?!\\1\\s+)", - next: "start" + "token": "TODO", + "regex": "^(?!\\1\\s+)", + "next": "start" }, { - token: "TODO", - regex: ".+", - next: "state_9" + "token": "TODO", + "regex": ".+", + "next": "state_9" } ],*/ /*"js_code": [ { - token: "keyword.control.js", - regex: "\\beach\\b" + "token": "keyword.control.js", + "regex": "\\beach\\b" }, { - token: "text", - regex: "$", - next: "start" + "token": "text", + "regex": "$", + "next": "start" } ],*/ /*"js_code_tag": [ @@ -199,62 +199,62 @@ var JadeHighlightRules = function() { "include": "source.js" }, { - token: "TODO", - regex: "^((?=(\\1)([\\w#\\.]|$\\n?))|^$\\n?)", - next: "start" + "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.class.jade", + "regex": "\\.[\\w-]+" }, { - token: "entity.other.attribute-name.id.jade", - regex: "#[\\w-]+" + "token": "entity.other.attribute-name.id.jade", + "regex": "#[\\w-]+" }, { - token: ["text", "punctuation"], - regex: "($)|((?!\\.|#|=|-))", - next: "start" + "token": ["text", "punctuation"], + "regex": "($)|((?!\\.|#|=|-))", + "next": "start" } ], "tag_attributes": [ { - token : "string", - regex : "'(?=.)", - next : "qstring" + "token" : "string", + "regex" : "'(?=.)", + "next" : "qstring" }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" + "token" : "string", + "regex" : '"(?=.)', + "next" : "qqstring" }, { - token: "entity.other.attribute-name.jade", - regex: "\\b[a-zA-Z\\-:]+" + "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": ["entity.other.attribute-name.jade", "punctuation"], + "regex": "\\b([a-zA-Z:\\.-]+)(=)", + "next": "attribute_strings" }, { - token: "punctuation", - regex: "\\)", - next: "start" + "token": "punctuation", + "regex": "\\)", + "next": "start" } ], "attribute_strings": [ { - token : "string", - regex : "'(?=.)", - next : "qstring" + "token" : "string", + "regex" : "'(?=.)", + "next" : "qstring" }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" + "token" : "string", + "regex" : '"(?=.)', + "next" : "qqstring" } ], "qqstring" : [ @@ -263,15 +263,18 @@ var JadeHighlightRules = function() { regex : escapedRe }, { token : "string", - regex : '[^"\\\\]+' + regex : '[^"\\\\]+', + merge : true }, { token : "string", regex : "\\\\$", - next : "qqstring" + next : "qqstring", + merge : true }, { token : "string", regex : '"|$', - next : "tag_attributes" + next : "tag_attributes", + merge : true } ], "qstring" : [ @@ -280,15 +283,18 @@ var JadeHighlightRules = function() { regex : escapedRe }, { token : "string", - regex : "[^'\\\\]+" + regex : "[^'\\\\]+", + merge : true }, { token : "string", regex : "\\\\$", - next : "qstring" + next : "qstring", + merge : true }, { token : "string", regex : "'|$", - next : "tag_attributes" + next : "tag_attributes", + merge : true } ] }; 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..ab05fbde 100644 --- a/lib/ace/mode/java_highlight_rules.js +++ b/lib/ace/mode/java_highlight_rules.js @@ -70,8 +70,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 : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' @@ -113,6 +117,7 @@ var JavaHighlightRules = function() { next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ] diff --git a/lib/ace/mode/javascript.js b/lib/ace/mode/javascript.js index b6ebe5a0..3b1460a8 100644 --- a/lib/ace/mode/javascript.js +++ b/lib/ace/mode/javascript.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -33,6 +33,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 +42,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 +51,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 +119,22 @@ 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) { + worker.on("jslint", function(results) { session.setAnnotations(results.data); }); - + worker.on("terminate", function() { session.clearAnnotations(); }); - + return worker; }; - this.$id = "ace/mode/javascript"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/javascript/jshint.js b/lib/ace/mode/javascript/jshint.js index 894b78cc..78159266 100644 --- a/lib/ace/mode/javascript/jshint.js +++ b/lib/ace/mode/javascript/jshint.js @@ -1,11495 +1,4838 @@ define(function(require, exports, module) { -module.exports = (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 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: + * MIT license that JSLint is. It stops evil-doers everywhere. * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) + * JSHint is a derivative work of JSLint: * - * 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: + * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. + * 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 Software shall be used for Good, not Evil. + * 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. + * 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; +/* + 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 1) at which the lint was found + character : The character (relative to 1) 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 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, + character: NUMBER, + last: NUMBER, + lastcharacter: 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, quotmark: double, unused: true +*/ + +/*members "\b", "\t", "\n", "\f", "\r", "!=", "!==", "\"", "%", "(begin)", + "(breakage)", "(character)", "(context)", "(error)", "(explicitNewcap)", "(global)", + "(identifier)", "(last)", "(lastcharacter)", "(line)", "(loopage)", "(metrics)", + "(name)", "(onevar)", "(params)", "(scope)", "(statement)", "(verb)", "(tokens)", "(catch)", + "*", "+", "++", "-", "--", "\/", "<", "<=", "==", + "===", ">", ">=", $, $$, $A, $F, $H, $R, $break, $continue, $w, Abstract, Ajax, + __filename, __dirname, ActiveXObject, Array, ArrayBuffer, ArrayBufferView, Audio, + Autocompleter, Asset, Boolean, Builder, Buffer, Browser, Blob, COM, CScript, Canvas, + CustomAnimation, Class, Control, ComplexityCount, Chain, Color, Cookie, Core, DataView, Date, + Debug, Draggable, Draggables, Droppables, Document, DomReady, DOMEvent, 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, importScripts, Int16Array, Int32Array, Int8Array, + Insertion, InputValidator, JSON, Keyboard, Locale, LN10, LN2, LOG10E, LOG2E, + MAX_VALUE, MIN_VALUE, Map, Mask, Math, MenuItem, MessageChannel, MessageEvent, MessagePort, + MoveAnimation, MooTools, MutationObserver, NaN, Native, NEGATIVE_INFINITY, Node, NodeFilter, + Number, Object, ObjectRange, + Option, Options, OverText, PI, POSITIVE_INFINITY, PeriodicalExecuter, Point, Position, Prototype, + RangeError, Rectangle, ReferenceError, RegExp, ResizeAnimation, Request, RotateAnimation, Set, + 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, WeakMap, WSH, WScript, XDomainRequest, Web, Window, XMLDOM, XMLHttpRequest, XMLSerializer, + XPathEvaluator, XPathException, XPathExpression, XPathNamespace, XPathNSResolver, XPathResult, + "\\", a, abs, addEventListener, address, alert, apply, applicationCache, arguments, arity, + asi, atob, b, basic, basicToken, bitwise, blacklist, block, blur, boolOptions, boss, + browser, btoa, c, call, callee, caller, camelcase, cases, charAt, charCodeAt, character, + clearInterval, clearTimeout, close, closed, closure, comment, complexityCount, 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, elem, + eqeq, eqeqeq, eqnull, errors, es5, escape, esnext, eval, event, evidence, evil, + ex, exception, exec, exps, expr, exports, FileReader, first, floor, focus, forEach, + 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, internals, instanceOf, isAlpha, isApplicationRunning, isArray, + isDigit, isFinite, isNaN, iterator, java, join, jshint, + JSHINT, json, jquery, jQuery, keys, label, labelled, last, lastcharacter, lastsemic, laxbreak, + laxcomma, latedef, lbp, led, left, length, line, load, loadClass, localStorage, location, + log, loopfunc, m, match, max, maxcomplexity, maxdepth, maxerr, maxlen, maxstatements, maxparams, + member, message, meta, module, moveBy, moveTo, mootools, multistr, name, navigator, new, newcap, + nestedBlockDepth, 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, + postMessage, pop, predef, print, process, prompt, proto, prototype, prototypejs, provides, push, + quit, quotmark, range, raw, reach, reason, regexp, readFile, readUrl, regexdash, + removeEventListener, replace, report, require, reserved, resizeBy, resizeTo, resolvePath, + resumeUpdates, respond, rhino, right, runCommand, scroll, scope, screen, scripturl, scrollBy, + scrollTo, scrollbar, search, seal, self, send, serialize, sessionStorage, setInterval, setTimeout, + setter, setterToken, shift, slice, smarttabs, sort, spawn, split, statement, statementCount, stack, + status, start, strict, sub, substr, supernew, shadow, supplant, sum, sync, test, toLowerCase, + toString, toUpperCase, toint32, token, tokens, top, trailing, type, typeOf, Uint16Array, + Uint32Array, Uint8Array, undef, undefs, unused, urls, validthis, value, valueOf, var, vars, + version, verifyMaxParametersPerFunction, verifyMaxStatementsPerFunction, + verifyMaxComplexityPerFunction, verifyMaxNestedBlockDepthPerFunction, WebSocket, withstmt, white, + window, windows, Worker, worker, wsh, yui, YUI, Y, YUI_config*/ + +/*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 + camelcase : true, // if identifiers should be required in camel case + 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 + unused : true, // if variables should be always 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 + worker : true, // if Web Worker script symbols should be allowed + wsh : true, // if the Windows Scripting Host environment globals + // should be predefined + yui : true // YUI variables 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, + quotmark : false, //'single'|'double'|true + scope : false, + maxstatements: false, // {int} max statements per function + maxdepth : false, // {int} max nested block depth per function + maxparams : false, // {int} max params per function + maxcomplexity: false // {int} max cyclomatic complexity per function + }, + + // These are JSHint boolean options which are shared with JSLint + // where the definition in JSHint is opposite JSLint + invertedOptions = { + bitwise : true, + forin : true, + newcap : true, + nomen : true, + plusplus : true, + regexp : true, + undef : true, + white : true, + + // Inverted and renamed, use JSHint name here + eqeqeq : true, + onevar : true + }, + + // These are JSHint boolean options which are shared with JSLint + // where the name has been changed but the effect is unchanged + renamedOptions = { + eqeq : "eqeqeq", + vars : "onevar", + windows : "wsh" + }, + + + // browser contains a set of global names which are commonly provided by a + // web browser environment. + browser = { + ArrayBuffer : false, + ArrayBufferView : false, + Audio : false, + Blob : 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, + MutationObserver : false, + name : false, + Node : false, + NodeFilter : 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 + }, + + declared, // Globals that were declared using /*global ... */ syntax. + + devel = { + alert : false, + confirm : false, + console : false, + Debug : false, + opera : false, + prompt : false + }, + + dojo = { + dojo : false, + dijit : false, + dojox : false, + define : false, + "require" : false + }, + + 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, + 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 + }, + + nexttoken, + + node = { + __filename : false, + __dirname : false, + Buffer : false, + console : false, + exports : true, // In Node it is ok to exports = module.exports = foo(); + 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 + }, + + quotmark, + + 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, + Map : false, + Math : false, + NaN : false, + Number : false, + Object : false, + parseInt : false, + parseFloat : false, + RangeError : false, + ReferenceError : false, + RegExp : false, + Set : false, + String : false, + SyntaxError : false, + TypeError : false, + URIError : false, + WeakMap : false + }, + + // widely adopted global names that are not part of ECMAScript standard + nonstandard = { + escape : false, + unescape : false + }, + + directive, + syntax = {}, + tab, + token, + unuseds, + urls, + useESNextSyntax, + warnings, + + worker = { + importScripts : true, + postMessage : true, + self : true + }, + + wsh = { + ActiveXObject : true, + Enumerator : true, + GetObject : true, + ScriptEngine : true, + ScriptEngineBuildVersion : true, + ScriptEngineMajorVersion : true, + ScriptEngineMinorVersion : true, + VBArray : true, + WSH : true, + WScript : true, + XDomainRequest : true + }, + + yui = { + YUI : false, + Y : false, + YUI_config : false + }; + // 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*([(){}\[.,:;'"~\?\]#@]|==?=?|\/=(?!(\S*\/[gim]?))|\/(\*(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); + } + } + + function isString(obj) { + return Object.prototype.toString.call(obj) === "[object String]"; + } + + // Provide critical ES5 functions to ES3. + + if (typeof Array.isArray !== "function") { + Array.isArray = function (o) { + return Object.prototype.toString.apply(o) === "[object Array]"; + }; + } + + if (!Array.prototype.forEach) { + Array.prototype.forEach = function (fn, scope) { + var len = this.length; + + for (var i = 0; i < len; i++) { + fn.call(scope || this, this[i], i, this); + } + }; + } + + if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { + if (this === null || this === undefined) { + throw new TypeError(); + } + + var t = new Object(this); + var len = t.length >>> 0; + + if (len === 0) { + return -1; + } + + var n = 0; + if (arguments.length > 0) { + n = Number(arguments[1]); + if (n != n) { // shortcut for verifying if it's NaN + n = 0; + } else if (n !== 0 && n != Infinity && n != -Infinity) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + } + + if (n >= len) { + return -1; + } + + var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); + for (; k < len; k++) { + if (k in t && t[k] === searchElement) { + return k; + } + } + + return -1; + }; + } + + 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 + + function isAlpha(str) { + return (str >= "a" && str <= "z\uffff") || + (str >= "A" && str <= "Z\uffff"); + } + + function isDigit(str) { + return (str >= "0" && str <= "9"); + } + + function isIdentifier(token, value) { + if (!token) + return false; + + if (!token.identifier || token.value !== value) + 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(t, o) { + var n; + for (n in o) { + if (is_own(o, n) && !is_own(JSHINT.blacklist, n)) { + t[n] = o[n]; + } + } + } + + function updatePredefined() { + Object.keys(JSHINT.blacklist).forEach(function (key) { + delete predefined[key]; + }); + } + + 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.worker) { + combine(predefined, worker); + } + + if (option.wsh) { + combine(predefined, wsh); + } + + if (option.esnext) { + useESNextSyntax(); + } + + if (option.globalstrict && option.strict !== false) { + option.strict = true; + } + + if (option.yui) { + combine(predefined, yui); + } + } + + + // 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, + scope: JSHINT.scope, + a: a, + b: b, + c: c, + d: d + }; + w.reason = supplant(m, 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) { + 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; + } + + +// lexical analysis and token construction + + var lex = (function lex() { + var character, from, line, s; + +// Private lex methods + + function nextLine() { + var at, + match, + 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. + // Tabs and one space followed by block comment is allowed. + if (option.smarttabs) { + // negative look-behind for "//" + match = s.match(/(\/\/)? \t/); + at = match && !match[1] ? 0 : -1; + } 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; + + function checkName(name) { + if (!option.proto && name === "__proto__") { + warningAt("The '{a}' property is deprecated.", line, from, name); + return; + } + + if (!option.iterator && name === "__iterator__") { + warningAt("'{a}' is only available in JavaScript 1.7.", line, from, name); + return; + } + + // Check for dangling underscores unless we're in Node + // environment and this identifier represents built-in + // Node globals with underscores. + + var hasDangling = /^(_+.*|.*_+)$/.test(name); + + if (option.nomen && hasDangling && name !== "_") { + if (option.node && token.id !== "." && /^(__dirname|__filename)$/.test(name)) + return; + + warningAt("Unexpected {a} in '{b}'.", line, from, "dangling '_'", name); + return; + } + + // Check for non-camelcase names. Names like MY_VAR and + // _myVar are okay though. + + if (option.camelcase) { + if (name.replace(/^_+/, "").indexOf("_") > -1 && !name.match(/^[A-Z0-9_]*$/)) { + warningAt("Identifier '{a}' is not in camel case.", line, from, value); + } + } + } + + 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; + checkName(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); + } + + if (option.quotmark) { + if (option.quotmark === "single" && x !== "'") { + warningAt("Strings must use singlequote.", + line, character); + } else if (option.quotmark === "double" && x !== "\"") { + warningAt("Strings must use doublequote.", + line, character); + } else if (option.quotmark === true) { + quotmark = quotmark || x; + if (quotmark !== x) { + warningAt("Mixed double and single quotes.", + 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; + case "!": + if (s.charAt(j - 2) === "<") + break; + /*falls through*/ + 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 (isAlpha(c) || c === "_" || c === "$") { + return it("(identifier)", t); + } + + // number + + if (isDigit(c)) { + if (!isFinite(Number(t))) { + warningAt("Bad number '{a}'.", + line, character, t); + } + if (isAlpha(s.substr(0, 1))) { + warningAt("Missing space after '{a}'.", + line, character, t); + } + if (c === "0") { + d = t.substr(1, 1); + if (isDigit(d)) { + 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); + } + } + 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 (s.charAt(0) === "=") { + 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 (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); + break; // No reason to continue checking numbers. + } + 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, token) { + if (t === "hasOwnProperty") { + warning("'hasOwnProperty' is a really bad name."); + } + + // Define t in the current function in the current scope. + if (type === "exception") { + if (is_own(funct["(context)"], t)) { + if (funct[t] !== true && !option.node) { + warning("Value of '{a}' may be overwritten in IE.", nexttoken, t); + } + } + } + + 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 (token) { + funct["(tokens)"][t] = token; + } + + 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 nt = nexttoken; + var o = nt.value; + var quotmarkValue = option.quotmark; + var predef = {}; + var b, obj, filter, t, tn, v, minus; + + switch (o) { + case "*/": + error("Unbegun comment."); + break; + case "/*members": + case "/*member": + o = "/*members"; + if (!membersOnly) { + membersOnly = {}; + } + obj = membersOnly; + option.quotmark = false; + break; + case "/*jshint": + case "/*jslint": + obj = option; + filter = boolOptions; + break; + case "/*global": + obj = predef; + break; + default: + error("What?"); + } + + t = lex.token(); + +loop: + for (;;) { + minus = false; + for (;;) { + if (t.type === "special" && t.value === "*/") { + break loop; + } + if (t.id !== "(endline)" && t.id !== ",") { + break; + } + t = lex.token(); + } + + if (o === "/*global" && t.value === "-") { + minus = true; + 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); + } + + var numericVals = [ + "maxstatements", + "maxparams", + "maxdepth", + "maxcomplexity", + "maxerr", + "maxlen", + "indent" + ]; + + if (numericVals.indexOf(t.value) > -1 && (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); + } + + if (t.value === "indent") + obj.white = true; + + obj[t.value] = 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 (t.value === "quotmark" && (o === "/*jshint")) { + switch (v.value) { + case "true": + obj.quotmark = true; + break; + case "false": + obj.quotmark = false; + break; + case "double": + case "single": + obj.quotmark = v.value; + break; + default: + error("Bad option value.", v); + } + } else if (v.value === "true" || v.value === "false") { + if (o === "/*jslint") { + tn = renamedOptions[t.value] || t.value; + obj[tn] = v.value === "true"; + if (invertedOptions[tn] !== undefined) { + obj[tn] = !obj[tn]; + } + } else { + obj[t.value] = v.value === "true"; + } + + if (t.value === "newcap") + obj["(explicitNewcap)"] = true; + } else { + error("Bad option value.", v); + } + t = lex.token(); + } else { + if (o === "/*jshint" || o === "/*jslint") { + error("Missing option value.", t); + } + + obj[t.value] = false; + + if (o === "/*global" && minus === true) { + JSHINT.blacklist[t.value] = t.value; + updatePredefined(); + } + + t = v; + } + } + + if (o === "/*members") { + option.quotmark = quotmarkValue; + } + + combine(predefined, predef); + + for (var key in predef) { + if (is_own(predef, key)) { + declared[key] = nt; + } + } + + 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"; + + // #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 token.value + // are not equal, then safely assume that this not "new Object()" + if (left.value !== token.value) { + isObject = false; + } + } + } + + 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.value === ";" && right.value === ";") { + return; + } + 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 (isIdentifier(left, "NaN") || isIdentifier(right, "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) { + symbol(s, 20).exps = true; + + return infix(s, function (left, that) { + 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) { + 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 && nexttoken.value !== "{") { + 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; + } + + // Is it a lonely block? + + if (t.id === "{") { + block(true, true); + return; + } + + // 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.", t); + } + + 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 = [], 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") { + if (!option["(explicitNewcap)"]) + 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; + + var metrics = funct["(metrics)"]; + metrics.nestedBlockDepth += 1; + metrics.verifyMaxNestedBlockDepthPerFunction(); + + 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); + + metrics.statementCount += a.length; + + 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."); + } + metrics.nestedBlockDepth -= 1; + 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": + 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("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.", prevtoken, 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") && !is_own(global, c.value)) { + 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.", + token, token.value); + } + 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 ("Number String Boolean Date Object".indexOf(left.value) === -1) { + 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.", token); + } + if (!option.evil) { + if (left.value === "eval" || left.value === "Function" || + left.value === "execScript") { + warning("eval is evil.", 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( + "Implied eval is evil. Pass a function instead of a string.", 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( + "Implied eval is evil. Pass a function instead of a string.", left); + addInternalSrc(left, p[0].value); + } + } + 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( +"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.", + prevtoken, 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 === ",") { + if (!option.es5) + 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 next = nexttoken; + var params = []; + var ident; + + advance("("); + nospace(); + + if (nexttoken.id === ")") { + advance(")"); + return; + } + + for (;;) { + ident = identifier(true); + params.push(ident); + addlabel(ident, "unused", token); + if (nexttoken.id === ",") { + comma(); + } else { + advance(")", next); + nospace(prevtoken, token); + return params; + } + } + } + + + function doFunction(name, statement) { + var f; + var oldOption = option; + var oldScope = scope; + + option = Object.create(option); + scope = Object.create(scope); + + funct = { + "(name)" : name || "\"" + anonname + "\"", + "(line)" : nexttoken.line, + "(character)": nexttoken.character, + "(context)" : funct, + "(breakage)" : 0, + "(loopage)" : 0, + "(metrics)" : createMetrics(nexttoken), + "(scope)" : scope, + "(statement)": statement, + "(tokens)" : {} + }; + + f = funct; + token.funct = funct; + + functions.push(funct); + + if (name) { + addlabel(name, "function"); + } + + funct["(params)"] = functionparams(); + funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); + + block(false, false, true); + + funct["(metrics)"].verifyMaxStatementsPerFunction(); + funct["(metrics)"].verifyMaxComplexityPerFunction(); + + scope = oldScope; + option = oldOption; + funct["(last)"] = token.line; + funct["(lastcharacter)"] = token.character; + funct = funct["(context)"]; + + return f; + } + + function createMetrics(functionStartToken) { + return { + statementCount: 0, + nestedBlockDepth: -1, + ComplexityCount: 1, + verifyMaxStatementsPerFunction: function () { + if (option.maxstatements && + this.statementCount > option.maxstatements) { + var message = "Too many statements per function (" + this.statementCount + ")."; + warning(message, functionStartToken); + } + }, + + verifyMaxParametersPerFunction: function (params) { + params = params || []; + + if (option.maxparams && params.length > option.maxparams) { + var message = "Too many parameters per function (" + params.length + ")."; + warning(message, functionStartToken); + } + }, + + verifyMaxNestedBlockDepthPerFunction: function () { + if (option.maxdepth && + this.nestedBlockDepth > 0 && + this.nestedBlockDepth === option.maxdepth + 1) { + var message = "Blocks are nested too deeply (" + this.nestedBlockDepth + ")."; + warning(message); + } + }, + + verifyMaxComplexityPerFunction: function () { + var max = option.maxcomplexity; + var cc = this.ComplexityCount; + if (max && cc > max) { + var message = "Cyclomatic complexity is too high per function (" + cc + ")."; + warning(message, functionStartToken); + } + } + }; + } + + function increaseComplexityCount() { + funct["(metrics)"].ComplexityCount += 1; + } + + + (function (x) { + x.nud = function () { + var b, f, i, 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", token); + + 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", token); + + doFunction(i, { statement: 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; + increaseComplexityCount(); + advance("("); + nonadjacent(this, t); + nospace(); + expression(20); + if (nexttoken.id === "=") { + if (!option.boss) + warning("Assignment in conditional expression"); + 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; + + function doCatch() { + var oldScope = scope; + var e; + + advance("catch"); + nonadjacent(token, nexttoken); + advance("("); + + scope = Object.create(oldScope); + + e = nexttoken.value; + if (nexttoken.type !== "(identifier)") { + e = null; + warning("Expected an identifier and instead saw '{a}'.", nexttoken, e); + } + + advance(); + advance(")"); + + funct = { + "(name)" : "(catch)", + "(line)" : nexttoken.line, + "(character)": nexttoken.character, + "(context)" : funct, + "(breakage)" : funct["(breakage)"], + "(loopage)" : funct["(loopage)"], + "(scope)" : scope, + "(statement)": false, + "(metrics)" : createMetrics(nexttoken), + "(catch)" : true, + "(tokens)" : {} + }; + + if (e) { + addlabel(e, "exception"); + } + + token.funct = funct; + functions.push(funct); + + block(false); + + scope = oldScope; + + funct["(last)"] = token.line; + funct["(lastcharacter)"] = token.character; + funct = funct["(context)"]; + } + + block(false); + + if (nexttoken.id === "catch") { + increaseComplexityCount(); + doCatch(); + b = true; + } + + 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; + increaseComplexityCount(); + advance("("); + nonadjacent(this, t); + nospace(); + expression(20); + if (nexttoken.id === "=") { + if (!option.boss) + warning("Assignment in conditional expression"); + 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)); + increaseComplexityCount(); + 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; + increaseComplexityCount(); + + this.first = block(true); + advance("while"); + var t = nexttoken; + nonadjacent(token, t); + advance("("); + nospace(); + expression(20); + if (nexttoken.id === "=") { + if (!option.boss) + warning("Assignment in conditional expression"); + 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; + increaseComplexityCount(); + 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("Assignment in conditional expression"); + 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, x; + var optionKeys; + var newOptionObj = {}; + + if (o && o.scope) { + JSHINT.scope = o.scope; + } else { + JSHINT.errors = []; + JSHINT.undefs = []; + JSHINT.internals = []; + JSHINT.blacklist = {}; + JSHINT.scope = "(main)"; + } + + predefined = Object.create(standard); + declared = Object.create(null); + combine(predefined, g || {}); + + if (o) { + a = o.predef; + if (a) { + if (!Array.isArray(a) && typeof a === "object") { + a = Object.keys(a); + } + a.forEach(function (item) { + var slice; + if (item[0] === "-") { + slice = item.slice(1); + JSHINT.blacklist[slice] = slice; + } else { + predefined[item] = true; + } + }); + } + + optionKeys = Object.keys(o); + for (x = 0; x < optionKeys.length; x++) { + newOptionObj[optionKeys[x]] = o[optionKeys[x]]; + + if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) + newOptionObj["(explicitNewcap)"] = true; + + if (optionKeys[x] === "indent") + newOptionObj.white = true; + } + } + + option = newOptionObj; + + 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, + "(tokens)": {}, + "(metrics)": createMetrics(nexttoken) + }; + functions = [funct]; + urls = []; + stack = null; + member = {}; + membersOnly = null; + implied = {}; + inblock = false; + lookahead = []; + jsonmode = false; + warnings = 0; + lines = []; + unuseds = []; + + if (!isString(s) && !Array.isArray(s)) { + errorAt("Input is neither a string nor an array of strings.", 0); + return false; + } + + if (isString(s) && /^\s*$/g.test(s)) { + errorAt("Input is an empty string.", 0); + return false; + } + + if (s.length === 0) { + errorAt("Input is an empty array.", 0); + return false; + } + + 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; + quotmark = undefined; + + 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((nexttoken && nexttoken.value !== ".") ? "(end)" : undefined); + + 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, token) { + var line = token.line; + var chr = token.character; + + if (option.unused) + warningAt("'{a}' is defined but never used.", line, chr, name); + + unuseds.push({ + name: name, + line: line, + character: chr + }); + }; + + var checkUnused = function (func, key) { + var type = func[key]; + var token = func["(tokens)"][key]; + + if (key.charAt(0) === "(") + return; + + if (type !== "unused" && type !== "unction") + return; + + // Params are checked separately from other variables. + if (func["(params)"] && func["(params)"].indexOf(key) !== -1) + return; + + warnUnused(key, token); + }; + + // 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)); + } + } + + functions.forEach(function (func) { + for (var key in func) { + if (is_own(func, key)) { + checkUnused(func, key); + } + } + + if (!func["(params)"]) + return; + + var params = func["(params)"].slice(); + var param = params.pop(); + var type; + + while (param) { + type = func[param]; + + // 'undefined' is a special case for (function (window, undefined) { ... })(); + // patterns. + + if (param === "undefined") + return; + + if (type !== "unused" && type !== "unction") + return; + + warnUnused(param, func["(tokens)"][param]); + param = params.pop(); + } + }); + + for (var key in declared) { + if (is_own(declared, key) && !is_own(global, key)) { + warnUnused(key, declared[key]); + } + } + } 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); + } + } + + // 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; + }; + + // Data summary. + itself.data = function () { + var data = { + functions: [], + options: option + }; + var implieds = []; + var members = []; + var fu, f, i, j, n, globals; + + 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 (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)"]; + 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; + 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..25216613 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -35,7 +35,7 @@ var oop = require("../lib/oop"); 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": @@ -61,12 +61,11 @@ var JavaScriptHighlightRules = function(options) { "constant.language": "null|Infinity|NaN|undefined", "support.function": - "alert", - "constant.language.boolean": "true|false" + "alert" }, "identifier"); // 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"; // TODO: Unicode escape sequences var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; @@ -83,15 +82,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" }, { @@ -163,74 +162,81 @@ var JavaScriptHighlightRules = function(options) { ], 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, 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": [ @@ -241,48 +247,52 @@ var JavaScriptHighlightRules = function(options) { }, { // flag token: "string.regexp", - regex: "/[sxngimy]*", - next: "no_regex" + regex: "/\\w*", + next: "start", + merge: true }, { // invalid operators token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + regex: /\{\d+,?(?:\d+)?}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ }, { // operators token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + regex: /\(\?[:=!]|\)|{\d+,?(?:\d+)?}|{,\d+}|[+*]\?|[(|)$^+*?]/ }, { - token : "constant.language.delimiter", - regex: /\|/ + token: "string.regexp", + regex: /{|[^{\[\/\\(|)$^+*?]+/, + merge: true }, { token: "constant.language.escape", regex: /\[\^?/, - next: "regex_character_class" + 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", regex: "]", - next: "regex" + next: "regex", + merge: true }, { token: "constant.language.escape", regex: "-" }, { - token: "empty", - regex: "$", - next: "no_regex" + token: "string.regexp.charachterclass", + regex: /[^\]\-\\]+/, + merge: true }, { - defaultToken: "string.regexp.charachterclass" + token: "empty", + regex: "", + next: "start" } ], "function_arguments": [ @@ -291,112 +301,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..36647b0f --- /dev/null +++ b/lib/ace/mode/javascript_highlight_rules_test.js @@ -0,0 +1,218 @@ +/* ***** 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 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(11, 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..5480b6a8 100644 --- a/lib/ace/mode/javascript_test.js +++ b/lib/ace/mode/javascript_test.js @@ -56,46 +56,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 +77,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 +90,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 +115,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..8d3a060c 100644 --- a/lib/ace/mode/javascript_worker.js +++ b/lib/ace/mode/javascript_worker.js @@ -79,8 +79,8 @@ oop.inherits(JavaScriptWorker, Mirror); this.options = options || { // undef: true, // unused: true, + es5: true, esnext: true, - moz: true, devel: true, browser: true, node: true, @@ -116,10 +116,12 @@ oop.inherits(JavaScriptWorker, Mirror); this.onUpdate = function() { var value = this.doc.getValue(); value = value.replace(/^#!.*\n/, "\n"); - if (!value) - return this.sender.emit("annotate", []); - + if (!value) { + this.sender.emit("jslint", []); + return; + } var errors = []; + // jshint reports many false errors // report them as error only if code is actually invalid var maxErrorLevel = this.isValidJS(value) ? "warning" : "error"; @@ -177,7 +179,7 @@ oop.inherits(JavaScriptWorker, Mirror); } // console.log("lint time: " + (new Date() - start)); - this.sender.emit("annotate", errors); + this.sender.emit("jslint", errors); }; }).call(JavaScriptWorker.prototype); diff --git a/lib/ace/mode/javascript_worker_test.js b/lib/ace/mode/javascript_worker_test.js index 5d61fc89..fe482d5c 100644 --- a/lib/ace/mode/javascript_worker_test.js +++ b/lib/ace/mode/javascript_worker_test.js @@ -74,7 +74,7 @@ module.exports = { assert.equal(error.text, "Unclosed string."); assert.equal(error.type, "error"); assert.equal(error.row, 0); - assert.equal(error.column, 2); + assert.equal(error.column, 0); }, "test another invalid string": function() { @@ -86,16 +86,7 @@ module.exports = { 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(error.column, 3); } }; 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..c228c092 100644 --- a/lib/ace/mode/json.js +++ b/lib/ace/mode/json.js @@ -33,6 +33,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 +41,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 +75,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 +87,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..7e4f5609 100644 --- a/lib/ace/mode/json_highlight_rules.js +++ b/lib/ace/mode/json_highlight_rules.js @@ -79,15 +79,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..bb72a7ac 100644 --- a/lib/ace/mode/json_worker.js +++ b/lib/ace/mode/json_worker.js @@ -46,20 +46,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..b4a8610d 100644 --- a/lib/ace/mode/json_worker_test.js +++ b/lib/ace/mode/json_worker_test.js @@ -58,7 +58,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 +71,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 +85,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 index c1cb0254..a394eab2 100644 --- a/lib/ace/mode/jsp.js +++ b/lib/ace/mode/jsp.js @@ -33,13 +33,15 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.HighlightRules = JspHighlightRules; + var highlighter = new JspHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); @@ -48,7 +50,6 @@ 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 index e6775f53..da0033fc 100644 --- a/lib/ace/mode/jsp_highlight_rules.js +++ b/lib/ace/mode/jsp_highlight_rules.js @@ -37,52 +37,46 @@ var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules; var JspHighlightRules = function() { HtmlHighlightRules.call(this); + for (var i in this.$rules) { + this.$rules[i].unshift({ + token : "meta.tag", // jsp open tag + regex : "<%@?|<%=?|]+>", + next : "jsp-start" + }); + } 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" - } - ]; + this.embedRules(JavaHighlightRules, "jsp-"); - 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.$rules["start"].unshift({ + token : "comment", + merge : true, + regex : "<%--", + next : "comment" }); - this.normalizeRules(); + this.$rules["jsp-start"].unshift({ + token : "meta.tag", // jsp close tag + regex : "%>|<\\/jsp:[^>]+>", + next : "start" + }, + { + token: "variable.language", + regex : builtinVariables + }, { + token: "keyword", + regex : keywords + }); + + this.$rules.comment.unshift({ + token : "comment", + regex : ".*?--%>", + next : "start" + }); }; oop.inherits(JspHighlightRules, HtmlHighlightRules); 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..3403e608 100644 --- a/lib/ace/mode/latex.js +++ b/lib/ace/mode/latex.js @@ -3,22 +3,54 @@ 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.$tokenizer = new Tokenizer(new LatexHighlightRules().getRules()); this.foldingRules = new LatexFoldMode(); }; 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..3057c0de 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..c926c15a 100644 --- a/lib/ace/mode/less.js +++ b/lib/ace/mode/less.js @@ -33,29 +33,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 +72,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..3cc22953 100644 --- a/lib/ace/mode/less_highlight_rules.js +++ b/lib/ace/mode/less_highlight_rules.js @@ -177,6 +177,7 @@ var LessHighlightRules = function() { }, { token : "comment", // multi line comment + merge : true, regex : "\\/\\*", next : "comment" }, { @@ -231,7 +232,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 +248,6 @@ var LessHighlightRules = function() { }, { token : "text", regex : "\\s+" - }, { - caseInsensitive: true } ], "comment" : [ @@ -258,6 +257,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..b996bc52 100644 --- a/lib/ace/mode/liquid.js +++ b/lib/ace/mode/liquid.js @@ -32,24 +32,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 +103,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..5b4f9c0b 100644 --- a/lib/ace/mode/liquid_highlight_rules.js +++ b/lib/ace/mode/liquid_highlight_rules.js @@ -32,11 +32,12 @@ 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 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 = ( @@ -68,28 +69,83 @@ var LiquidHighlightRules = function() { "keyword.definition": definitions }, "identifier"); - // add liquid start tags to the HTML start tags - for (var rule in this.$rules) { - this.$rules[rule].unshift({ + // regexp must not have capturing parentheses. Use (?:) instead. + // regexps are ordered -> the first match is used + + this.$rules = { + start : [{ token : "variable", regex : "{%", - push : "liquid-start" + next : "liquid_start" }, { token : "variable", regex : "{{", - push : "liquid-start" - }); - } + 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" : [{ + cdata : [ { + token : "text", + regex : "\\]\\]>", + next : "start" + }, { + token : "text", + merge : true, + regex : "\\s+" + }, { + token : "text", + merge : true, + regex : ".+" + } ], + + comment : [ { + token : "comment", + regex : ".*?-->", + next : "start" + }, { + token : "comment", + merge : true, + regex : ".+" + } ] , + + liquid_start : [{ token: "variable", regex: "}}", - next: "pop" + next: "start" }, { token: "variable", regex: "%}", - next: "pop" + next: "start" }, { token : "string", // single line regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' @@ -121,9 +177,27 @@ var LiquidHighlightRules = function() { token : "text", regex : "\\s+" }] - }); + }; - this.normalizeRules(); + 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/mouse/mouse_handler_test.js b/lib/ace/mode/liquid_highlight_rules_test.js similarity index 61% rename from lib/ace/mouse/mouse_handler_test.js rename to lib/ace/mode/liquid_highlight_rules_test.js index 96374d71..c6ecf4b7 100644 --- a/lib/ace/mouse/mouse_handler_test.js +++ b/lib/ace/mode/liquid_highlight_rules_test.js @@ -30,44 +30,51 @@ if (typeof process !== "undefined") { require("amd-loader"); - require("../test/mockdom"); } define(function(require, exports, module) { -"use strict"; -var Editor = require("../editor").Editor; -var MockRenderer = require("../test/mockrenderer").MockRenderer; +var LiquidMode = require("./liquid").Mode; var assert = require("../test/assertions"); -var MouseEvent = function(type, opts){ - var e = document.createEvent("MouseEvents"); - e.initMouseEvent("mouse" + type, - true, true, window, - opts.detail, - opts.x, opts.y, opts.x, opts.y, - opts.ctrl, opts.alt, opts.shift, opts.meta, - opts.button || 0, opts.relatedTarget); - return e; -}; module.exports = { - setUp : function(next) { - this.editor = new Editor(new MockRenderer()); - this.editor.setValue("Juhu kinners!") - next(); + name: "Liquid Tokenizer", + + setUp : function() { + this.tokenizer = new LiquidMode().getTokenizer(); }, - "test: double tap. issue #956" : function() { - // mouse up fired immediately after mouse down - var target = this.editor.renderer.getMouseEventTarget(); - target.dispatchEvent(MouseEvent("down", {x: 1, y: 1})); - target.dispatchEvent(MouseEvent("up", {x: 1, y: 1})); - target.dispatchEvent(MouseEvent("down", {x: 1, y: 1, detail: 2})); - target.dispatchEvent(MouseEvent("up", {x: 1, y: 1, detail: 2})); - - assert.equal(this.editor.getSelectedText(), "Juhu"); + "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); } + }; }); diff --git a/lib/ace/mode/lisp.js b/lib/ace/mode/lisp.js index 59c97939..11728990 100644 --- a/lib/ace/mode/lisp.js +++ b/lib/ace/mode/lisp.js @@ -27,6 +27,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * + * Contributor(s): + * + * + * * ***** END LICENSE BLOCK ***** */ /* @@ -38,18 +42,18 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var LispHighlightRules = require("./lisp_highlight_rules").LispHighlightRules; var Mode = function() { - this.HighlightRules = LispHighlightRules; + var highlighter = new LispHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); }; oop.inherits(Mode, TextMode); (function() { - - this.lineCommentStart = ";"; - - this.$id = "ace/mode/lisp"; + // Extra logic goes here. }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/lisp_highlight_rules.js b/lib/ace/mode/lisp_highlight_rules.js index 06f7344e..b33f9e07 100644 --- a/lib/ace/mode/lisp_highlight_rules.js +++ b/lib/ace/mode/lisp_highlight_rules.js @@ -67,51 +67,54 @@ var LispHighlightRules = function() { regex : ";.*$" }, { - token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], - regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" + "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.constant.character.lisp", "constant.character.lisp"], + "regex": "(#)((?:\\w|[\\\\+-=<>'\"&#])+)" }, { - token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], - regex: "(\\*)(\\S*)(\\*)" + "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", // 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" : "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" : keywordMapper, + "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - token : "string", - regex : '"(?=.)', - next : "qqstring" + "token" : "string", + "regex" : '"(?=.)', + "next" : "qqstring" } ], "qqstring": [ { - token: "constant.character.escape.lisp", - regex: "\\\\." + "token": "constant.character.escape.lisp", + "regex": "\\\\." }, { - token : "string", - regex : '[^"\\\\]+' + "token" : "string", + "regex" : '[^"\\\\]+', + "merge" : true }, { - token : "string", - regex : "\\\\$", - next : "qqstring" + "token" : "string", + "regex" : "\\\\$", + "next" : "qqstring", + "merge" : true }, { - token : "string", - regex : '"|$', - next : "start" + "token" : "string", + "regex" : '"|$', + "next" : "start", + "merge" : true } ] } 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..e1a6143a 100644 --- a/lib/ace/mode/lua.js +++ b/lib/ace/mode/lua.js @@ -33,23 +33,18 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; var LuaFoldMode = require("./folding/lua").FoldMode; var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; var Mode = function() { - this.HighlightRules = LuaHighlightRules; - + this.$tokenizer = new Tokenizer(new LuaHighlightRules().getRules()); this.foldingRules = new LuaFoldMode(); }; oop.inherits(Mode, TextMode); (function() { - - this.lineCommentStart = "--"; - this.blockComment = {start: "--[", end: "]--"}; - var indentKeywords = { "function": 1, "then": 1, @@ -71,7 +66,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 +93,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 +117,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 +128,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 +139,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..81c44905 100644 --- a/lib/ace/mode/lua_highlight_rules.js +++ b/lib/ace/mode/lua_highlight_rules.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -83,9 +83,11 @@ var LuaHighlightRules = function() { "constant.library": stdLibaries, "constant.language": builtinConstants, "invalid.illegal": futureReserved, - "variable.language": "self" + "variable.language": "this" }, "identifier"); + var strPre = ""; + var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; var integer = "(?:" + decimalInteger + "|" + hexInteger + ")"; @@ -95,71 +97,150 @@ var LuaHighlightRules = function() { 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); - 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" - } - ] + "start" : + + + // bracketed comments + [{ + token : "comment", // --[[ comment + regex : strPre + '\\-\\-\\[\\[.*\\]\\]' + }, { + token : "comment", // --[=[ comment + regex : strPre + '\\-\\-\\[\\=\\[.*\\]\\=\\]' + }, { + token : "comment", // --[==[ comment + regex : strPre + '\\-\\-\\[\\={2}\\[.*\\]\\={2}\\]' + }, { + token : "comment", // --[===[ comment + regex : strPre + '\\-\\-\\[\\={3}\\[.*\\]\\={3}\\]' + }, { + token : "comment", // --[====[ comment + regex : strPre + '\\-\\-\\[\\={4}\\[.*\\]\\={4}\\]' + }, { + token : "comment", // --[====+[ comment + regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]' }, + // multiline bracketed comments + { + token : "comment", // --[[ comment + regex : strPre + '\\-\\-\\[\\[.*$', + merge : true, + next : "qcomment" + }, { + token : "comment", // --[=[ comment + regex : strPre + '\\-\\-\\[\\=\\[.*$', + merge : true, + next : "qcomment1" + }, { + token : "comment", // --[==[ comment + regex : strPre + '\\-\\-\\[\\={2}\\[.*$', + merge : true, + next : "qcomment2" + }, { + token : "comment", // --[===[ comment + regex : strPre + '\\-\\-\\[\\={3}\\[.*$', + merge : true, + next : "qcomment3" + }, { + token : "comment", // --[====[ comment + regex : strPre + '\\-\\-\\[\\={4}\\[.*$', + merge : true, + next : "qcomment4" + }, { + token : function(value){ // --[====+[ comment + // WARNING: EXTREMELY SLOW, but this is the only way to circumvent the + // limits imposed by the current automaton. + // I've never personally seen any practical code where 5 or more '='s are + // used for string or commenting, so this will rarely be invoked. + var pattern = /\-\-\[(\=+)\[/, match; + // you can never be too paranoid ;) + if ((match = pattern.exec(value)) != null && (match = match[1]) != undefined) + comment_stack.push(match.length); + + return "comment"; + }, + regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$', + merge : true, + next : "qcomment5" + }, + + // single line comments { token : "comment", regex : "\\-\\-.*$" }, + + // bracketed strings { - 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 @@ -180,11 +261,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 index 56743ef9..9beed95b 100644 --- a/lib/ace/mode/lucene.js +++ b/lib/ace/mode/lucene.js @@ -3,17 +3,14 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules; var Mode = function() { - this.HighlightRules = LuceneHighlightRules; + this.$tokenizer = new Tokenizer(new LuceneHighlightRules().getRules()); }; 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_test.js b/lib/ace/mode/lucene_highlight_rules_test.js new file mode 100644 index 00000000..739731e2 --- /dev/null +++ b/lib/ace/mode/lucene_highlight_rules_test.js @@ -0,0 +1,99 @@ +if (typeof process !== "undefined") { + require("amd-loader"); +} + +define(function(require, exports, module) { +"use strict"; + +var LuceneMode = require("./lucene").Mode; +var assert = require("../test/assertions"); + +module.exports = { + + name: "Lucene Tokenizer", + + setUp : function() { + this.tokenizer = new LuceneMode().getTokenizer(); + }, + + "test: recognises AND as keyword" : function() { + var tokens = this.tokenizer.getLineTokens("AND", "start").tokens; + assert.equal("keyword.operator", tokens[0].type); + }, + + "test: recognises OR as keyword" : function() { + var tokens = this.tokenizer.getLineTokens("OR", "start").tokens; + assert.equal("keyword.operator", tokens[0].type); + }, + + "test: recognises NOT as keyword" : function() { + var tokens = this.tokenizer.getLineTokens("NOT", "start").tokens; + assert.equal("keyword.operator", tokens[0].type); + }, + + 'test: recognises "hello this is dog" as string' : function() { + var tokens = this.tokenizer.getLineTokens('"hello this is dog"', "start").tokens; + assert.equal("string", tokens[0].type); + }, + + 'test: recognises -"hello this is dog" as negation with string' : function() { + var tokens = this.tokenizer.getLineTokens('-"hello this is dog"', "start").tokens; + assert.equal("constant.character.negation", tokens[0].type); + assert.equal("string", tokens[1].type); + }, + + 'test: recognises ~100 as text with proximity' : function() { + var tokens = this.tokenizer.getLineTokens('~100', "start").tokens; + assert.equal("constant.character.proximity", tokens[0].type); + }, + + 'test: recognises "hello this is dog"~100 as string with proximity' : function() { + var tokens = this.tokenizer.getLineTokens('"hello this is dog"~100', "start").tokens; + + assert.equal("string", tokens[0].type); + assert.equal("constant.character.proximity", tokens[1].type); + }, + + 'test: recognises raw:"hello this is dog" as keyword' : function() { + var tokens = this.tokenizer.getLineTokens('raw:"hello this is dog"', "start").tokens; + assert.equal("keyword", tokens[0].type); + }, + + 'test: recognises raw:foo as"keyword' : function() { + var tokens = this.tokenizer.getLineTokens('raw:foo', "start").tokens; + assert.equal("keyword", tokens[0].type); + }, + + 'test: recognises "(" as opening parenthesis' : function() { + var tokens = this.tokenizer.getLineTokens('(', "start").tokens; + assert.equal("paren.lparen", tokens[0].type); + }, + + 'test: recognises ")" as closing parenthesis' : function() { + var tokens = this.tokenizer.getLineTokens(')', "start").tokens; + assert.equal("paren.rparen", tokens[0].type); + }, + + 'test: recognises foo* as text with asterisk' : function() { + var tokens = this.tokenizer.getLineTokens('foo*', "start").tokens; + assert.equal("text", tokens[0].type); + assert.equal("constant.character.asterisk", tokens[1].type); + }, + + 'test: recognises foo? as text with interro' : function() { + var tokens = this.tokenizer.getLineTokens('foo?', "start").tokens; + assert.equal("text", tokens[0].type); + assert.equal("constant.character.interro", tokens[1].type); + }, + + 'test: recognises single word as text' : function() { + var tokens = this.tokenizer.getLineTokens(' foo', "start").tokens; + assert.equal("text", tokens[0].type); + } +}; + +}); + +if (typeof module !== "undefined" && module === require.main) { + require("asyncjs").test.testcase(module.exports).exec(); +} \ No newline at end of file diff --git a/lib/ace/mode/makefile.js b/lib/ace/mode/makefile.js index efeca6ee..77a0bad7 100644 --- a/lib/ace/mode/makefile.js +++ b/lib/ace/mode/makefile.js @@ -26,6 +26,11 @@ * (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 ***** */ /* @@ -37,21 +42,18 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; var Mode = function() { - this.HighlightRules = MakefileHighlightRules; - this.foldingRules = new FoldMode(); + var highlighter = new MakefileHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); }; oop.inherits(Mode, TextMode); (function() { - - this.lineCommentStart = "#"; - this.$indentWithTabs = true; - - this.$id = "ace/mode/makefile"; + // Extra logic goes here. }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/makefile_highlight_rules.js b/lib/ace/mode/makefile_highlight_rules.js index 53ef1d05..38267547 100644 --- a/lib/ace/mode/makefile_highlight_rules.js +++ b/lib/ace/mode/makefile_highlight_rules.js @@ -21,48 +21,48 @@ var MakefileHighlightRules = function() { { "start": [ { - token: "string.interpolated.backtick.makefile", - regex: "`", - next: "shell-start" + "token": "string.interpolated.backtick.makefile", + "regex": "`", + "next": "shell-start" }, { - token: "punctuation.definition.comment.makefile", - regex: /#(?=.)/, - next: "comment" + "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)" + "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*.*)" + "token": ["entity.name.function.makefile", "text"], + "regex": "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)" } ], "comment": [ { - token : "punctuation.definition.comment.makefile", - regex : /.+\\/ + "token" : "punctuation.definition.comment.makefile", + "regex" : /.+\\/ }, { - token : "punctuation.definition.comment.makefile", - regex : ".+", - next : "start" + "token" : "punctuation.definition.comment.makefile", + "regex" : ".+", + "next" : "start" } ], "shell-start": [ { - token: keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + "token": keywordMapper, + "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - token: "string", - regex : "\\w+" + "token": "string", + "regex" : "\\w+" }, { - token : "string.interpolated.backtick.makefile", - regex : "`", - next : "start" + "token" : "string.interpolated.backtick.makefile", + "regex" : "`", + "next" : "start" } ] } diff --git a/lib/ace/mode/markdown.js b/lib/ace/mode/markdown.js index efabed89..85cdff1e 100644 --- a/lib/ace/mode/markdown.js +++ b/lib/ace/mode/markdown.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -36,26 +36,26 @@ 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); @@ -69,7 +69,6 @@ oop.inherits(Mode, TextMode); 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..59c4f936 100644 --- a/lib/ace/mode/markdown_highlight_rules.js +++ b/lib/ace/mode/markdown_highlight_rules.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -32,195 +32,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.2", + regex: "^\\-+(?=\\s*$)" + }, { // header + token : function(value) { + return "markup.heading." + value.search(/[^#]/); + }, + regex : "^#{1,6}(?:[^ #].*| +.*(?:[^ #].*|[^ ]+.* +#+ *))$" + }, github_embed("(?:javascript|js)", "js-"), + github_embed("xml", "xml-"), + github_embed("html", "html-"), + github_embed("css", "css-"), + { // Github style block + token : "support.function", + regex : "^```[a-zA-Z]*\\s*$", + next : "githubblock" + }, { // block quote + token : "string", + regex : "^>[ ].+$", + next : "blockquote" }, { // reference token : ["text", "constant", "text", "url", "string", "text"], regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" }, { // link by reference token : ["text", "string", "text", "constant", "text"], - regex : "(\\[)(" + 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/ext/old_ie_test.js b/lib/ace/mode/markdown_highlight_rules_test.js similarity index 50% rename from lib/ace/ext/old_ie_test.js rename to lib/ace/mode/markdown_highlight_rules_test.js index 98652e14..4c828e49 100644 --- a/lib/ace/ext/old_ie_test.js +++ b/lib/ace/mode/markdown_highlight_rules_test.js @@ -1,9 +1,9 @@ /* ***** BEGIN LICENSE BLOCK ***** * Distributed under the BSD license: * - * Copyright (c) 2010, Ajax.org B.V. + * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -26,6 +26,11 @@ * (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): + * + * quexer + * * ***** END LICENSE BLOCK ***** */ if (typeof process !== "undefined") { @@ -35,43 +40,61 @@ if (typeof process !== "undefined") { define(function(require, exports, module) { "use strict"; +var Mode = require("./markdown").Mode; 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; - } + setUp : function() { + this.tokenizer = new Mode().getTokenizer(); + }, + + "test: header 1 ": function() { + var tokens = this.tokenizer.getLineTokens("#f", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, 'markup.heading.1'); + }, + + "test: header 2": function() { + var tokens = this.tokenizer.getLineTokens("## foo", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, 'markup.heading.2'); + }, + + "test: header ends with ' #'": function() { + var tokens = this.tokenizer.getLineTokens("# # # ", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, 'markup.heading.1'); + }, + + "test: header ends with '#'": function() { + var tokens = this.tokenizer.getLineTokens("#foo# ", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, 'markup.heading.1'); + }, + + "test: 6+ #s is not a valid header": function() { + var tokens = this.tokenizer.getLineTokens("####### foo", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, 'text'); + }, + + "test: # followed be only space is not a valid header": function() { + var tokens = this.tokenizer.getLineTokens("# ", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, 'text'); + }, + + + + "test: only space between #s is not a valid header": function() { + var tokens = this.tokenizer.getLineTokens("# #", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, 'text'); } }; }); 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/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..abdd7ed4 100644 --- a/lib/ace/mode/matching_brace_outdent.js +++ b/lib/ace/mode/matching_brace_outdent.js @@ -60,7 +60,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/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 index 99fdb410..a659d836 100644 --- a/lib/ace/mode/objectivec.js +++ b/lib/ace/mode/objectivec.js @@ -42,19 +42,18 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").ObjectiveCHighlightRules; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.HighlightRules = ObjectiveCHighlightRules; - this.foldingRules = new CStyleFoldMode(); + var highlighter = new ObjectiveCHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); }; oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/objectivec"; + // Extra logic goes here. (see below) }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/objectivec_highlight_rules.js b/lib/ace/mode/objectivec_highlight_rules.js index 7a581c28..2d557688 100644 --- a/lib/ace/mode/objectivec_highlight_rules.js +++ b/lib/ace/mode/objectivec_highlight_rules.js @@ -17,19 +17,22 @@ var ObjectiveCHighlightRules = function() { "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 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 = { + this.$rules = + { "start": [ { token : "comment", @@ -38,254 +41,255 @@ var ObjectiveCHighlightRules = function() { DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment + merge : true, regex : "\\/\\*", next : "comment" }, { - token: [ "storage.type.objc", "punctuation.definition.storage.type.objc", + "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]+)" + "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" ], + "regex": "(@end)" }, { - token: [ "storage.type.objc", "entity.name.type.objc", + "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]*))?" + "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": "string.begin.objc", + "regex": '@"', + "next": "constant_NSString" }, { - token: "storage.type.objc", - regex: "\\bid\\s*<", - next: "protocol_list" + "token": "storage.type.objc", + "regex": "\\bid\\s*<", + "next": "protocol_list" }, { - token: "keyword.control.macro.objc", - regex: "\\bNS_DURING|NS_HANDLER|NS_ENDHANDLER\\b" + "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.control.exception.objc"], + "regex": "(@)(try|catch|finally|throw)\\b" }, { - token: ["punctuation.definition.keyword.objc", "keyword.other.objc"], - regex: "(@)(defs|encode)\\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.id.objc", "text"], + "regex": "(\\bid\\b)(\\s|\\n)?" }, { - token: "storage.type.objc", - regex: "\\bIBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class\\b" + "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", "storage.type.objc"], + "regex": "(@)(class|protocol)\\b" }, { - token: [ "punctuation.definition.storage.type.objc", "punctuation"], - regex: "(@selector)(\\s*\\()", - next: "selectors" + "token": [ "punctuation.definition.storage.type.objc", "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": [ "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": "constant.language.objc", + "regex": "\\bYES|NO|Nil|nil\\b" }, { - token: "support.variable.foundation", - regex: "\\bNSApp\\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.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.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.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.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.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.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.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.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.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.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.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.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.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": "support.function.C99.c", + "regex": C_Highlight_File.cFunctions }, { - token : cObj.getKeywords(), - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + "token" : cObj.getKeywords(), + "regex" : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - token: "punctuation.section.scope.begin.objc", - regex: "\\[", - next: "bracketed_content" + "token": "punctuation.section.scope.begin.objc", + "regex": "\\[", + "next": "bracketed_content" }, { - token: "meta.function.objc", - regex: "^(?:-|\\+)\\s*" + "token": "meta.function.objc", + "regex": "^(?:-|\\+)\\s*" } ], "constant_NSString": [ { - token: "constant.character.escape.objc", - regex: escapedConstRe + "token": "constant.character.escape.objc", + "regex": escapedConstRe }, { - token: "invalid.illegal.unknown-escape.objc", - regex: "\\\\." + "token": "invalid.illegal.unknown-escape.objc", + "regex": "\\\\." }, { - token: "string", - regex: '[^"\\\\]+' + "token": "string", + "regex": '[^"\\\\]+' }, { - token: "punctuation.definition.string.end", - regex: "\"", - next: "start" + "token": "punctuation.definition.string.end", + "regex": "\"", + "next": "start" } ], "protocol_list": [ { - token: "punctuation.section.scope.end.objc", - regex: ">", - next: "start" + "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" + "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": "support.function.any-method.name-of-parameter.objc", + "regex": "\\b(?:[a-zA-Z_:][\\w]*)+" }, { - token: "punctuation", - regex: "\\)", - next: "start" + "token": "punctuation", + "regex": "\\)", + "next": "start" } ], "bracketed_content": [ { - token: "punctuation.section.scope.end.objc", - regex: "\]", - next: "start" + "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": "(?:predicateWithFormat:| NSPredicate predicateWithFormat:)", + "next": "start" }, { - token: "support.function.any-method.objc", - regex: "\\w+(?::|(?=\]))", - next: "start" + "token": ["support.function.any-method.objc", "punctuation.separator.arguments.objc"], + "regex": "\\w+(?::|(?=\]))", + "next": "start" } ], "bracketed_strings": [ { - token: "punctuation.section.scope.end.objc", - regex: "\]", - next: "start" + "token": "punctuation.section.scope.end.objc", + "regex": "\]", + "next": "start" }, { - token: "keyword.operator.logical.predicate.cocoa", - regex: "\\b(?:AND|OR|NOT|IN)\\b" + "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+)(:)" + "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(?: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(?: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": "\\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": "\\bC(?:ASEINSENSITIVE|I)\\b", + "token": "keyword.other.modifier.predicate.cocoa" }, { - regex: "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", - token: "keyword.other.predicate.cocoa" + "regex": "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", + "token": "keyword.other.predicate.cocoa" }, { - regex: escapedConstRe, - token: "constant.character.escape.objc" + "regex": escapedConstRe, + "token": "constant.character.escape.objc" }, { - regex: "\\\\.", - token: "invalid.illegal.unknown-escape.objc" + "regex": "\\\\.", + "token": "invalid.illegal.unknown-escape.objc" }, { - token: "string", - regex: '[^"\\\\]' + "token": "string", + "regex": '[^"\\\\]' }, { - token: "punctuation.definition.string.end.objc", - regex: "\"", - next: "predicates" + "token": "punctuation.definition.string.end.objc", + "regex": "\"", + "next": "predicates" } ], "comment" : [ @@ -295,6 +299,7 @@ var ObjectiveCHighlightRules = function() { next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ], @@ -309,17 +314,24 @@ var ObjectiveCHighlightRules = function() { // 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 { + if (r == "start") { + for (var key in cRules[r]) { + this.$rules.start.push(cRules[r][key]) + } + } + else { this.$rules[r] = cRules[r]; } } - - this.$rules.bracketed_content = this.$rules.bracketed_content.concat( - this.$rules.start, specialVariables - ); + + var startRules = this.$rules.start; + for (var s in startRules) { + this.$rules.bracketed_content.push(startRules[s]); + } + for (var s in specialVariables) { + this.$rules.bracketed_content.push(specialVariables[s]); + } + this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); diff --git a/lib/ace/mode/ocaml.js b/lib/ace/mode/ocaml.js index 6313d3fb..6367b937 100644 --- a/lib/ace/mode/ocaml.js +++ b/lib/ace/mode/ocaml.js @@ -33,13 +33,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 +73,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 +89,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..c970ed80 100644 --- a/lib/ace/mode/ocaml_highlight_rules.js +++ b/lib/ace/mode/ocaml_highlight_rules.js @@ -257,6 +257,7 @@ var OcamlHighlightRules = function() { }, { token : "comment", + merge : true, regex : '\\(\\*.*', next : "comment" }, @@ -270,6 +271,7 @@ var OcamlHighlightRules = function() { }, { token : "string", // " string + merge : true, regex : '"', next : "qstring" }, @@ -314,6 +316,7 @@ var OcamlHighlightRules = function() { }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ], @@ -325,6 +328,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..cf14afbf 100644 --- a/lib/ace/mode/perl.js +++ b/lib/ace/mode/perl.js @@ -33,32 +33,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 +104,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..7b5dcc5c 100644 --- a/lib/ace/mode/perl_highlight_rules.js +++ b/lib/ace/mode/perl_highlight_rules.js @@ -80,9 +80,8 @@ var PerlHighlightRules = function() { this.$rules = { "start" : [ { - token : "comment.doc", - regex : "^=(?:begin|item)\\b", - next : "block_comment" + token : "comment", + regex : "#.*$" }, { token : "string.regexp", regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" @@ -91,6 +90,7 @@ var PerlHighlightRules = function() { regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' }, { token : "string", // multi line string start + merge : true, regex : '["].*\\\\$', next : "qqstring" }, { @@ -98,6 +98,7 @@ var PerlHighlightRules = function() { regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token : "string", // multi line string start + merge : true, regex : "['].*\\\\$", next : "qstring" }, { @@ -111,10 +112,7 @@ var PerlHighlightRules = function() { 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 +131,7 @@ var PerlHighlightRules = function() { next : "start" }, { token : "string", + merge : true, regex : '.+' } ], @@ -143,18 +142,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..e319f2a1 100755 --- a/lib/ace/mode/pgsql.js +++ b/lib/ace/mode/pgsql.js @@ -30,30 +30,58 @@ 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("../lib/oop"); + var TextMode = require("../mode/text").Mode; + var Tokenizer = require("../tokenizer").Tokenizer; + var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules; + var Range = require("../range").Range; -var Mode = function() { - this.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..c0a37cc2 100755 --- a/lib/ace/mode/pgsql_highlight_rules.js +++ b/lib/ace/mode/pgsql_highlight_rules.js @@ -34,54 +34,50 @@ 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; -// 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. + // Keywords, functions, operators last updated for pg 9.1. var keywords = ( "abort|absolute|abstime|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|" + - "analyse|analyze|and|any|anyarray|anyelement|anyenum|anynonarray|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|" + + "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|" + @@ -94,228 +90,208 @@ var PgsqlHighlightRules = function() { "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 +299,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 +333,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 +349,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 +357,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,33 +374,32 @@ 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" ); var keywordMapper = this.createKeywordMapper({ @@ -447,7 +408,8 @@ var PgsqlHighlightRules = function() { }, "identifier", true); - var sqlRules = [{ + var sqlRules = [ + { token : "string", // single line string -- assume dollar strings if multi-line for now regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { @@ -458,34 +420,36 @@ var PgsqlHighlightRules = function() { 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+" - } + 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" },{ @@ -498,11 +462,13 @@ var PgsqlHighlightRules = function() { } ], - "statement" : [{ + "statement" : [ + { token : "comment", regex : "--.*$" }, { token : "comment", // multi-line comment + merge : true, regex : "\\/\\*", next : "commentStatement" }, { @@ -510,22 +476,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" @@ -536,11 +494,13 @@ var PgsqlHighlightRules = function() { } ].concat(sqlRules), - "dollarSql" : [{ + "dollarSql" : [ + { token : "comment", regex : "--.*$" }, { token : "comment", // multi-line comment + merge : true, regex : "\\/\\*", next : "commentDollarSql" }, { @@ -554,52 +514,62 @@ var PgsqlHighlightRules = function() { } ].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 : ".+" } ] @@ -608,8 +578,6 @@ var PgsqlHighlightRules = function() { 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..a73f3e84 100644 --- a/lib/ace/mode/php.js +++ b/lib/ace/mode/php.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -33,25 +33,21 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules; -var 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() { @@ -61,7 +57,7 @@ oop.inherits(PhpMode, TextMode); + unicode.packages.Nd + unicode.packages.Pc + "\_]+", "g" ); - + this.nonTokenRe = new RegExp("^(?:[^" + unicode.packages.L + unicode.packages.Mn + unicode.packages.Mc @@ -69,28 +65,53 @@ oop.inherits(PhpMode, TextMode); + unicode.packages.Pc + "\_]|\s])+", "g" ); + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var outdent = true; + var re = /^(\s*)#/; - this.lineCommentStart = ["//", "#"]; - this.blockComment = {start: "/*", end: "*/"}; + 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") { + if (state == "php-start") { var match = line.match(/^.*[\{\(\[\:]\s*$/); if (match) { indent += tab; } - } else if (state == "doc-start") { - if (endState != "doc-start") { + } else if (state == "php-doc-start") { + if (endState != "php-doc-start") { return ""; } var match = line.match(/^\s*(\/?)\*/); @@ -113,48 +134,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..080879bc 100644 --- a/lib/ace/split.js +++ b/lib/ace/split.js @@ -39,13 +39,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 +96,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 +133,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 +154,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 +195,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 +207,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 +219,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 +245,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 +261,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 +295,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 +320,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 +356,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_browser.js b/lib/ace/test/all_browser.js index 7ac5092e..bd5caf29 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,36 @@ 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/lucene_highlight_rules_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" ]; @@ -72,8 +67,6 @@ 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); @@ -83,12 +76,6 @@ require(testNames, function() { 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/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/mockrenderer.js b/lib/ace/test/mockrenderer.js index ba4c9563..e22104a7 100644 --- a/lib/ace/test/mockrenderer.js +++ b/lib/ace/test/mockrenderer.js @@ -33,7 +33,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 +193,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 index 9f9f7afa..524ad03a 100644 --- a/lib/ace/theme/ambiance.css +++ b/lib/ace/theme/ambiance.css @@ -16,10 +16,6 @@ background: repeat left top; } -.ace-ambiance .ace_gutter-active-line { - background-color: #3F3F3F; -} - .ace-ambiance .ace_fold-widget { text-align: center; } @@ -55,15 +51,15 @@ } .ace-ambiance .ace_scroller { + background-color: #202020; -webkit-box-shadow: inset 0 0 10px black; -moz-box-shadow: inset 0 0 10px black; -o-box-shadow: inset 0 0 10px black; box-shadow: inset 0 0 10px black; } -.ace-ambiance { +.ace-ambiance .ace_text-layer { color: #E6E1DC; - background-color: #202020; } .ace-ambiance .ace_cursor { 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..773c213c 100644 --- a/lib/ace/theme/chrome.css +++ b/lib/ace/theme/chrome.css @@ -9,13 +9,17 @@ background: #e8e8e8; } -.ace-chrome { +.ace-chrome .ace_scroller { background-color: #FFFFFF; - color: black; } .ace-chrome .ace_cursor { - color: black; + border-left: 2px solid black; +} + +.ace-chrome .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid black; } .ace-chrome .ace_invisible { @@ -93,11 +97,11 @@ } -.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); } diff --git a/lib/ace/theme/clouds.css b/lib/ace/theme/clouds.css index c11308d4..4ff7e7c2 100644 --- a/lib/ace/theme/clouds.css +++ b/lib/ace/theme/clouds.css @@ -8,13 +8,21 @@ background: #e8e8e8 } -.ace-clouds { - background-color: #FFFFFF; +.ace-clouds .ace_scroller { + background-color: #FFFFFF +} + +.ace-clouds .ace_text-layer { color: #000000 } .ace-clouds .ace_cursor { - color: #000000 + border-left: 2px solid #000000 +} + +.ace-clouds .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #000000 } .ace-clouds .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-clouds.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; + border-radius: 2px } .ace-clouds .ace_marker-layer .ace_step { @@ -106,6 +115,10 @@ 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 } \ No newline at end of file diff --git a/lib/ace/theme/clouds.js b/lib/ace/theme/clouds.js index aa36edcf..f9b7c6bf 100644 --- a/lib/ace/theme/clouds.js +++ b/lib/ace/theme/clouds.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/clouds_midnight.css b/lib/ace/theme/clouds_midnight.css index 08ee089d..6bc319d1 100644 --- a/lib/ace/theme/clouds_midnight.css +++ b/lib/ace/theme/clouds_midnight.css @@ -8,13 +8,21 @@ background: #232323 } -.ace-clouds-midnight { - background-color: #191919; +.ace-clouds-midnight .ace_scroller { + background-color: #191919 +} + +.ace-clouds-midnight .ace_text-layer { color: #929292 } .ace-clouds-midnight .ace_cursor { - color: #7DA5DC + border-left: 2px solid #7DA5DC +} + +.ace-clouds-midnight .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #7DA5DC } .ace-clouds-midnight .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-clouds-midnight.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #191919; + border-radius: 2px } .ace-clouds-midnight .ace_marker-layer .ace_step { @@ -47,7 +56,7 @@ } .ace-clouds-midnight .ace_invisible { - color: #666 + color: #BFBFBF } .ace-clouds-midnight .ace_keyword, @@ -107,6 +116,10 @@ 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..a7b76d65 100644 --- a/lib/ace/theme/clouds_midnight.js +++ b/lib/ace/theme/clouds_midnight.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/cobalt.css b/lib/ace/theme/cobalt.css index b883ba97..3717ba64 100644 --- a/lib/ace/theme/cobalt.css +++ b/lib/ace/theme/cobalt.css @@ -1,20 +1,28 @@ .ace-cobalt .ace_gutter { background: #011e3a; - color: rgb(128,145,160) + color: #fff } .ace-cobalt .ace_print-margin { width: 1px; - background: #555555 + background: #011e3a } -.ace-cobalt { - background-color: #002240; +.ace-cobalt .ace_scroller { + background-color: #002240 +} + +.ace-cobalt .ace_text-layer { color: #FFFFFF } .ace-cobalt .ace_cursor { - color: #FFFFFF + border-left: 2px solid #FFFFFF +} + +.ace-cobalt .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #FFFFFF } .ace-cobalt .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-cobalt.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #002240; + border-radius: 2px } .ace-cobalt .ace_marker-layer .ace_step { @@ -105,17 +114,6 @@ 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 -} - .ace-cobalt .ace_variable { color: #CCCCCC } @@ -128,6 +126,19 @@ color: #9EFFFF } -.ace-cobalt .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y +.ace-cobalt .ace_markup.ace_underline { + text-decoration: underline } + +.ace-cobalt .ace_markup.ace_heading { + color: #C8E4FD; + background-color: #001221 +} + +.ace-cobalt .ace_markup.ace_list { + background-color: #130D26 +} + +.ace-cobalt .ace_indent-guide { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUHL4zzBz5sz/AA80BCzv+WXhAAAAAElFTkSuQmCC) right repeat-y +} \ No newline at end of file diff --git a/lib/ace/theme/cobalt.js b/lib/ace/theme/cobalt.js index a466dd6c..6e2f3d0a 100644 --- a/lib/ace/theme/cobalt.js +++ b/lib/ace/theme/cobalt.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/crimson_editor.css b/lib/ace/theme/crimson_editor.css index e84292b4..2d4a0eef 100644 --- a/lib/ace/theme/crimson_editor.css +++ b/lib/ace/theme/crimson_editor.css @@ -14,13 +14,21 @@ background: #e8e8e8; } -.ace-crimson-editor { +.ace-crimson-editor .ace_scroller { 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_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid black; } .ace-crimson-editor .ace_invisible { diff --git a/lib/ace/theme/dawn.css b/lib/ace/theme/dawn.css index 3c2884e1..ca544fea 100644 --- a/lib/ace/theme/dawn.css +++ b/lib/ace/theme/dawn.css @@ -8,13 +8,21 @@ background: #e8e8e8 } -.ace-dawn { - background-color: #F9F9F9; +.ace-dawn .ace_scroller { + background-color: #F9F9F9 +} + +.ace-dawn .ace_text-layer { color: #080808 } .ace-dawn .ace_cursor { - color: #000000 + border-left: 2px solid #000000 +} + +.ace-dawn .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #000000 } .ace-dawn .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-dawn.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #F9F9F9; + border-radius: 2px } .ace-dawn .ace_marker-layer .ace_step { @@ -88,7 +97,6 @@ border-color: #080808 } -.ace-dawn .ace_list, .ace-dawn .ace_markup.ace_list, .ace-dawn .ace_support.ace_function { color: #693A17 @@ -112,15 +120,18 @@ color: #5A525F } -.ace-dawn .ace_heading, -.ace-dawn .ace_markup.ace_heading { - color: #19356D -} - .ace-dawn .ace_variable { color: #234A97 } +.ace-dawn .ace_markup.ace_underline { + text-decoration: underline +} + +.ace-dawn .ace_markup.ace_heading { + color: #19356D +} + .ace-dawn .ace_indent-guide { - background: url(data:image/png;base64,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..f31f00b8 100644 --- a/lib/ace/theme/dawn.js +++ b/lib/ace/theme/dawn.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/dreamweaver.css b/lib/ace/theme/dreamweaver.css index 84865a1c..30f77cbf 100644 --- a/lib/ace/theme/dreamweaver.css +++ b/lib/ace/theme/dreamweaver.css @@ -8,17 +8,24 @@ background: #e8e8e8; } -.ace-dreamweaver { +.ace-dreamweaver .ace_scroller { 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_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid black; } .ace-dreamweaver .ace_invisible { @@ -101,11 +108,11 @@ } -.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); } @@ -130,10 +137,6 @@ background: rgba(0, 0, 0, 0.07); } -.ace-dreamweaver .ace_gutter-active-line { - background-color : #DCDCDC; -} - .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/eclipse.css b/lib/ace/theme/eclipse.css index c83d07a3..ce65575b 100644 --- a/lib/ace/theme/eclipse.css +++ b/lib/ace/theme/eclipse.css @@ -9,17 +9,19 @@ background: #ebebeb; } -.ace-eclipse { +.ace-eclipse .ace_scroller { background-color: #FFFFFF; - color: black; } .ace-eclipse .ace_fold { background-color: rgb(60, 76, 114); } +.ace-eclipse .ace_text-layer { +} + .ace-eclipse .ace_cursor { - color: black; + border-left: 2px solid black; } .ace-eclipse .ace_storage, @@ -45,7 +47,7 @@ } .ace-eclipse .ace_comment { - color: rgb(113, 150, 130); + color: rgb(63, 127, 95); } .ace-eclipse .ace_comment.ace_doc { @@ -57,11 +59,10 @@ } .ace-eclipse .ace_constant.ace_numeric { - color: darkblue; } .ace-eclipse .ace_tag { - color: rgb(25, 118, 116); + color: rgb(63, 127, 127); } .ace-eclipse .ace_type { @@ -82,11 +83,7 @@ } .ace-eclipse .ace_meta.ace_tag { - color:rgb(25, 118, 116); -} - -.ace-eclipse .ace_invisible { - color: #ddd; + color:rgb(63, 127, 127); } .ace-eclipse .ace_entity.ace_other.ace_attribute-name { @@ -96,14 +93,10 @@ 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 { border: 1px solid rgb(181, 213, 255); } diff --git a/lib/ace/theme/github.css b/lib/ace/theme/github.css index 213d3fd3..5b059727 100644 --- a/lib/ace/theme/github.css +++ b/lib/ace/theme/github.css @@ -5,9 +5,8 @@ color: #AAA; } -.ace-github { +.ace-github .ace_scroller { background: #fff; - color: #000; } .ace-github .ace_keyword { @@ -64,15 +63,20 @@ font-weight: bold; } -.ace-github .ace_cursor { - color: black; +.ace-github .ace_text-layer { } -.ace-github.ace_focus .ace_marker-layer .ace_active-line { - background: rgb(255, 255, 204); +.ace-github .ace_cursor { + border-left: 2px solid black; } + +.ace-github .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid black; +} + .ace-github .ace_marker-layer .ace_active-line { - background: rgb(245, 245, 245); + background: rgb(255, 255, 204); } .ace-github .ace_marker-layer .ace_selection { @@ -109,10 +113,7 @@ .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 { diff --git a/lib/ace/theme/idle_fingers.css b/lib/ace/theme/idle_fingers.css index b5e1bff2..43eff698 100644 --- a/lib/ace/theme/idle_fingers.css +++ b/lib/ace/theme/idle_fingers.css @@ -1,6 +1,6 @@ .ace-idle-fingers .ace_gutter { background: #3b3b3b; - color: rgb(153,153,153) + color: #fff } .ace-idle-fingers .ace_print-margin { @@ -8,13 +8,21 @@ background: #3b3b3b } -.ace-idle-fingers { - background-color: #323232; +.ace-idle-fingers .ace_scroller { + background-color: #323232 +} + +.ace-idle-fingers .ace_text-layer { color: #FFFFFF } .ace-idle-fingers .ace_cursor { - color: #91FF00 + border-left: 2px solid #91FF00 +} + +.ace-idle-fingers .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #91FF00 } .ace-idle-fingers .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-idle-fingers.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #323232; + border-radius: 2px } .ace-idle-fingers .ace_marker-layer .ace_step { @@ -102,11 +111,15 @@ color: #FFC66D } +.ace-idle-fingers .ace_markup.ace_underline { + text-decoration: underline +} + .ace-idle-fingers .ace_collab.ace_user1 { color: #323232; background-color: #FFF980 } .ace-idle-fingers .ace_indent-guide { - background: url(data:image/png;base64,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..5da497f0 100644 --- a/lib/ace/theme/idle_fingers.js +++ b/lib/ace/theme/idle_fingers.js @@ -3,7 +3,7 @@ * * 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 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..0f42c384 100644 --- a/lib/ace/theme/kr_theme.css +++ b/lib/ace/theme/kr_theme.css @@ -8,13 +8,21 @@ background: #1c1917 } -.ace-kr-theme { - background-color: #0B0A09; +.ace-kr-theme .ace_scroller { + background-color: #0B0A09 +} + +.ace-kr-theme .ace_text-layer { color: #FCFFE0 } .ace-kr-theme .ace_cursor { - color: #FF9900 + border-left: 2px solid #FF9900 +} + +.ace-kr-theme .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #FF9900 } .ace-kr-theme .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-kr-theme.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #0B0A09; + border-radius: 2px } .ace-kr-theme .ace_marker-layer .ace_step { @@ -105,11 +114,6 @@ color: #D1A796 } -.ace-kr-theme .ace_list, -.ace-kr-theme .ace_markup.ace_list { - background-color: #0F0040 -} - .ace-kr-theme .ace_variable.ace_language { color: #FF80E1 } @@ -118,6 +122,14 @@ 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..2018a962 100644 --- a/lib/ace/theme/kr_theme.js +++ b/lib/ace/theme/kr_theme.js @@ -3,7 +3,7 @@ * * 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 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..69e81376 100644 --- a/lib/ace/theme/merbivore.css +++ b/lib/ace/theme/merbivore.css @@ -8,13 +8,21 @@ background: #555651 } -.ace-merbivore { - background-color: #161616; +.ace-merbivore .ace_scroller { + background-color: #161616 +} + +.ace-merbivore .ace_text-layer { color: #E6E1DC } .ace-merbivore .ace_cursor { - color: #FFFFFF + border-left: 2px solid #FFFFFF +} + +.ace-merbivore .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #FFFFFF } .ace-merbivore .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-merbivore.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #161616; + border-radius: 2px } .ace-merbivore .ace_marker-layer .ace_step { @@ -104,6 +113,10 @@ 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..699fb2eb 100644 --- a/lib/ace/theme/merbivore.js +++ b/lib/ace/theme/merbivore.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/merbivore_soft.css b/lib/ace/theme/merbivore_soft.css index 0d615376..ddd417f8 100644 --- a/lib/ace/theme/merbivore_soft.css +++ b/lib/ace/theme/merbivore_soft.css @@ -8,13 +8,21 @@ background: #262424 } -.ace-merbivore-soft { - background-color: #1C1C1C; +.ace-merbivore-soft .ace_scroller { + background-color: #1C1C1C +} + +.ace-merbivore-soft .ace_text-layer { color: #E6E1DC } .ace-merbivore-soft .ace_cursor { - color: #FFFFFF + border-left: 2px solid #FFFFFF +} + +.ace-merbivore-soft .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #FFFFFF } .ace-merbivore-soft .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-merbivore-soft.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #1C1C1C; + border-radius: 2px } .ace-merbivore-soft .ace_marker-layer .ace_step { @@ -105,6 +114,10 @@ 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..873a6023 100644 --- a/lib/ace/theme/merbivore_soft.js +++ b/lib/ace/theme/merbivore_soft.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/mono_industrial.css b/lib/ace/theme/mono_industrial.css index 6630e4a2..f9a318fc 100644 --- a/lib/ace/theme/mono_industrial.css +++ b/lib/ace/theme/mono_industrial.css @@ -8,13 +8,21 @@ background: #555651 } -.ace-mono-industrial { - background-color: #222C28; +.ace-mono-industrial .ace_scroller { + background-color: #222C28 +} + +.ace-mono-industrial .ace_text-layer { color: #FFFFFF } .ace-mono-industrial .ace_cursor { - color: #FFFFFF + border-left: 2px solid #FFFFFF +} + +.ace-mono-industrial .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #FFFFFF } .ace-mono-industrial .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-mono-industrial.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #222C28; + border-radius: 2px } .ace-mono-industrial .ace_marker-layer .ace_step { @@ -116,10 +125,14 @@ color: #909993 } +.ace-mono-industrial .ace_markup.ace_underline { + text-decoration: underline +} + .ace-mono-industrial .ace_entity.ace_name.ace_tag { color: #A65EFF } .ace-mono-industrial .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y -} \ No newline at end of file + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ0tH4zzBz5sz/ABAOBECKH+evAAAAAElFTkSuQmCC) right repeat-y +} diff --git a/lib/ace/theme/mono_industrial.js b/lib/ace/theme/mono_industrial.js index cf0d0e48..af763292 100644 --- a/lib/ace/theme/mono_industrial.js +++ b/lib/ace/theme/mono_industrial.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/monokai.css b/lib/ace/theme/monokai.css index bcc26ef4..1d772e24 100644 --- a/lib/ace/theme/monokai.css +++ b/lib/ace/theme/monokai.css @@ -1,6 +1,6 @@ .ace-monokai .ace_gutter { - background: #2F3129; - color: #8F908A + background: #2f3129; + color: #f1f1f1 } .ace-monokai .ace_print-margin { @@ -8,13 +8,21 @@ background: #555651 } -.ace-monokai { - background-color: #272822; +.ace-monokai .ace_scroller { + background-color: #272822 +} + +.ace-monokai .ace_text-layer { color: #F8F8F2 } .ace-monokai .ace_cursor { - color: #F8F8F0 + border-left: 2px solid #F8F8F0 +} + +.ace-monokai .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #F8F8F0 } .ace-monokai .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-monokai.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #272822; + border-radius: 2px } .ace-monokai .ace_marker-layer .ace_step { @@ -47,21 +56,16 @@ } .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_meta, .ace-monokai .ace_storage { color: #F92672 } -.ace-monokai .ace_punctuation, -.ace-monokai .ace_punctuation.ace_tag { - color: #fff -} - .ace-monokai .ace_constant.ace_character, .ace-monokai .ace_constant.ace_language, .ace-monokai .ace_constant.ace_numeric, @@ -98,7 +102,6 @@ .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 } @@ -116,6 +119,10 @@ color: #75715E } +.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..a33326bd 100644 --- a/lib/ace/theme/monokai.js +++ b/lib/ace/theme/monokai.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/pastel_on_dark.css b/lib/ace/theme/pastel_on_dark.css index 0b637174..b517f22a 100644 --- a/lib/ace/theme/pastel_on_dark.css +++ b/lib/ace/theme/pastel_on_dark.css @@ -8,13 +8,21 @@ background: #353030 } -.ace-pastel-on-dark { - background-color: #2C2828; +.ace-pastel-on-dark .ace_scroller { + background-color: #2C2828 +} + +.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_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #A7A7A7 } .ace-pastel-on-dark .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #2C2828; + border-radius: 2px } .ace-pastel-on-dark .ace_marker-layer .ace_step { @@ -123,6 +132,10 @@ 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..5c11fd4c 100644 --- a/lib/ace/theme/pastel_on_dark.js +++ b/lib/ace/theme/pastel_on_dark.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/solarized_dark.css b/lib/ace/theme/solarized_dark.css index 09740e69..4d47fb76 100644 --- a/lib/ace/theme/solarized_dark.css +++ b/lib/ace/theme/solarized_dark.css @@ -8,19 +8,23 @@ background: #33555E } -.ace-solarized-dark { - background-color: #002B36; - color: #93A1A1 +.ace-solarized-dark .ace_scroller { + background-color: #002B36 } .ace-solarized-dark .ace_entity.ace_other.ace_attribute-name, -.ace-solarized-dark .ace_storage { +.ace-solarized-dark .ace_storage, +.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_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #D30102 } .ace-solarized-dark .ace_marker-layer .ace_active-line, @@ -30,6 +34,7 @@ .ace-solarized-dark.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #002B36; + border-radius: 2px } .ace-solarized-dark .ace_marker-layer .ace_step { @@ -90,11 +95,19 @@ color: #2AA198 } +.ace-solarized-dark .ace_string.ace_regexp { + color: #D30102 +} + .ace-solarized-dark .ace_comment { font-style: italic; color: #657B83 } +.ace-solarized-dark .ace_markup.ace_underline { + text-decoration: underline +} + .ace-solarized-dark .ace_indent-guide { - background: url(data:image/png;base64,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..d7ad4f90 100644 --- a/lib/ace/theme/solarized_dark.js +++ b/lib/ace/theme/solarized_dark.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/solarized_light.css b/lib/ace/theme/solarized_light.css index 65399fda..65dfe8df 100644 --- a/lib/ace/theme/solarized_light.css +++ b/lib/ace/theme/solarized_light.css @@ -8,21 +8,30 @@ background: #e8e8e8 } -.ace-solarized-light { - background-color: #FDF6E3; +.ace-solarized-light .ace_scroller { + background-color: #FDF6E3 +} + +.ace-solarized-light .ace_text-layer { color: #586E75 } .ace-solarized-light .ace_cursor { - color: #000000 + border-left: 2px solid #000000 +} + +.ace-solarized-light .ace_overwrite-cursors .ace_cursor { + 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 { box-shadow: 0 0 3px 0px #FDF6E3; + border-radius: 2px } .ace-solarized-light .ace_marker-layer .ace_step { @@ -39,7 +48,7 @@ } .ace-solarized-light .ace_gutter-active-line { - background-color : #EDE5C1 + background-color : #dcdcdc } .ace-solarized-light .ace_marker-layer .ace_selected-word { @@ -100,6 +109,10 @@ color: #93A1A1 } +.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..eda2c45c 100644 --- a/lib/ace/theme/solarized_light.js +++ b/lib/ace/theme/solarized_light.js @@ -3,7 +3,7 @@ * * 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 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..538700f2 100644 --- a/lib/ace/theme/textmate.css +++ b/lib/ace/theme/textmate.css @@ -12,13 +12,17 @@ background-color: #6B72E6; } -.ace-tm { +.ace-tm .ace_scroller { background-color: #FFFFFF; - color: black; } .ace-tm .ace_cursor { - color: black; + border-left: 2px solid black; +} + +.ace-tm .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid black; } .ace-tm .ace_invisible { @@ -101,11 +105,11 @@ } -.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); } @@ -122,6 +126,7 @@ } .ace-tm.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px white; + border-radius: 2px; } .ace-tm .ace_marker-layer .ace_step { background: rgb(252, 255, 0); 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..a5d88b6c 100644 --- a/lib/ace/theme/tomorrow.css +++ b/lib/ace/theme/tomorrow.css @@ -8,13 +8,21 @@ background: #f6f6f6 } -.ace-tomorrow { - background-color: #FFFFFF; +.ace-tomorrow .ace_scroller { + background-color: #FFFFFF +} + +.ace-tomorrow .ace_text-layer { color: #4D4D4C } .ace-tomorrow .ace_cursor { - color: #AEAFAD + border-left: 2px solid #AEAFAD +} + +.ace-tomorrow .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #AEAFAD } .ace-tomorrow .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-tomorrow.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; + border-radius: 2px } .ace-tomorrow .ace_marker-layer .ace_step { @@ -101,7 +110,6 @@ color: #C99E00 } -.ace-tomorrow .ace_heading, .ace-tomorrow .ace_markup.ace_heading, .ace-tomorrow .ace_string { color: #718C00 @@ -119,6 +127,10 @@ color: #8E908C } +.ace-tomorrow .ace_markup.ace_underline { + text-decoration: underline +} + .ace-tomorrow .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y } \ No newline at end of file diff --git a/lib/ace/theme/tomorrow.js b/lib/ace/theme/tomorrow.js index 1f02d7d9..603c92a5 100644 --- a/lib/ace/theme/tomorrow.js +++ b/lib/ace/theme/tomorrow.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/tomorrow_night.css b/lib/ace/theme/tomorrow_night.css index e98a6580..0baaf323 100644 --- a/lib/ace/theme/tomorrow_night.css +++ b/lib/ace/theme/tomorrow_night.css @@ -8,13 +8,21 @@ background: #25282c } -.ace-tomorrow-night { - background-color: #1D1F21; +.ace-tomorrow-night .ace_scroller { + background-color: #1D1F21 +} + +.ace-tomorrow-night .ace_text-layer { color: #C5C8C6 } .ace-tomorrow-night .ace_cursor { - color: #AEAFAD + border-left: 2px solid #AEAFAD +} + +.ace-tomorrow-night .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #AEAFAD } .ace-tomorrow-night .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .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 { @@ -101,7 +110,6 @@ color: #F0C674 } -.ace-tomorrow-night .ace_heading, .ace-tomorrow-night .ace_markup.ace_heading, .ace-tomorrow-night .ace_string { color: #B5BD68 @@ -119,6 +127,10 @@ color: #969896 } +.ace-tomorrow-night .ace_markup.ace_underline { + text-decoration: underline +} + .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..8a2454ea 100644 --- a/lib/ace/theme/tomorrow_night.js +++ b/lib/ace/theme/tomorrow_night.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/tomorrow_night_blue.css b/lib/ace/theme/tomorrow_night_blue.css index 907eef35..daebddb1 100644 --- a/lib/ace/theme/tomorrow_night_blue.css +++ b/lib/ace/theme/tomorrow_night_blue.css @@ -8,22 +8,31 @@ background: #00204b } -.ace-tomorrow-night-blue { - background-color: #002451; - color: #FFFFFF +.ace-tomorrow-night-blue .ace_scroller { + background-color: #002451 } .ace-tomorrow-night-blue .ace_constant.ace_other, -.ace-tomorrow-night-blue .ace_cursor { +.ace-tomorrow-night-blue .ace_text-layer { color: #FFFFFF } +.ace-tomorrow-night-blue .ace_cursor { + border-left: 2px solid #FFFFFF +} + +.ace-tomorrow-night-blue .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #FFFFFF +} + .ace-tomorrow-night-blue .ace_marker-layer .ace_selection { background: #003F8E } .ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #002451; + border-radius: 2px } .ace-tomorrow-night-blue .ace_marker-layer .ace_step { @@ -98,7 +107,6 @@ color: #FFEEAD } -.ace-tomorrow-night-blue .ace_heading, .ace-tomorrow-night-blue .ace_markup.ace_heading, .ace-tomorrow-night-blue .ace_string { color: #D1F1A9 @@ -116,6 +124,10 @@ color: #7285B7 } +.ace-tomorrow-night-blue .ace_markup.ace_underline { + text-decoration: underline +} + .ace-tomorrow-night-blue .ace_indent-guide { - background: url(data:image/png;base64,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..dafd1f53 100644 --- a/lib/ace/theme/tomorrow_night_blue.js +++ b/lib/ace/theme/tomorrow_night_blue.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/tomorrow_night_bright.css b/lib/ace/theme/tomorrow_night_bright.css index c0c33739..065e2f00 100644 --- a/lib/ace/theme/tomorrow_night_bright.css +++ b/lib/ace/theme/tomorrow_night_bright.css @@ -8,13 +8,21 @@ background: #1a1a1a } -.ace-tomorrow-night-bright { - background-color: #000000; +.ace-tomorrow-night-bright .ace_scroller { + background-color: #000000 +} + +.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_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #9F9F9F } .ace-tomorrow-night-bright .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #000000; + border-radius: 2px } .ace-tomorrow-night-bright .ace_marker-layer .ace_step { @@ -31,15 +40,7 @@ .ace-tomorrow-night-bright .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #888888 -} - -.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) + border: 1px solid #343434 } .ace-tomorrow-night-bright .ace_marker-layer .ace_active-line { @@ -50,12 +51,8 @@ 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 + border: 1px solid #424242 } .ace-tomorrow-night-bright .ace_invisible { @@ -113,7 +110,6 @@ color: #E7C547 } -.ace-tomorrow-night-bright .ace_heading, .ace-tomorrow-night-bright .ace_markup.ace_heading, .ace-tomorrow-night-bright .ace_string { color: #B9CA4A @@ -131,10 +127,10 @@ color: #969896 } -.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword { - color: #C2C280 +.ace-tomorrow-night-bright .ace_markup.ace_underline { + text-decoration: underline } .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..12c961ef 100644 --- a/lib/ace/theme/tomorrow_night_bright.js +++ b/lib/ace/theme/tomorrow_night_bright.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/tomorrow_night_eighties.css b/lib/ace/theme/tomorrow_night_eighties.css index 69277fb1..5584d62d 100644 --- a/lib/ace/theme/tomorrow_night_eighties.css +++ b/lib/ace/theme/tomorrow_night_eighties.css @@ -8,22 +8,31 @@ background: #272727 } -.ace-tomorrow-night-eighties { - background-color: #2D2D2D; - color: #CCCCCC +.ace-tomorrow-night-eighties .ace_scroller { + background-color: #2D2D2D } .ace-tomorrow-night-eighties .ace_constant.ace_other, -.ace-tomorrow-night-eighties .ace_cursor { +.ace-tomorrow-night-eighties .ace_text-layer { color: #CCCCCC } +.ace-tomorrow-night-eighties .ace_cursor { + border-left: 2px solid #CCCCCC +} + +.ace-tomorrow-night-eighties .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #CCCCCC +} + .ace-tomorrow-night-eighties .ace_marker-layer .ace_selection { background: #515151 } .ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #2D2D2D; + border-radius: 2px } .ace-tomorrow-night-eighties .ace_marker-layer .ace_step { @@ -35,10 +44,6 @@ 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 } @@ -102,7 +107,6 @@ color: #FFCC66 } -.ace-tomorrow-night-eighties .ace_heading, .ace-tomorrow-night-eighties .ace_markup.ace_heading, .ace-tomorrow-night-eighties .ace_string { color: #99CC99 @@ -119,6 +123,10 @@ color: #F2777A } +.ace-tomorrow-night-eighties .ace_markup.ace_underline { + text-decoration: underline +} + .ace-tomorrow-night-eighties .ace_indent-guide { - background: url(data:image/png;base64,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..fc2cd15c 100644 --- a/lib/ace/theme/tomorrow_night_eighties.js +++ b/lib/ace/theme/tomorrow_night_eighties.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/twilight.css b/lib/ace/theme/twilight.css index ae353dae..3ef9de2e 100644 --- a/lib/ace/theme/twilight.css +++ b/lib/ace/theme/twilight.css @@ -8,13 +8,21 @@ background: #232323 } -.ace-twilight { - background-color: #141414; +.ace-twilight .ace_scroller { + background-color: #141414 +} + +.ace-twilight .ace_text-layer { color: #F8F8F8 } .ace-twilight .ace_cursor { - color: #A7A7A7 + border-left: 2px solid #A7A7A7 +} + +.ace-twilight .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #A7A7A7 } .ace-twilight .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-twilight.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #141414; + border-radius: 2px } .ace-twilight .ace_marker-layer .ace_step { @@ -59,7 +68,6 @@ .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 @@ -89,7 +97,6 @@ color: #DAD085 } -.ace-twilight .ace_list, .ace-twilight .ace_markup.ace_list, .ace-twilight .ace_storage { color: #F9EE98 @@ -122,6 +129,10 @@ color: #494949 } +.ace-twilight .ace_markup.ace_underline { + text-decoration: underline +} + .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..216f09de 100644 --- a/lib/ace/theme/twilight.js +++ b/lib/ace/theme/twilight.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/vibrant_ink.css b/lib/ace/theme/vibrant_ink.css index a3a89402..c611681d 100644 --- a/lib/ace/theme/vibrant_ink.css +++ b/lib/ace/theme/vibrant_ink.css @@ -8,13 +8,21 @@ background: #1a1a1a } -.ace-vibrant-ink { - background-color: #0F0F0F; +.ace-vibrant-ink .ace_scroller { + background-color: #0F0F0F +} + +.ace-vibrant-ink .ace_text-layer { color: #FFFFFF } .ace-vibrant-ink .ace_cursor { - color: #FFFFFF + border-left: 2px solid #FFFFFF +} + +.ace-vibrant-ink .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #FFFFFF } .ace-vibrant-ink .ace_marker-layer .ace_selection { @@ -23,6 +31,7 @@ .ace-vibrant-ink.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #0F0F0F; + border-radius: 2px } .ace-vibrant-ink .ace_marker-layer .ace_step { @@ -105,5 +114,5 @@ } .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..b41b1d47 100644 --- a/lib/ace/theme/vibrant_ink.js +++ b/lib/ace/theme/vibrant_ink.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/theme/xcode.css b/lib/ace/theme/xcode.css index a22bd169..463703b0 100644 --- a/lib/ace/theme/xcode.css +++ b/lib/ace/theme/xcode.css @@ -10,13 +10,21 @@ background: #e8e8e8 } -.ace-xcode { - background-color: #FFFFFF; +.ace-xcode .ace_scroller { + background-color: #FFFFFF +} + +.ace-xcode .ace_text-layer { color: #000000 } .ace-xcode .ace_cursor { - color: #000000 + border-left: 2px solid #000000 +} + +.ace-xcode .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid #000000 } .ace-xcode .ace_marker-layer .ace_selection { @@ -25,6 +33,7 @@ .ace-xcode.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #FFFFFF; + border-radius: 2px } .ace-xcode .ace_marker-layer .ace_step { @@ -98,5 +107,5 @@ } .ace-xcode .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/xcode.js b/lib/ace/theme/xcode.js index e17d708d..19827338 100644 --- a/lib/ace/theme/xcode.js +++ b/lib/ace/theme/xcode.js @@ -3,7 +3,7 @@ * * 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 diff --git a/lib/ace/token_iterator.js b/lib/ace/token_iterator.js index 74376fb3..43f5ac2e 100644 --- a/lib/ace/token_iterator.js +++ b/lib/ace/token_iterator.js @@ -32,19 +32,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 +59,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 +82,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 +105,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/tokenizer.js b/lib/ace/tokenizer.js index 72490fbb..565e2cde 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -31,331 +31,162 @@ 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("For " + state[i].regex + " the matching groups (" +(matchcount-1) + ") and length of the token array (" + state[i].token.length + ") don't match (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; + + if (re === undefined) { + throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!"); + } + + re.lastIndex = lastIndex; } break; } - if (value) { - 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 index 61821f60..6022c4ae 100644 --- a/lib/ace/tokenizer_dev.js +++ b/lib/ace/tokenizer_dev.js @@ -29,32 +29,59 @@ * ***** 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, flag) { + flag = flag ? "g" + flag : "g"; + this.rules = rules; -var Tokenizer = function(rules) { - BaseTokenizer.call(this, rules); + this.regExps = {}; + this.matchMappings = {}; + for ( var key in this.rules) { + var rule = this.rules[key]; + var state = rule; + var ruleRegExps = []; + var matchTotal = 0; + var mapping = this.matchMappings[key] = {}; - /** - * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @returns {Object} - **/ + for ( var i = 0; i < state.length; i++) { + + if (state[i].regex instanceof RegExp) + state[i].regex = state[i].regex.toString().slice(1, -1); + + // Count number of matching groups. 2 extra groups from the full match + // And the catch-all on the end (used to force a match); + var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2; + + // Replace any backreferences and offset appropriately. + var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); + + if (matchcount > 1 && state[i].token.length !== matchcount-1) + throw new Error("For " + state[i].regex + " the matching groups and length of the token array don't match (rule #" + i + " of state " + key + ")"); + + mapping[matchTotal] = { + rule: i, + len: matchcount + }; + matchTotal += matchcount; + + ruleRegExps.push(adjustedregex); + } + + this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag); + } +}; + +(function() { 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 state = this.rules[currentState]; var mapping = this.matchMappings[currentState]; var re = this.regExps[currentState]; re.lastIndex = 0; @@ -80,104 +107,99 @@ var Tokenizer = function(rules) { }; initState(); - var maxRecur = 100000; + var maxRecur = 10000; while (match = re.exec(line)) { - var type = mapping.defaultToken; + var type = "default.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; if (!maxRecur--) { - throw "infinite" + state[mapping[i]] + currentState + throw "infinite" + mapping[i].rule + currentState } - 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) { - window.console && console.error && console.error(currentState, "doesn't exist"); - 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; + + if (re === undefined) { + throw new Error("You indicated a state of " + rule.next + " to go to, but it doesn't exist!"); + } + + re.lastIndex = lastIndex; onStateChange(); } break; } - if (value) { + if (value[0]) { if (typeof type == "string") { - if ((!rule || rule.merge !== false) && token.type === type) { - token.value += value; + value = [value.join("")]; + type = [type]; + } + for (var i = 0; i < value.length; i++) { + if (!value[i]) + continue; + + var mergeable = (!rule || rule.merge || type[i] === "text") && token.type === type[i]; + + if (false && mergeable) { + token.value += value[i]; } else { - if (token.type) + if (token.type) { + token.stateTransitions = stateTransitions; tokens.push(token); - token = {type: type, value: value}; + initState() + } + + token = { + type: type[i], + value: value[i], + state: currentState, + mergeable: mergeable + }; } - } 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; - } + lastIndex = re.lastIndex; } - if (token.type) + if (token.type) { + token.stateTransitions = stateTransitions; tokens.push(token); + } return { tokens : tokens, - state : stack.length ? stack : currentState + state : currentState }; }; -}; - -Tokenizer.prototype = BaseTokenizer.prototype; +}).call(Tokenizer.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..09596a60 100644 --- a/lib/ace/undomanager.js +++ b/lib/ace/undomanager.js @@ -32,18 +32,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 +50,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..8b5cca57 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -3,7 +3,7 @@ * * 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 @@ -14,7 +14,7 @@ * * Neither the name of Ajax.org B.V. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -33,48 +33,51 @@ 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 MobileScrollLayer = require("./layer/mobilescroll").MobileScroll; +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"); -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 +93,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); @@ -101,45 +105,45 @@ var VirtualRenderer = function(container, theme) { this.$markerFront = new MarkerLayer(this.content); this.$cursorLayer = new CursorLayer(this.content); + + this.$mobileScrollLayer = new MobileScrollLayer(this.content); // 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) { + this.$textLayer.addEventListener("changeCharacterSize", function() { _self.updateCharacterSize(); - _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); - _self._signal("changeCharacterSize", e); + _self.onResize(true); }); this.$size = { width: 0, height: 0, scrollerHeight: 0, - scrollerWidth: 0, - $dirty: true + scrollerWidth: 0 }; this.layerConfig = { @@ -148,22 +152,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( @@ -174,11 +168,10 @@ var VirtualRenderer = function(container, theme) { this.updateCharacterSize(); this.setPadding(4); - config.resetOptions(this); - config._emit("renderer", this); }; (function() { + this.showGutter = true; this.CHANGE_CURSOR = 1; this.CHANGE_MARKER = 2; @@ -192,73 +185,47 @@ 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) + * + * 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.$mobileScrollLayer.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) + * - 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 +243,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() + * * Triggers a full update of the text, for all the rows. **/ this.updateText = function() { @@ -309,19 +261,22 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.updateFull(force) + * - force (Boolean): If `true`, forces the changes through + * * 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() * * Updates the font size. **/ @@ -329,256 +284,233 @@ 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, gutterWidth, width, height) + * - force (Boolean): If `true`, recomputes the size, even if the height and width haven't changed + * - gutterWidth (Number): The width of the gutter in pixels + * - width (Number): The width of the editor in pixels + * - height (Number): The hiehgt of the editor, in pixels + * * [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() + * * 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) + * - 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) + * - 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) + * - 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() { if (!this.$showPrintMargin && !this.$printMarginEl) return; @@ -595,33 +527,30 @@ var VirtualRenderer = function(container, theme) { 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 +561,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 +614,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,289 +625,165 @@ var VirtualRenderer = function(container, theme) { this.$padding = null; /** + * VirtualRenderer.setPadding(padding) + * - 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) { this.$padding = padding; this.$textLayer.setPadding(padding); + this.$mobileScrollLayer.setPadding(padding); this.$cursorLayer.setPadding(padding); this.$markerFront.setPadding(padding); this.$markerBack.setPadding(padding); 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) + * - 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.$mobileScrollLayer.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 ace_scroll-left"; } // 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.$mobileScrollLayer.update(this.layerConfig); + 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); + this.$mobileScrollLayer.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 +805,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 +821,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 +850,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 +863,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() * * Schedules an update to all the front markers in the document. **/ @@ -1084,6 +880,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.updateBackMarkers() * * Schedules an update to all the back markers in the document. **/ @@ -1092,24 +889,26 @@ var VirtualRenderer = function(container, theme) { this.$loop.schedule(this.CHANGE_MARKER_BACK); }; - /** + /** deprecated + * VirtualRenderer.addGutterDecoration(row, className) * * Deprecated; (moved to [[EditSession]]) - * @deprecated **/ this.addGutterDecoration = function(row, className){ this.$gutterLayer.addGutterDecoration(row, className); }; - /** + /** deprecated + * VirtualRenderer.removeGutterDecoration(row, className)-> Void + * * Deprecated; (moved to [[EditSession]]) - * @deprecated **/ this.removeGutterDecoration = function(row, className){ this.$gutterLayer.removeGutterDecoration(row, className); }; /** + * VirtualRenderer.updateBreakpoints() * * Redraw breakpoints. **/ @@ -1118,11 +917,10 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.setAnnotations(annotations) + * - 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 +928,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.updateCursor() * * Updates the cursor icon. **/ @@ -1138,6 +937,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.hideCursor() * * Hides the cursor icon. **/ @@ -1146,6 +946,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.showCursor() * * Shows the cursor icon. **/ @@ -1160,10 +961,11 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.scrollCursorIntoView(cursor, offset) * * 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 +974,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 +989,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) + * - 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); @@ -1279,13 +1071,13 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.scrollToLine(line, center, animate, callback) + * - 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 +1093,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 +1137,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) + * - 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 +1165,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 +1195,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 +1225,28 @@ var VirtualRenderer = function(container, theme) { }; /** - * - * Focuses the current container. - **/ + * VirtualRenderer.visualizeFocus() + * + * Focuses the current container. + **/ this.visualizeFocus = function() { dom.addCssClass(this.container, "ace_focus"); }; /** - * - * Blurs the current container. - **/ + * VirtualRenderer.visualizeBlur() + * + * Blurs the current container. + **/ this.visualizeBlur = function() { dom.removeCssClass(this.container, "ace_focus"); }; - /** - * @param {Number} position - * - * @private - **/ + /** internal, hide + * VirtualRenderer.showComposition(position) + * - position (Number): + * + **/ this.showComposition = function(position) { if (!this.$composition) this.$composition = { @@ -1491,18 +1261,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) + * - 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() + * + * Hides the current composition. + **/ this.hideComposition = function() { if (!this.$composition) return; @@ -1513,67 +1285,81 @@ 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) + * - 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); - var padding = "padding" in module ? module.padding - : "padding" in (_self.theme || {}) ? 4 : _self.$padding; + // this is kept only for backwards compatibility + _self.$theme = theme.cssClass; + + _self.theme = theme; + dom.addCssClass(_self.container, theme.cssClass); + dom.setCssClass(_self.container, "ace_dark", theme.isDark); + + var padding = theme.padding || 4; if (_self.$padding && padding != _self.$padding) _self.setPadding(padding); - - // this is kept only for backwards compatibility - _self.$theme = module.cssClass; - - _self.theme = module; - dom.addCssClass(_self.container, module.cssClass); - dom.setCssClass(_self.container, "ace_dark", module.isDark); // 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 +1367,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) + * - style (String): A class name + * + * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} + **/ + this.setStyle = function setStyle(style, include) { + dom.setCssClass(this.container, style, include != false); }; /** - * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} - * @param {String} style A class name - * - **/ - this.unsetStyle = function(style) { + * VirtualRenderer.unsetStyle(style) + * - style (String): A class name + * + * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} + **/ + this.unsetStyle = function unsetStyle(style) { dom.removeCssClass(this.container, style); }; - - this.setCursorStyle = function(style) { - if (this.scroller.style.cursor != style) - this.scroller.style.cursor = 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 +1398,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..e8a8fcbd 100644 --- a/lib/ace/virtual_renderer_test.js +++ b/lib/ace/virtual_renderer_test.js @@ -36,40 +36,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 +73,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/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..e8bf0d3e 100644 --- a/lib/ace/worker/worker.js +++ b/lib/ace/worker/worker.js @@ -1,64 +1,46 @@ "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() { + var msgs = Array.prototype.slice.call(arguments, 0); + postMessage({type: "log", data: msgs}); + }, + error: function() { + var msgs = Array.prototype.slice.call(arguments, 0); + postMessage({type: "log", data: msgs}); + } }; -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; - } +var require = function(parentId, id) { 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 id = normalizeModule(parentId, id); + + var module = require.modules[id]; if (module) { if (!module.initialized) { module.initialized = true; @@ -66,102 +48,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 +127,27 @@ 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); - } - else if (msg.command) { + 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..8f11ff4b 100644 --- a/lib/ace/worker/worker_client.js +++ b/lib/ace/worker/worker_client.js @@ -32,56 +32,48 @@ 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); +var WorkerClient = function(topLevelNamespaces, mod, classname) { this.changeListener = this.changeListener.bind(this); this.onMessage = this.onMessage.bind(this); + this.onError = this.onError.bind(this); - // 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"); + var workerUrl; + if (config.get("packaged")) { + workerUrl = config.moduleUrl(mod, "worker"); } else { var normalizePath = this.$normalizePath; - workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_")); + 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 = normalizePath(require.toUrl("ace/worker/worker", null, "_")); + } var tlns = {}; topLevelNamespaces.forEach(function(ns) { - tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, "")); + tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/.js(\?.*)?$/, "")); }); } - try { - this.$worker = new Worker(workerUrl); - } catch(e) { - if (e instanceof window.DOMException) { - // Likely same origin problem. Use importScripts from a shim Worker - var blob = this.$workerBlob(workerUrl); - var URL = window.URL || window.webkitURL; - var blobURL = URL.createObjectURL(blob); - - this.$worker = new Worker(blobURL); - URL.revokeObjectURL(blobURL); - } else { - throw e; - } - } + this.$worker = new Worker(workerUrl); this.$worker.postMessage({ init : true, - tlns : tlns, - module : mod, - classname : classname + tlns: tlns, + module: mod, + classname: classname }); this.callbackId = 1; this.callbacks = {}; + this.$worker.onerror = this.onError; this.$worker.onmessage = this.onMessage; }; @@ -89,12 +81,22 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { oop.implement(this, EventEmitter); + this.onError = function(e) { + window.console && console.log && console.log(e); + throw e; + }; + this.onMessage = function(e) { var msg = e.data; switch(msg.type) { - case "event": - this._signal(msg.name, {data: msg.data}); + case "log": + window.console && console.log && console.log.apply(console, msg.data); break; + + case "event": + this._emit(msg.name, {data: msg.data}); + break; + case "call": var callback = this.callbacks[msg.id]; if (callback) { @@ -102,30 +104,25 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { delete this.callbacks[msg.id]; } break; - case "error": - this.reportError(msg.data); - break; - case "log": - window.console && console.log && console.log.apply(console, msg.data); - break; } }; - - this.reportError = function(err) { - window.console && console.error && console.error(err); - }; this.$normalizePath = function(path) { - return net.qualifyURL(path); + if (!location.host) // needed for file:// protocol + return path; + path = path.replace(/^[a-z]+:\/\/[^\/]+/, ""); // Remove domain name and rebuild it + path = location.protocol + "//" + location.host + // paths starting with a slash are relative to the root (host) + + (path.charAt(0) == "/" ? "" : location.pathname.replace(/\/[^\/]*$/, "")) + + "/" + path.replace(/^[\/]+/, ""); + return path; }; this.terminate = function() { - this._signal("terminate", {}); - this.deltaQueue = null; + this._emit("terminate", {}); this.$worker.terminate(); this.$worker = null; - if (this.$doc) - this.$doc.off("change", this.changeListener); + this.$doc.removeEventListener("change", this.changeListener); this.$doc = null; }; @@ -148,9 +145,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { // TODO: cleanup event this.$worker.postMessage({event: event, data: {data: data.data}}); } - catch(ex) { - console.error(ex.stack); - } + catch(ex) {} }; this.attachToDocument = function(doc) { @@ -162,75 +157,39 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { doc.on("change", this.changeListener); }; - this.changeListener = function(delta) { - if (!this.deltaQueue) { - this.deltaQueue = []; - setTimeout(this.$sendDeltaQueue, 0); - } - if (delta.action == "insert") - this.deltaQueue.push(delta.start, delta.lines); - else - this.deltaQueue.push(delta.start, delta.end); - }; - - this.$sendDeltaQueue = function() { - var q = this.deltaQueue; - if (!q) return; - this.deltaQueue = null; - if (q.length > 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 = {} this.$worker.postMessage = function(e) { _self.messageBuffer.push(e); - if (main) { - if (emitSync) - setTimeout(processNext); - else - processNext(); - } + main && setTimeout(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._emit(msg.event, msg.data); }; sender.postMessage = function(msg) { @@ -243,7 +202,7 @@ var UIWorkerClient = function(topLevelNamespaces, mod, classname) { this.postMessage({type: "event", name: name, data: data}); }; - config.loadModule(["worker", mod], function(Main) { + require([mod], function(Main) { main = new Main[classname](sender); while (_self.messageBuffer.length) processNext(); 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..787eb3d4 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,21 @@ { "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": "1.0.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" + "dryice": "0.4.10" }, "mappings": { "ace": "." @@ -31,7 +28,30 @@ "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 -c" + }, + "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" + ] + } + } + } } } 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..4f7e7248 100755 --- a/static.js +++ b/static.js @@ -10,101 +10,37 @@ var http = require("http") // 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); - +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/templates/theme.css b/tool/Theme.tmpl.css similarity index 79% rename from tool/templates/theme.css rename to tool/Theme.tmpl.css index 8515d0c3..180132f2 100644 --- a/tool/templates/theme.css +++ b/tool/Theme.tmpl.css @@ -1,8 +1,8 @@ /* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: %uuid%) */ .%cssClass% .ace_gutter { - background: %gutterBg%; - color: %gutterFg%; + background: #e8e8e8; + color: #333; } .%cssClass% .ace_print-margin { @@ -10,13 +10,21 @@ background: %printMargin%; } -.%cssClass% { +.%cssClass% .ace_scroller { background-color: %background%; +} + +.%cssClass% .ace_text-layer { color: %foreground%; } .%cssClass% .ace_cursor { - color: %cursor%; + border-left: 2px solid %cursor%; +} + +.%cssClass% .ace_overwrite-cursors .ace_cursor { + border-left: 0px; + border-bottom: 1px solid %overwrite%; } .%cssClass% .ace_marker-layer .ace_selection { 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/lib/ace/mode/vbscript.js b/tool/mode.tmpl.js similarity index 86% rename from lib/ace/mode/vbscript.js rename to tool/mode.tmpl.js index ed0ec61d..3a3e4c60 100644 --- a/lib/ace/mode/vbscript.js +++ b/tool/mode.tmpl.js @@ -42,18 +42,18 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; -var VBScriptHighlightRules = require("./vbscript_highlight_rules").VBScriptHighlightRules; +var Tokenizer = require("../tokenizer").Tokenizer; +var %language%HighlightRules = require("./%languageHighlightFilename%_highlight_rules").%language%HighlightRules; var Mode = function() { - this.HighlightRules = VBScriptHighlightRules; + var highlighter = new %language%HighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); }; oop.inherits(Mode, TextMode); (function() { - - this.lineCommentStart = ["'", "REM"]; - - this.$id = "ace/mode/vbscript"; + // Extra logic goes here. }).call(Mode.prototype); exports.Mode = Mode; diff --git a/tool/mode_creator.html b/tool/mode_creator.html index 259ba64e..e45acd73 100644 --- a/tool/mode_creator.html +++ b/tool/mode_creator.html @@ -19,68 +19,31 @@ border-bottom: solid 1px; } .separator-h { - padding: 0 10px; - } - #closeBtn { - 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; - } - #closeBtn:hover { - background: rgba(245, 146, 146, 0.9); - } - #console{ - /border: 1px solid lightblue; - bottom: 0; - height: 80px; - margin: 0 4%; - position: absolute; - width: 92%; - z-index: 1000; - box-shadow: 0 0 1px 2px gray - } - #consoleEditor{ - height: 100%; - position: relative; - width: 100%; + padding: 0 20px; } - +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -