ace-rails-ap 0.0.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ace/rails/version.rb +1 -1
 - data/vendor/assets/javascripts/ace.js +15680 -1
 - data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
 - data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
 - data/vendor/assets/javascripts/mode-c9search.js +275 -0
 - data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
 - data/vendor/assets/javascripts/mode-clojure.js +364 -1
 - data/vendor/assets/javascripts/mode-coffee.js +527 -1
 - data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
 - data/vendor/assets/javascripts/mode-csharp.js +633 -1
 - data/vendor/assets/javascripts/mode-css.js +499 -1
 - data/vendor/assets/javascripts/mode-diff.js +250 -0
 - data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
 - data/vendor/assets/javascripts/mode-golang.js +681 -1
 - data/vendor/assets/javascripts/mode-groovy.js +1240 -1
 - data/vendor/assets/javascripts/mode-haxe.js +633 -1
 - data/vendor/assets/javascripts/mode-html.js +2064 -1
 - data/vendor/assets/javascripts/mode-java.js +1202 -1
 - data/vendor/assets/javascripts/mode-javascript.js +1069 -1
 - data/vendor/assets/javascripts/mode-json.js +588 -1
 - data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
 - data/vendor/assets/javascripts/mode-latex.js +95 -1
 - data/vendor/assets/javascripts/mode-less.js +512 -1
 - data/vendor/assets/javascripts/mode-liquid.js +1125 -1
 - data/vendor/assets/javascripts/mode-lua.js +551 -1
 - data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
 - data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
 - data/vendor/assets/javascripts/mode-markdown.js +2369 -1
 - data/vendor/assets/javascripts/mode-ocaml.js +464 -1
 - data/vendor/assets/javascripts/mode-perl.js +432 -1
 - data/vendor/assets/javascripts/mode-pgsql.js +970 -1
 - data/vendor/assets/javascripts/mode-php.js +1718 -1
 - data/vendor/assets/javascripts/mode-powershell.js +610 -1
 - data/vendor/assets/javascripts/mode-python.js +397 -1
 - data/vendor/assets/javascripts/mode-ruby.js +318 -1
 - data/vendor/assets/javascripts/mode-scad.js +732 -1
 - data/vendor/assets/javascripts/mode-scala.js +1237 -1
 - data/vendor/assets/javascripts/mode-scss.js +537 -1
 - data/vendor/assets/javascripts/mode-sh.js +250 -1
 - data/vendor/assets/javascripts/mode-sql.js +140 -1
 - data/vendor/assets/javascripts/mode-svg.js +1681 -1
 - data/vendor/assets/javascripts/mode-tcl.js +320 -0
 - data/vendor/assets/javascripts/mode-textile.js +182 -1
 - data/vendor/assets/javascripts/mode-xml.js +829 -1
 - data/vendor/assets/javascripts/mode-xquery.js +605 -1
 - data/vendor/assets/javascripts/mode-yaml.js +189 -0
 - data/vendor/assets/javascripts/theme-chrome.js +213 -1
 - data/vendor/assets/javascripts/theme-clouds.js +167 -1
 - data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
 - data/vendor/assets/javascripts/theme-cobalt.js +194 -1
 - data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
 - data/vendor/assets/javascripts/theme-dawn.js +198 -1
 - data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
 - data/vendor/assets/javascripts/theme-eclipse.js +157 -1
 - data/vendor/assets/javascripts/theme-github.js +182 -0
 - data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
 - data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
 - data/vendor/assets/javascripts/theme-merbivore.js +189 -1
 - data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
 - data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
 - data/vendor/assets/javascripts/theme-monokai.js +194 -1
 - data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
 - data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
 - data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
 - data/vendor/assets/javascripts/theme-textmate.js +216 -0
 - data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
 - data/vendor/assets/javascripts/theme-twilight.js +211 -1
 - data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
 - data/vendor/assets/javascripts/worker-coffee.js +83 -893
 - data/vendor/assets/javascripts/worker-css.js +88 -1402
 - data/vendor/assets/javascripts/worker-javascript.js +97 -812
 - data/vendor/assets/javascripts/worker-json.js +84 -761
 - data/vendor/assets/javascripts/worker-xquery.js +66464 -0
 - metadata +12 -195
 - data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
 - data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
 - data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
 - data/vendor/assets/javascripts/ace-compat.js +0 -1
 - data/vendor/assets/javascripts/ace-noconflict.js +0 -10
 - data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
 - data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
 - data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
 - data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
 - data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
 - data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
 - data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
 - data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
 - data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
 - data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
 - data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
 - data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
 - data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
 - data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
 - data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
 - data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
 - data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
 - data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
 - data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
 - data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
 - data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
 - data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
 - data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
 - data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
 - data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
 - data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
 - data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
 - data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
 - data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
 - data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
 - data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
 - data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
 - data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
 - data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
 - data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
 - data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
 - data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
 - data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
 - data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
 - data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
 - data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
 - data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
 - data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
 - data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
 - data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
 - data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
 - data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
 - data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
 - data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
 - data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
 - data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
 - data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
 - data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
 - data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
 - data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
 - data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
 - data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
 - data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
 - data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
 - data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
 - data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
 - data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
 - data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
 - data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
 - data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
 - data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
 - data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
 - data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
 - data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
 - data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
 - data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
 - data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
 - data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
 - data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
 - data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
 - data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
 - data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
 - data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
 - data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
 - data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
 - data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
 - data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
 - data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
 - data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
 - data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
 - data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
 - data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
 - data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
 - data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
 - data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
 - data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
 - data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
 - data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
 - data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
 - data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
 - data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
 - data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
 - data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
 - data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
 - data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
 - data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
 - data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
 - data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
 - data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
 - data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
 - data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
 - data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
 - data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
 - data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
 - data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
 - data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
 - data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
 - data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
 - data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
 - data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
 - data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
 - data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
 - data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
 - data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
 - data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
 - data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
 - data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
 - data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
 - data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
 - data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
 - data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
 - data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
 - data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
 
| 
         @@ -1 +1,397 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            /* ***** BEGIN LICENSE BLOCK *****
         
     | 
| 
      
 2 
     | 
    
         
            +
            * Version: MPL 1.1/GPL 2.0/LGPL 2.1
         
     | 
| 
      
 3 
     | 
    
         
            +
            *
         
     | 
| 
      
 4 
     | 
    
         
            +
            * The contents of this file are subject to the Mozilla Public License Version
         
     | 
| 
      
 5 
     | 
    
         
            +
            * 1.1 (the "License"); you may not use this file except in compliance with
         
     | 
| 
      
 6 
     | 
    
         
            +
            * the License. You may obtain a copy of the License at
         
     | 
| 
      
 7 
     | 
    
         
            +
            * http://www.mozilla.org/MPL/
         
     | 
| 
      
 8 
     | 
    
         
            +
            *
         
     | 
| 
      
 9 
     | 
    
         
            +
            * Software distributed under the License is distributed on an "AS IS" basis,
         
     | 
| 
      
 10 
     | 
    
         
            +
            * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
         
     | 
| 
      
 11 
     | 
    
         
            +
            * for the specific language governing rights and limitations under the
         
     | 
| 
      
 12 
     | 
    
         
            +
            * License.
         
     | 
| 
      
 13 
     | 
    
         
            +
            *
         
     | 
| 
      
 14 
     | 
    
         
            +
            * The Original Code is Ajax.org Code Editor (ACE).
         
     | 
| 
      
 15 
     | 
    
         
            +
            *
         
     | 
| 
      
 16 
     | 
    
         
            +
            * The Initial Developer of the Original Code is
         
     | 
| 
      
 17 
     | 
    
         
            +
            * Ajax.org B.V.
         
     | 
| 
      
 18 
     | 
    
         
            +
            * Portions created by the Initial Developer are Copyright (C) 2010
         
     | 
| 
      
 19 
     | 
    
         
            +
            * the Initial Developer. All Rights Reserved.
         
     | 
| 
      
 20 
     | 
    
         
            +
            *
         
     | 
| 
      
 21 
     | 
    
         
            +
            * Contributor(s):
         
     | 
| 
      
 22 
     | 
    
         
            +
            *      Fabian Jakobs <fabian AT ajax DOT org>
         
     | 
| 
      
 23 
     | 
    
         
            +
            *      Colin Gourlay <colin DOT j DOT gourlay AT gmail DOT com>
         
     | 
| 
      
 24 
     | 
    
         
            +
            *
         
     | 
| 
      
 25 
     | 
    
         
            +
            * Alternatively, the contents of this file may be used under the terms of
         
     | 
| 
      
 26 
     | 
    
         
            +
            * either the GNU General Public License Version 2 or later (the "GPL"), or
         
     | 
| 
      
 27 
     | 
    
         
            +
            * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
         
     | 
| 
      
 28 
     | 
    
         
            +
            * in which case the provisions of the GPL or the LGPL are applicable instead
         
     | 
| 
      
 29 
     | 
    
         
            +
            * of those above. If you wish to allow use of your version of this file only
         
     | 
| 
      
 30 
     | 
    
         
            +
            * under the terms of either the GPL or the LGPL, and not to allow others to
         
     | 
| 
      
 31 
     | 
    
         
            +
            * use your version of this file under the terms of the MPL, indicate your
         
     | 
| 
      
 32 
     | 
    
         
            +
            * decision by deleting the provisions above and replace them with the notice
         
     | 
| 
      
 33 
     | 
    
         
            +
            * and other provisions required by the GPL or the LGPL. If you do not delete
         
     | 
| 
      
 34 
     | 
    
         
            +
            * the provisions above, a recipient may use your version of this file under
         
     | 
| 
      
 35 
     | 
    
         
            +
            * the terms of any one of the MPL, the GPL or the LGPL.
         
     | 
| 
      
 36 
     | 
    
         
            +
            *
         
     | 
| 
      
 37 
     | 
    
         
            +
            * ***** END LICENSE BLOCK ***** */
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            define('ace/mode/python', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/python_highlight_rules', 'ace/mode/folding/pythonic', 'ace/range'], function(require, exports, module) {
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
            var oop = require("../lib/oop");
         
     | 
| 
      
 43 
     | 
    
         
            +
            var TextMode = require("./text").Mode;
         
     | 
| 
      
 44 
     | 
    
         
            +
            var Tokenizer = require("../tokenizer").Tokenizer;
         
     | 
| 
      
 45 
     | 
    
         
            +
            var PythonHighlightRules = require("./python_highlight_rules").PythonHighlightRules;
         
     | 
| 
      
 46 
     | 
    
         
            +
            var PythonFoldMode = require("./folding/pythonic").FoldMode;
         
     | 
| 
      
 47 
     | 
    
         
            +
            var Range = require("../range").Range;
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
            var Mode = function() {
         
     | 
| 
      
 50 
     | 
    
         
            +
                this.$tokenizer = new Tokenizer(new PythonHighlightRules().getRules());
         
     | 
| 
      
 51 
     | 
    
         
            +
                this.foldingRules = new PythonFoldMode("\\:");
         
     | 
| 
      
 52 
     | 
    
         
            +
            };
         
     | 
| 
      
 53 
     | 
    
         
            +
            oop.inherits(Mode, TextMode);
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
            (function() {
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                this.toggleCommentLines = function(state, doc, startRow, endRow) {
         
     | 
| 
      
 58 
     | 
    
         
            +
                    var outdent = true;
         
     | 
| 
      
 59 
     | 
    
         
            +
                    var re = /^(\s*)#/;
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                    for (var i=startRow; i<= endRow; i++) {
         
     | 
| 
      
 62 
     | 
    
         
            +
                        if (!re.test(doc.getLine(i))) {
         
     | 
| 
      
 63 
     | 
    
         
            +
                            outdent = false;
         
     | 
| 
      
 64 
     | 
    
         
            +
                            break;
         
     | 
| 
      
 65 
     | 
    
         
            +
                        }
         
     | 
| 
      
 66 
     | 
    
         
            +
                    }
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                    if (outdent) {
         
     | 
| 
      
 69 
     | 
    
         
            +
                        var deleteRange = new Range(0, 0, 0, 0);
         
     | 
| 
      
 70 
     | 
    
         
            +
                        for (var i=startRow; i<= endRow; i++)
         
     | 
| 
      
 71 
     | 
    
         
            +
                        {
         
     | 
| 
      
 72 
     | 
    
         
            +
                            var line = doc.getLine(i);
         
     | 
| 
      
 73 
     | 
    
         
            +
                            var m = line.match(re);
         
     | 
| 
      
 74 
     | 
    
         
            +
                            deleteRange.start.row = i;
         
     | 
| 
      
 75 
     | 
    
         
            +
                            deleteRange.end.row = i;
         
     | 
| 
      
 76 
     | 
    
         
            +
                            deleteRange.end.column = m[0].length;
         
     | 
| 
      
 77 
     | 
    
         
            +
                            doc.replace(deleteRange, m[1]);
         
     | 
| 
      
 78 
     | 
    
         
            +
                        }
         
     | 
| 
      
 79 
     | 
    
         
            +
                    }
         
     | 
| 
      
 80 
     | 
    
         
            +
                    else {
         
     | 
| 
      
 81 
     | 
    
         
            +
                        doc.indentRows(startRow, endRow, "#");
         
     | 
| 
      
 82 
     | 
    
         
            +
                    }
         
     | 
| 
      
 83 
     | 
    
         
            +
                };
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                this.getNextLineIndent = function(state, line, tab) {
         
     | 
| 
      
 86 
     | 
    
         
            +
                    var indent = this.$getIndent(line);
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                    var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
         
     | 
| 
      
 89 
     | 
    
         
            +
                    var tokens = tokenizedLine.tokens;
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                    if (tokens.length && tokens[tokens.length-1].type == "comment") {
         
     | 
| 
      
 92 
     | 
    
         
            +
                        return indent;
         
     | 
| 
      
 93 
     | 
    
         
            +
                    }
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
                    if (state == "start") {
         
     | 
| 
      
 96 
     | 
    
         
            +
                        var match = line.match(/^.*[\{\(\[\:]\s*$/);
         
     | 
| 
      
 97 
     | 
    
         
            +
                        if (match) {
         
     | 
| 
      
 98 
     | 
    
         
            +
                            indent += tab;
         
     | 
| 
      
 99 
     | 
    
         
            +
                        }
         
     | 
| 
      
 100 
     | 
    
         
            +
                    }
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                    return indent;
         
     | 
| 
      
 103 
     | 
    
         
            +
                };
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                var outdents = {
         
     | 
| 
      
 106 
     | 
    
         
            +
                    "pass": 1,
         
     | 
| 
      
 107 
     | 
    
         
            +
                    "return": 1,
         
     | 
| 
      
 108 
     | 
    
         
            +
                    "raise": 1,
         
     | 
| 
      
 109 
     | 
    
         
            +
                    "break": 1,
         
     | 
| 
      
 110 
     | 
    
         
            +
                    "continue": 1
         
     | 
| 
      
 111 
     | 
    
         
            +
                };
         
     | 
| 
      
 112 
     | 
    
         
            +
                
         
     | 
| 
      
 113 
     | 
    
         
            +
                this.checkOutdent = function(state, line, input) {
         
     | 
| 
      
 114 
     | 
    
         
            +
                    if (input !== "\r\n" && input !== "\r" && input !== "\n")
         
     | 
| 
      
 115 
     | 
    
         
            +
                        return false;
         
     | 
| 
      
 116 
     | 
    
         
            +
             
     | 
| 
      
 117 
     | 
    
         
            +
                    var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
         
     | 
| 
      
 118 
     | 
    
         
            +
                    
         
     | 
| 
      
 119 
     | 
    
         
            +
                    if (!tokens)
         
     | 
| 
      
 120 
     | 
    
         
            +
                        return false;
         
     | 
| 
      
 121 
     | 
    
         
            +
                    
         
     | 
| 
      
 122 
     | 
    
         
            +
                    // ignore trailing comments
         
     | 
| 
      
 123 
     | 
    
         
            +
                    do {
         
     | 
| 
      
 124 
     | 
    
         
            +
                        var last = tokens.pop();
         
     | 
| 
      
 125 
     | 
    
         
            +
                    } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
         
     | 
| 
      
 126 
     | 
    
         
            +
                    
         
     | 
| 
      
 127 
     | 
    
         
            +
                    if (!last)
         
     | 
| 
      
 128 
     | 
    
         
            +
                        return false;
         
     | 
| 
      
 129 
     | 
    
         
            +
                    
         
     | 
| 
      
 130 
     | 
    
         
            +
                    return (last.type == "keyword" && outdents[last.value]);
         
     | 
| 
      
 131 
     | 
    
         
            +
                };
         
     | 
| 
      
 132 
     | 
    
         
            +
             
     | 
| 
      
 133 
     | 
    
         
            +
                this.autoOutdent = function(state, doc, row) {
         
     | 
| 
      
 134 
     | 
    
         
            +
                    // outdenting in python is slightly different because it always applies
         
     | 
| 
      
 135 
     | 
    
         
            +
                    // to the next line and only of a new line is inserted
         
     | 
| 
      
 136 
     | 
    
         
            +
                    
         
     | 
| 
      
 137 
     | 
    
         
            +
                    row += 1;
         
     | 
| 
      
 138 
     | 
    
         
            +
                    var indent = this.$getIndent(doc.getLine(row));
         
     | 
| 
      
 139 
     | 
    
         
            +
                    var tab = doc.getTabString();
         
     | 
| 
      
 140 
     | 
    
         
            +
                    if (indent.slice(-tab.length) == tab)
         
     | 
| 
      
 141 
     | 
    
         
            +
                        doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
         
     | 
| 
      
 142 
     | 
    
         
            +
                };
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
            }).call(Mode.prototype);
         
     | 
| 
      
 145 
     | 
    
         
            +
             
     | 
| 
      
 146 
     | 
    
         
            +
            exports.Mode = Mode;
         
     | 
| 
      
 147 
     | 
    
         
            +
            });
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
            define('ace/mode/python_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
         
     | 
| 
      
 150 
     | 
    
         
            +
             
     | 
| 
      
 151 
     | 
    
         
            +
             
     | 
| 
      
 152 
     | 
    
         
            +
            var oop = require("../lib/oop");
         
     | 
| 
      
 153 
     | 
    
         
            +
            var lang = require("../lib/lang");
         
     | 
| 
      
 154 
     | 
    
         
            +
            var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
         
     | 
| 
      
 155 
     | 
    
         
            +
             
     | 
| 
      
 156 
     | 
    
         
            +
            var PythonHighlightRules = function() {
         
     | 
| 
      
 157 
     | 
    
         
            +
             
     | 
| 
      
 158 
     | 
    
         
            +
                var keywords = lang.arrayToMap(
         
     | 
| 
      
 159 
     | 
    
         
            +
                    ("and|as|assert|break|class|continue|def|del|elif|else|except|exec|" +
         
     | 
| 
      
 160 
     | 
    
         
            +
                    "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" +
         
     | 
| 
      
 161 
     | 
    
         
            +
                    "raise|return|try|while|with|yield").split("|")
         
     | 
| 
      
 162 
     | 
    
         
            +
                );
         
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
                var builtinConstants = lang.arrayToMap(
         
     | 
| 
      
 165 
     | 
    
         
            +
                    ("True|False|None|NotImplemented|Ellipsis|__debug__").split("|")
         
     | 
| 
      
 166 
     | 
    
         
            +
                );
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
      
 168 
     | 
    
         
            +
                var builtinFunctions = lang.arrayToMap(
         
     | 
| 
      
 169 
     | 
    
         
            +
                    ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
         
     | 
| 
      
 170 
     | 
    
         
            +
                    "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +
         
     | 
| 
      
 171 
     | 
    
         
            +
                    "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" +
         
     | 
| 
      
 172 
     | 
    
         
            +
                    "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" +
         
     | 
| 
      
 173 
     | 
    
         
            +
                    "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" +
         
     | 
| 
      
 174 
     | 
    
         
            +
                    "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" +
         
     | 
| 
      
 175 
     | 
    
         
            +
                    "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" +
         
     | 
| 
      
 176 
     | 
    
         
            +
                    "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern").split("|")
         
     | 
| 
      
 177 
     | 
    
         
            +
                );
         
     | 
| 
      
 178 
     | 
    
         
            +
             
     | 
| 
      
 179 
     | 
    
         
            +
                var futureReserved = lang.arrayToMap(
         
     | 
| 
      
 180 
     | 
    
         
            +
                    ("").split("|")
         
     | 
| 
      
 181 
     | 
    
         
            +
                );
         
     | 
| 
      
 182 
     | 
    
         
            +
             
     | 
| 
      
 183 
     | 
    
         
            +
                var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
                var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
         
     | 
| 
      
 186 
     | 
    
         
            +
                var octInteger = "(?:0[oO]?[0-7]+)";
         
     | 
| 
      
 187 
     | 
    
         
            +
                var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
         
     | 
| 
      
 188 
     | 
    
         
            +
                var binInteger = "(?:0[bB][01]+)";
         
     | 
| 
      
 189 
     | 
    
         
            +
                var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
         
     | 
| 
      
 190 
     | 
    
         
            +
             
     | 
| 
      
 191 
     | 
    
         
            +
                var exponent = "(?:[eE][+-]?\\d+)";
         
     | 
| 
      
 192 
     | 
    
         
            +
                var fraction = "(?:\\.\\d+)";
         
     | 
| 
      
 193 
     | 
    
         
            +
                var intPart = "(?:\\d+)";
         
     | 
| 
      
 194 
     | 
    
         
            +
                var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
         
     | 
| 
      
 195 
     | 
    
         
            +
                var exponentFloat = "(?:(?:" + pointFloat + "|" +  intPart + ")" + exponent + ")";
         
     | 
| 
      
 196 
     | 
    
         
            +
                var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
         
     | 
| 
      
 197 
     | 
    
         
            +
             
     | 
| 
      
 198 
     | 
    
         
            +
                this.$rules = {
         
     | 
| 
      
 199 
     | 
    
         
            +
                    "start" : [ {
         
     | 
| 
      
 200 
     | 
    
         
            +
                        token : "comment",
         
     | 
| 
      
 201 
     | 
    
         
            +
                        regex : "#.*$"
         
     | 
| 
      
 202 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 203 
     | 
    
         
            +
                        token : "string",           // """ string
         
     | 
| 
      
 204 
     | 
    
         
            +
                        regex : strPre + '"{3}(?:[^\\\\]|\\\\.)*?"{3}'
         
     | 
| 
      
 205 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 206 
     | 
    
         
            +
                        token : "string",           // multi line """ string start
         
     | 
| 
      
 207 
     | 
    
         
            +
                        merge : true,
         
     | 
| 
      
 208 
     | 
    
         
            +
                        regex : strPre + '"{3}.*$',
         
     | 
| 
      
 209 
     | 
    
         
            +
                        next : "qqstring"
         
     | 
| 
      
 210 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 211 
     | 
    
         
            +
                        token : "string",           // " string
         
     | 
| 
      
 212 
     | 
    
         
            +
                        regex : strPre + '"(?:[^\\\\]|\\\\.)*?"'
         
     | 
| 
      
 213 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 214 
     | 
    
         
            +
                        token : "string",           // ''' string
         
     | 
| 
      
 215 
     | 
    
         
            +
                        regex : strPre + "'{3}(?:[^\\\\]|\\\\.)*?'{3}"
         
     | 
| 
      
 216 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 217 
     | 
    
         
            +
                        token : "string",           // multi line ''' string start
         
     | 
| 
      
 218 
     | 
    
         
            +
                        merge : true,
         
     | 
| 
      
 219 
     | 
    
         
            +
                        regex : strPre + "'{3}.*$",
         
     | 
| 
      
 220 
     | 
    
         
            +
                        next : "qstring"
         
     | 
| 
      
 221 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 222 
     | 
    
         
            +
                        token : "string",           // ' string
         
     | 
| 
      
 223 
     | 
    
         
            +
                        regex : strPre + "'(?:[^\\\\]|\\\\.)*?'"
         
     | 
| 
      
 224 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 225 
     | 
    
         
            +
                        token : "constant.numeric", // imaginary
         
     | 
| 
      
 226 
     | 
    
         
            +
                        regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
         
     | 
| 
      
 227 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 228 
     | 
    
         
            +
                        token : "constant.numeric", // float
         
     | 
| 
      
 229 
     | 
    
         
            +
                        regex : floatNumber
         
     | 
| 
      
 230 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 231 
     | 
    
         
            +
                        token : "constant.numeric", // long integer
         
     | 
| 
      
 232 
     | 
    
         
            +
                        regex : integer + "[lL]\\b"
         
     | 
| 
      
 233 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 234 
     | 
    
         
            +
                        token : "constant.numeric", // integer
         
     | 
| 
      
 235 
     | 
    
         
            +
                        regex : integer + "\\b"
         
     | 
| 
      
 236 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 237 
     | 
    
         
            +
                        token : function(value) {
         
     | 
| 
      
 238 
     | 
    
         
            +
                            if (keywords.hasOwnProperty(value))
         
     | 
| 
      
 239 
     | 
    
         
            +
                                return "keyword";
         
     | 
| 
      
 240 
     | 
    
         
            +
                            else if (builtinConstants.hasOwnProperty(value))
         
     | 
| 
      
 241 
     | 
    
         
            +
                                return "constant.language";
         
     | 
| 
      
 242 
     | 
    
         
            +
                            else if (futureReserved.hasOwnProperty(value))
         
     | 
| 
      
 243 
     | 
    
         
            +
                                return "invalid.illegal";
         
     | 
| 
      
 244 
     | 
    
         
            +
                            else if (builtinFunctions.hasOwnProperty(value))
         
     | 
| 
      
 245 
     | 
    
         
            +
                                return "support.function";
         
     | 
| 
      
 246 
     | 
    
         
            +
                            else if (value == "debugger")
         
     | 
| 
      
 247 
     | 
    
         
            +
                                return "invalid.deprecated";
         
     | 
| 
      
 248 
     | 
    
         
            +
                            else
         
     | 
| 
      
 249 
     | 
    
         
            +
                                return "identifier";
         
     | 
| 
      
 250 
     | 
    
         
            +
                        },
         
     | 
| 
      
 251 
     | 
    
         
            +
                        regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
         
     | 
| 
      
 252 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 253 
     | 
    
         
            +
                        token : "keyword.operator",
         
     | 
| 
      
 254 
     | 
    
         
            +
                        regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="
         
     | 
| 
      
 255 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 256 
     | 
    
         
            +
                        token : "paren.lparen",
         
     | 
| 
      
 257 
     | 
    
         
            +
                        regex : "[\\[\\(\\{]"
         
     | 
| 
      
 258 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 259 
     | 
    
         
            +
                        token : "paren.rparen",
         
     | 
| 
      
 260 
     | 
    
         
            +
                        regex : "[\\]\\)\\}]"
         
     | 
| 
      
 261 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 262 
     | 
    
         
            +
                        token : "text",
         
     | 
| 
      
 263 
     | 
    
         
            +
                        regex : "\\s+"
         
     | 
| 
      
 264 
     | 
    
         
            +
                    } ],
         
     | 
| 
      
 265 
     | 
    
         
            +
                    "qqstring" : [ {
         
     | 
| 
      
 266 
     | 
    
         
            +
                        token : "string", // multi line """ string end
         
     | 
| 
      
 267 
     | 
    
         
            +
                        regex : '(?:[^\\\\]|\\\\.)*?"{3}',
         
     | 
| 
      
 268 
     | 
    
         
            +
                        next : "start"
         
     | 
| 
      
 269 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 270 
     | 
    
         
            +
                        token : "string",
         
     | 
| 
      
 271 
     | 
    
         
            +
                        merge : true,
         
     | 
| 
      
 272 
     | 
    
         
            +
                        regex : '.+'
         
     | 
| 
      
 273 
     | 
    
         
            +
                    } ],
         
     | 
| 
      
 274 
     | 
    
         
            +
                    "qstring" : [ {
         
     | 
| 
      
 275 
     | 
    
         
            +
                        token : "string",  // multi line ''' string end
         
     | 
| 
      
 276 
     | 
    
         
            +
                        regex : "(?:[^\\\\]|\\\\.)*?'{3}",
         
     | 
| 
      
 277 
     | 
    
         
            +
                        next : "start"
         
     | 
| 
      
 278 
     | 
    
         
            +
                    }, {
         
     | 
| 
      
 279 
     | 
    
         
            +
                        token : "string",
         
     | 
| 
      
 280 
     | 
    
         
            +
                        merge : true,
         
     | 
| 
      
 281 
     | 
    
         
            +
                        regex : '.+'
         
     | 
| 
      
 282 
     | 
    
         
            +
                    } ]
         
     | 
| 
      
 283 
     | 
    
         
            +
                };
         
     | 
| 
      
 284 
     | 
    
         
            +
            };
         
     | 
| 
      
 285 
     | 
    
         
            +
             
     | 
| 
      
 286 
     | 
    
         
            +
            oop.inherits(PythonHighlightRules, TextHighlightRules);
         
     | 
| 
      
 287 
     | 
    
         
            +
             
     | 
| 
      
 288 
     | 
    
         
            +
            exports.PythonHighlightRules = PythonHighlightRules;
         
     | 
| 
      
 289 
     | 
    
         
            +
            });
         
     | 
| 
      
 290 
     | 
    
         
            +
             
     | 
| 
      
 291 
     | 
    
         
            +
            define('ace/mode/folding/pythonic', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
         
     | 
| 
      
 292 
     | 
    
         
            +
             
     | 
| 
      
 293 
     | 
    
         
            +
             
     | 
| 
      
 294 
     | 
    
         
            +
            var oop = require("../../lib/oop");
         
     | 
| 
      
 295 
     | 
    
         
            +
            var BaseFoldMode = require("./fold_mode").FoldMode;
         
     | 
| 
      
 296 
     | 
    
         
            +
             
     | 
| 
      
 297 
     | 
    
         
            +
            var FoldMode = exports.FoldMode = function(markers) {
         
     | 
| 
      
 298 
     | 
    
         
            +
                this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$");
         
     | 
| 
      
 299 
     | 
    
         
            +
            };
         
     | 
| 
      
 300 
     | 
    
         
            +
            oop.inherits(FoldMode, BaseFoldMode);
         
     | 
| 
      
 301 
     | 
    
         
            +
             
     | 
| 
      
 302 
     | 
    
         
            +
            (function() {
         
     | 
| 
      
 303 
     | 
    
         
            +
             
     | 
| 
      
 304 
     | 
    
         
            +
                this.getFoldWidgetRange = function(session, foldStyle, row) {
         
     | 
| 
      
 305 
     | 
    
         
            +
                    var line = session.getLine(row);
         
     | 
| 
      
 306 
     | 
    
         
            +
                    var match = line.match(this.foldingStartMarker);
         
     | 
| 
      
 307 
     | 
    
         
            +
                    if (match) {
         
     | 
| 
      
 308 
     | 
    
         
            +
                        if (match[1])
         
     | 
| 
      
 309 
     | 
    
         
            +
                            return this.openingBracketBlock(session, match[1], row, match.index);
         
     | 
| 
      
 310 
     | 
    
         
            +
                        if (match[2])
         
     | 
| 
      
 311 
     | 
    
         
            +
                            return this.indentationBlock(session, row, match.index + match[2].length);
         
     | 
| 
      
 312 
     | 
    
         
            +
                        return this.indentationBlock(session, row);
         
     | 
| 
      
 313 
     | 
    
         
            +
                    }
         
     | 
| 
      
 314 
     | 
    
         
            +
                }
         
     | 
| 
      
 315 
     | 
    
         
            +
             
     | 
| 
      
 316 
     | 
    
         
            +
            }).call(FoldMode.prototype);
         
     | 
| 
      
 317 
     | 
    
         
            +
             
     | 
| 
      
 318 
     | 
    
         
            +
            });
         
     | 
| 
      
 319 
     | 
    
         
            +
             
     | 
| 
      
 320 
     | 
    
         
            +
            define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
         
     | 
| 
      
 321 
     | 
    
         
            +
             
     | 
| 
      
 322 
     | 
    
         
            +
             
     | 
| 
      
 323 
     | 
    
         
            +
            var Range = require("../../range").Range;
         
     | 
| 
      
 324 
     | 
    
         
            +
             
     | 
| 
      
 325 
     | 
    
         
            +
            var FoldMode = exports.FoldMode = function() {};
         
     | 
| 
      
 326 
     | 
    
         
            +
             
     | 
| 
      
 327 
     | 
    
         
            +
            (function() {
         
     | 
| 
      
 328 
     | 
    
         
            +
             
     | 
| 
      
 329 
     | 
    
         
            +
                this.foldingStartMarker = null;
         
     | 
| 
      
 330 
     | 
    
         
            +
                this.foldingStopMarker = null;
         
     | 
| 
      
 331 
     | 
    
         
            +
             
     | 
| 
      
 332 
     | 
    
         
            +
                // must return "" if there's no fold, to enable caching
         
     | 
| 
      
 333 
     | 
    
         
            +
                this.getFoldWidget = function(session, foldStyle, row) {
         
     | 
| 
      
 334 
     | 
    
         
            +
                    var line = session.getLine(row);
         
     | 
| 
      
 335 
     | 
    
         
            +
                    if (this.foldingStartMarker.test(line))
         
     | 
| 
      
 336 
     | 
    
         
            +
                        return "start";
         
     | 
| 
      
 337 
     | 
    
         
            +
                    if (foldStyle == "markbeginend"
         
     | 
| 
      
 338 
     | 
    
         
            +
                            && this.foldingStopMarker
         
     | 
| 
      
 339 
     | 
    
         
            +
                            && this.foldingStopMarker.test(line))
         
     | 
| 
      
 340 
     | 
    
         
            +
                        return "end";
         
     | 
| 
      
 341 
     | 
    
         
            +
                    return "";
         
     | 
| 
      
 342 
     | 
    
         
            +
                };
         
     | 
| 
      
 343 
     | 
    
         
            +
             
     | 
| 
      
 344 
     | 
    
         
            +
                this.getFoldWidgetRange = function(session, foldStyle, row) {
         
     | 
| 
      
 345 
     | 
    
         
            +
                    return null;
         
     | 
| 
      
 346 
     | 
    
         
            +
                };
         
     | 
| 
      
 347 
     | 
    
         
            +
             
     | 
| 
      
 348 
     | 
    
         
            +
                this.indentationBlock = function(session, row, column) {
         
     | 
| 
      
 349 
     | 
    
         
            +
                    var re = /\S/;
         
     | 
| 
      
 350 
     | 
    
         
            +
                    var line = session.getLine(row);
         
     | 
| 
      
 351 
     | 
    
         
            +
                    var startLevel = line.search(re);
         
     | 
| 
      
 352 
     | 
    
         
            +
                    if (startLevel == -1)
         
     | 
| 
      
 353 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 354 
     | 
    
         
            +
             
     | 
| 
      
 355 
     | 
    
         
            +
                    var startColumn = column || line.length;
         
     | 
| 
      
 356 
     | 
    
         
            +
                    var maxRow = session.getLength();
         
     | 
| 
      
 357 
     | 
    
         
            +
                    var startRow = row;
         
     | 
| 
      
 358 
     | 
    
         
            +
                    var endRow = row;
         
     | 
| 
      
 359 
     | 
    
         
            +
             
     | 
| 
      
 360 
     | 
    
         
            +
                    while (++row < maxRow) {
         
     | 
| 
      
 361 
     | 
    
         
            +
                        var level = session.getLine(row).search(re);
         
     | 
| 
      
 362 
     | 
    
         
            +
             
     | 
| 
      
 363 
     | 
    
         
            +
                        if (level == -1)
         
     | 
| 
      
 364 
     | 
    
         
            +
                            continue;
         
     | 
| 
      
 365 
     | 
    
         
            +
             
     | 
| 
      
 366 
     | 
    
         
            +
                        if (level <= startLevel)
         
     | 
| 
      
 367 
     | 
    
         
            +
                            break;
         
     | 
| 
      
 368 
     | 
    
         
            +
             
     | 
| 
      
 369 
     | 
    
         
            +
                        endRow = row;
         
     | 
| 
      
 370 
     | 
    
         
            +
                    }
         
     | 
| 
      
 371 
     | 
    
         
            +
             
     | 
| 
      
 372 
     | 
    
         
            +
                    if (endRow > startRow) {
         
     | 
| 
      
 373 
     | 
    
         
            +
                        var endColumn = session.getLine(endRow).length;
         
     | 
| 
      
 374 
     | 
    
         
            +
                        return new Range(startRow, startColumn, endRow, endColumn);
         
     | 
| 
      
 375 
     | 
    
         
            +
                    }
         
     | 
| 
      
 376 
     | 
    
         
            +
                };
         
     | 
| 
      
 377 
     | 
    
         
            +
             
     | 
| 
      
 378 
     | 
    
         
            +
                this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
         
     | 
| 
      
 379 
     | 
    
         
            +
                    var start = {row: row, column: column + 1};
         
     | 
| 
      
 380 
     | 
    
         
            +
                    var end = session.$findClosingBracket(bracket, start, typeRe);
         
     | 
| 
      
 381 
     | 
    
         
            +
                    if (!end)
         
     | 
| 
      
 382 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 383 
     | 
    
         
            +
             
     | 
| 
      
 384 
     | 
    
         
            +
                    var fw = session.foldWidgets[end.row];
         
     | 
| 
      
 385 
     | 
    
         
            +
                    if (fw == null)
         
     | 
| 
      
 386 
     | 
    
         
            +
                        fw = this.getFoldWidget(session, end.row);
         
     | 
| 
      
 387 
     | 
    
         
            +
             
     | 
| 
      
 388 
     | 
    
         
            +
                    if (fw == "start" && end.row > start.row) {
         
     | 
| 
      
 389 
     | 
    
         
            +
                        end.row --;
         
     | 
| 
      
 390 
     | 
    
         
            +
                        end.column = session.getLine(end.row).length;
         
     | 
| 
      
 391 
     | 
    
         
            +
                    }
         
     | 
| 
      
 392 
     | 
    
         
            +
                    return Range.fromPoints(start, end);
         
     | 
| 
      
 393 
     | 
    
         
            +
                };
         
     | 
| 
      
 394 
     | 
    
         
            +
             
     | 
| 
      
 395 
     | 
    
         
            +
            }).call(FoldMode.prototype);
         
     | 
| 
      
 396 
     | 
    
         
            +
             
     | 
| 
      
 397 
     | 
    
         
            +
            });
         
     | 
| 
         @@ -1 +1,318 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
      
 1 
     | 
    
         
            +
            /* ***** BEGIN LICENSE BLOCK *****
         
     | 
| 
      
 2 
     | 
    
         
            +
             * Version: MPL 1.1/GPL 2.0/LGPL 2.1
         
     | 
| 
      
 3 
     | 
    
         
            +
             *
         
     | 
| 
      
 4 
     | 
    
         
            +
             * The contents of this file are subject to the Mozilla Public License Version
         
     | 
| 
      
 5 
     | 
    
         
            +
             * 1.1 (the "License"); you may not use this file except in compliance with
         
     | 
| 
      
 6 
     | 
    
         
            +
             * the License. You may obtain a copy of the License at
         
     | 
| 
      
 7 
     | 
    
         
            +
             * http://www.mozilla.org/MPL/
         
     | 
| 
      
 8 
     | 
    
         
            +
             *
         
     | 
| 
      
 9 
     | 
    
         
            +
             * Software distributed under the License is distributed on an "AS IS" basis,
         
     | 
| 
      
 10 
     | 
    
         
            +
             * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
         
     | 
| 
      
 11 
     | 
    
         
            +
             * for the specific language governing rights and limitations under the
         
     | 
| 
      
 12 
     | 
    
         
            +
             * License.
         
     | 
| 
      
 13 
     | 
    
         
            +
             *
         
     | 
| 
      
 14 
     | 
    
         
            +
             * The Original Code is Ajax.org Code Editor (ACE).
         
     | 
| 
      
 15 
     | 
    
         
            +
             *
         
     | 
| 
      
 16 
     | 
    
         
            +
             * The Initial Developer of the Original Code is
         
     | 
| 
      
 17 
     | 
    
         
            +
             * Ajax.org B.V.
         
     | 
| 
      
 18 
     | 
    
         
            +
             * Portions created by the Initial Developer are Copyright (C) 2010
         
     | 
| 
      
 19 
     | 
    
         
            +
             * the Initial Developer. All Rights Reserved.
         
     | 
| 
      
 20 
     | 
    
         
            +
             *
         
     | 
| 
      
 21 
     | 
    
         
            +
             * Contributor(s):
         
     | 
| 
      
 22 
     | 
    
         
            +
             *      Fabian Jakobs <fabian AT ajax DOT org>
         
     | 
| 
      
 23 
     | 
    
         
            +
             *      Shlomo Zalman Heigh <shlomozalmanheigh AT gmail DOT com>
         
     | 
| 
      
 24 
     | 
    
         
            +
             *
         
     | 
| 
      
 25 
     | 
    
         
            +
             * Alternatively, the contents of this file may be used under the terms of
         
     | 
| 
      
 26 
     | 
    
         
            +
             * either the GNU General Public License Version 2 or later (the "GPL"), or
         
     | 
| 
      
 27 
     | 
    
         
            +
             * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
         
     | 
| 
      
 28 
     | 
    
         
            +
             * in which case the provisions of the GPL or the LGPL are applicable instead
         
     | 
| 
      
 29 
     | 
    
         
            +
             * of those above. If you wish to allow use of your version of this file only
         
     | 
| 
      
 30 
     | 
    
         
            +
             * under the terms of either the GPL or the LGPL, and not to allow others to
         
     | 
| 
      
 31 
     | 
    
         
            +
             * use your version of this file under the terms of the MPL, indicate your
         
     | 
| 
      
 32 
     | 
    
         
            +
             * decision by deleting the provisions above and replace them with the notice
         
     | 
| 
      
 33 
     | 
    
         
            +
             * and other provisions required by the GPL or the LGPL. If you do not delete
         
     | 
| 
      
 34 
     | 
    
         
            +
             * the provisions above, a recipient may use your version of this file under
         
     | 
| 
      
 35 
     | 
    
         
            +
             * the terms of any one of the MPL, the GPL or the LGPL.
         
     | 
| 
      
 36 
     | 
    
         
            +
             *
         
     | 
| 
      
 37 
     | 
    
         
            +
             * ***** END LICENSE BLOCK ***** */
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
            define('ace/mode/ruby', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/ruby_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range'], function(require, exports, module) {
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
            var oop = require("../lib/oop");
         
     | 
| 
      
 43 
     | 
    
         
            +
            var TextMode = require("./text").Mode;
         
     | 
| 
      
 44 
     | 
    
         
            +
            var Tokenizer = require("../tokenizer").Tokenizer;
         
     | 
| 
      
 45 
     | 
    
         
            +
            var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules;
         
     | 
| 
      
 46 
     | 
    
         
            +
            var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
         
     | 
| 
      
 47 
     | 
    
         
            +
            var Range = require("../range").Range;
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
            var Mode = function() {
         
     | 
| 
      
 50 
     | 
    
         
            +
                this.$tokenizer = new Tokenizer(new RubyHighlightRules().getRules());
         
     | 
| 
      
 51 
     | 
    
         
            +
                this.$outdent = new MatchingBraceOutdent();
         
     | 
| 
      
 52 
     | 
    
         
            +
            };
         
     | 
| 
      
 53 
     | 
    
         
            +
            oop.inherits(Mode, TextMode);
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
            (function() {
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                this.toggleCommentLines = function(state, doc, startRow, endRow) {
         
     | 
| 
      
 58 
     | 
    
         
            +
                    var outdent = true;
         
     | 
| 
      
 59 
     | 
    
         
            +
                    var re = /^(\s*)#/;
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
                    for (var i=startRow; i<= endRow; i++) {
         
     | 
| 
      
 62 
     | 
    
         
            +
                        if (!re.test(doc.getLine(i))) {
         
     | 
| 
      
 63 
     | 
    
         
            +
                            outdent = false;
         
     | 
| 
      
 64 
     | 
    
         
            +
                            break;
         
     | 
| 
      
 65 
     | 
    
         
            +
                        }
         
     | 
| 
      
 66 
     | 
    
         
            +
                    }
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                    if (outdent) {
         
     | 
| 
      
 69 
     | 
    
         
            +
                        var deleteRange = new Range(0, 0, 0, 0);
         
     | 
| 
      
 70 
     | 
    
         
            +
                        for (var i=startRow; i<= endRow; i++)
         
     | 
| 
      
 71 
     | 
    
         
            +
                        {
         
     | 
| 
      
 72 
     | 
    
         
            +
                            var line = doc.getLine(i);
         
     | 
| 
      
 73 
     | 
    
         
            +
                            var m = line.match(re);
         
     | 
| 
      
 74 
     | 
    
         
            +
                            deleteRange.start.row = i;
         
     | 
| 
      
 75 
     | 
    
         
            +
                            deleteRange.end.row = i;
         
     | 
| 
      
 76 
     | 
    
         
            +
                            deleteRange.end.column = m[0].length;
         
     | 
| 
      
 77 
     | 
    
         
            +
                            doc.replace(deleteRange, m[1]);
         
     | 
| 
      
 78 
     | 
    
         
            +
                        }
         
     | 
| 
      
 79 
     | 
    
         
            +
                    }
         
     | 
| 
      
 80 
     | 
    
         
            +
                    else {
         
     | 
| 
      
 81 
     | 
    
         
            +
                        doc.indentRows(startRow, endRow, "#");
         
     | 
| 
      
 82 
     | 
    
         
            +
                    }
         
     | 
| 
      
 83 
     | 
    
         
            +
                };
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                this.getNextLineIndent = function(state, line, tab) {
         
     | 
| 
      
 86 
     | 
    
         
            +
                    var indent = this.$getIndent(line);
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
                    var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
         
     | 
| 
      
 89 
     | 
    
         
            +
                    var tokens = tokenizedLine.tokens;
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                    if (tokens.length && tokens[tokens.length-1].type == "comment") {
         
     | 
| 
      
 92 
     | 
    
         
            +
                        return indent;
         
     | 
| 
      
 93 
     | 
    
         
            +
                    }
         
     | 
| 
      
 94 
     | 
    
         
            +
                    
         
     | 
| 
      
 95 
     | 
    
         
            +
                    if (state == "start") {
         
     | 
| 
      
 96 
     | 
    
         
            +
                        var match = line.match(/^.*[\{\(\[]\s*$/);
         
     | 
| 
      
 97 
     | 
    
         
            +
                        if (match) {
         
     | 
| 
      
 98 
     | 
    
         
            +
                            indent += tab;
         
     | 
| 
      
 99 
     | 
    
         
            +
                        }
         
     | 
| 
      
 100 
     | 
    
         
            +
                    }
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                    return indent;
         
     | 
| 
      
 103 
     | 
    
         
            +
                };
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                this.checkOutdent = function(state, line, input) {
         
     | 
| 
      
 106 
     | 
    
         
            +
                    return this.$outdent.checkOutdent(line, input);
         
     | 
| 
      
 107 
     | 
    
         
            +
                };
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
                this.autoOutdent = function(state, doc, row) {
         
     | 
| 
      
 110 
     | 
    
         
            +
                    this.$outdent.autoOutdent(doc, row);
         
     | 
| 
      
 111 
     | 
    
         
            +
                };
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
            }).call(Mode.prototype);
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
            exports.Mode = Mode;
         
     | 
| 
      
 116 
     | 
    
         
            +
            });
         
     | 
| 
      
 117 
     | 
    
         
            +
             
     | 
| 
      
 118 
     | 
    
         
            +
            define('ace/mode/ruby_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
             
     | 
| 
      
 121 
     | 
    
         
            +
            var oop = require("../lib/oop");
         
     | 
| 
      
 122 
     | 
    
         
            +
            var lang = require("../lib/lang");
         
     | 
| 
      
 123 
     | 
    
         
            +
            var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
         
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
      
 125 
     | 
    
         
            +
            var RubyHighlightRules = function() {
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
      
 127 
     | 
    
         
            +
                var builtinFunctions = lang.arrayToMap(
         
     | 
| 
      
 128 
     | 
    
         
            +
                    ("abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
         
     | 
| 
      
 129 
     | 
    
         
            +
                    "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" + 
         
     | 
| 
      
 130 
     | 
    
         
            +
                    "assert_raise|assert_nothing_raised|assert_instance_of|assert_kind_of|assert_respond_to|" +
         
     | 
| 
      
 131 
     | 
    
         
            +
                    "assert_operator|assert_send|assert_difference|assert_no_difference|assert_recognizes|" +
         
     | 
| 
      
 132 
     | 
    
         
            +
                    "assert_generates|assert_response|assert_redirected_to|assert_template|assert_select|" +
         
     | 
| 
      
 133 
     | 
    
         
            +
                    "assert_select_email|assert_select_rjs|assert_select_encoded|css_select|at_exit|" +
         
     | 
| 
      
 134 
     | 
    
         
            +
                    "attr|attr_writer|attr_reader|attr_accessor|attr_accessible|autoload|binding|block_given?|callcc|" +
         
     | 
| 
      
 135 
     | 
    
         
            +
                    "caller|catch|chomp|chomp!|chop|chop!|defined?|delete_via_redirect|eval|exec|exit|" +
         
     | 
| 
      
 136 
     | 
    
         
            +
                    "exit!|fail|Float|flunk|follow_redirect!|fork|form_for|form_tag|format|gets|global_variables|gsub|" +
         
     | 
| 
      
 137 
     | 
    
         
            +
                    "gsub!|get_via_redirect|h|host!|https?|https!|include|Integer|lambda|link_to|" +
         
     | 
| 
      
 138 
     | 
    
         
            +
                    "link_to_unless_current|link_to_function|link_to_remote|load|local_variables|loop|open|open_session|" +
         
     | 
| 
      
 139 
     | 
    
         
            +
                    "p|print|printf|proc|putc|puts|post_via_redirect|put_via_redirect|raise|rand|" +
         
     | 
| 
      
 140 
     | 
    
         
            +
                    "raw|readline|readlines|redirect?|request_via_redirect|require|scan|select|" +
         
     | 
| 
      
 141 
     | 
    
         
            +
                    "set_trace_func|sleep|split|sprintf|srand|String|stylesheet_link_tag|syscall|system|sub|sub!|test|" +
         
     | 
| 
      
 142 
     | 
    
         
            +
                    "throw|trace_var|trap|untrace_var|atan2|cos|exp|frexp|ldexp|log|log10|sin|sqrt|tan|" +
         
     | 
| 
      
 143 
     | 
    
         
            +
                    "render|javascript_include_tag|csrf_meta_tag|label_tag|text_field_tag|submit_tag|check_box_tag|" +
         
     | 
| 
      
 144 
     | 
    
         
            +
                    "content_tag|radio_button_tag|text_area_tag|password_field_tag|hidden_field_tag|" +
         
     | 
| 
      
 145 
     | 
    
         
            +
                    "fields_for|select_tag|options_for_select|options_from_collection_for_select|collection_select|" +
         
     | 
| 
      
 146 
     | 
    
         
            +
                    "time_zone_select|select_date|select_time|select_datetime|date_select|time_select|datetime_select|" +
         
     | 
| 
      
 147 
     | 
    
         
            +
                    "select_year|select_month|select_day|select_hour|select_minute|select_second|file_field_tag|" +
         
     | 
| 
      
 148 
     | 
    
         
            +
                    "file_field|respond_to|skip_before_filter|around_filter|after_filter|verify|" +
         
     | 
| 
      
 149 
     | 
    
         
            +
                    "protect_from_forgery|rescue_from|helper_method|redirect_to|before_filter|" +
         
     | 
| 
      
 150 
     | 
    
         
            +
                    "send_data|send_file|validates_presence_of|validates_uniqueness_of|validates_length_of|" +
         
     | 
| 
      
 151 
     | 
    
         
            +
                    "validates_format_of|validates_acceptance_of|validates_associated|validates_exclusion_of|" +
         
     | 
| 
      
 152 
     | 
    
         
            +
                    "validates_inclusion_of|validates_numericality_of|validates_with|validates_each|" +
         
     | 
| 
      
 153 
     | 
    
         
            +
                    "authenticate_or_request_with_http_basic|authenticate_or_request_with_http_digest|" +
         
     | 
| 
      
 154 
     | 
    
         
            +
                    "filter_parameter_logging|match|get|post|resources|redirect|scope|assert_routing|" +
         
     | 
| 
      
 155 
     | 
    
         
            +
                    "translate|localize|extract_locale_from_tld|t|l|caches_page|expire_page|caches_action|expire_action|" +
         
     | 
| 
      
 156 
     | 
    
         
            +
                    "cache|expire_fragment|expire_cache_for|observe|cache_sweeper|" +
         
     | 
| 
      
 157 
     | 
    
         
            +
                    "has_many|has_one|belongs_to|has_and_belongs_to_many").split("|")
         
     | 
| 
      
 158 
     | 
    
         
            +
                );
         
     | 
| 
      
 159 
     | 
    
         
            +
             
     | 
| 
      
 160 
     | 
    
         
            +
                var keywords = lang.arrayToMap(
         
     | 
| 
      
 161 
     | 
    
         
            +
                    ("alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|" +
         
     | 
| 
      
 162 
     | 
    
         
            +
                    "__FILE__|finally|for|gem|if|in|__LINE__|module|next|not|or|private|protected|public|" + 
         
     | 
| 
      
 163 
     | 
    
         
            +
                    "redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield").split("|")
         
     | 
| 
      
 164 
     | 
    
         
            +
                );
         
     | 
| 
      
 165 
     | 
    
         
            +
             
     | 
| 
      
 166 
     | 
    
         
            +
                var buildinConstants = lang.arrayToMap(
         
     | 
| 
      
 167 
     | 
    
         
            +
                    ("true|TRUE|false|FALSE|nil|NIL|ARGF|ARGV|DATA|ENV|RUBY_PLATFORM|RUBY_RELEASE_DATE|" +
         
     | 
| 
      
 168 
     | 
    
         
            +
                    "RUBY_VERSION|STDERR|STDIN|STDOUT|TOPLEVEL_BINDING").split("|")
         
     | 
| 
      
 169 
     | 
    
         
            +
                );
         
     | 
| 
      
 170 
     | 
    
         
            +
             
     | 
| 
      
 171 
     | 
    
         
            +
                var builtinVariables = lang.arrayToMap(
         
     | 
| 
      
 172 
     | 
    
         
            +
                    ("\$DEBUG|\$defout|\$FILENAME|\$LOAD_PATH|\$SAFE|\$stdin|\$stdout|\$stderr|\$VERBOSE|" +
         
     | 
| 
      
 173 
     | 
    
         
            +
                    "$!|root_url|flash|session|cookies|params|request|response|logger").split("|")
         
     | 
| 
      
 174 
     | 
    
         
            +
                );
         
     | 
| 
      
 175 
     | 
    
         
            +
             
     | 
| 
      
 176 
     | 
    
         
            +
                // regexp must not have capturing parentheses. Use (?:) instead.
         
     | 
| 
      
 177 
     | 
    
         
            +
                // regexps are ordered -> the first match is used
         
     | 
| 
      
 178 
     | 
    
         
            +
             
     | 
| 
      
 179 
     | 
    
         
            +
                this.$rules = {
         
     | 
| 
      
 180 
     | 
    
         
            +
                    "start" : [
         
     | 
| 
      
 181 
     | 
    
         
            +
                        {
         
     | 
| 
      
 182 
     | 
    
         
            +
                            token : "comment",
         
     | 
| 
      
 183 
     | 
    
         
            +
                            regex : "#.*$"
         
     | 
| 
      
 184 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 185 
     | 
    
         
            +
                            token : "comment", // multi line comment
         
     | 
| 
      
 186 
     | 
    
         
            +
                            merge : true,
         
     | 
| 
      
 187 
     | 
    
         
            +
                            regex : "^\=begin$",
         
     | 
| 
      
 188 
     | 
    
         
            +
                            next : "comment"
         
     | 
| 
      
 189 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 190 
     | 
    
         
            +
                            token : "string.regexp",
         
     | 
| 
      
 191 
     | 
    
         
            +
                            regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
         
     | 
| 
      
 192 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 193 
     | 
    
         
            +
                            token : "string", // single line
         
     | 
| 
      
 194 
     | 
    
         
            +
                            regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
         
     | 
| 
      
 195 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 196 
     | 
    
         
            +
                            token : "string", // single line
         
     | 
| 
      
 197 
     | 
    
         
            +
                            regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
         
     | 
| 
      
 198 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 199 
     | 
    
         
            +
                            token : "string", // backtick string
         
     | 
| 
      
 200 
     | 
    
         
            +
                            regex : "[`](?:(?:\\\\.)|(?:[^'\\\\]))*?[`]"
         
     | 
| 
      
 201 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 202 
     | 
    
         
            +
                            token : "text", // namespaces aren't symbols
         
     | 
| 
      
 203 
     | 
    
         
            +
                            regex : "::"
         
     | 
| 
      
 204 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 205 
     | 
    
         
            +
                            token : "variable.instancce", // instance variable
         
     | 
| 
      
 206 
     | 
    
         
            +
                            regex : "@{1,2}(?:[a-zA-Z_]|\d)+"
         
     | 
| 
      
 207 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 208 
     | 
    
         
            +
                            token : "variable.class", // class name
         
     | 
| 
      
 209 
     | 
    
         
            +
                            regex : "[A-Z](?:[a-zA-Z_]|\d)+"
         
     | 
| 
      
 210 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 211 
     | 
    
         
            +
                            token : "string", // symbol
         
     | 
| 
      
 212 
     | 
    
         
            +
                            regex : "[:](?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?"
         
     | 
| 
      
 213 
     | 
    
         
            +
                       }, {
         
     | 
| 
      
 214 
     | 
    
         
            +
                            token : "constant.numeric", // hex
         
     | 
| 
      
 215 
     | 
    
         
            +
                            regex : "0[xX][0-9a-fA-F](?:[0-9a-fA-F]|_(?=[0-9a-fA-F]))*\\b"
         
     | 
| 
      
 216 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 217 
     | 
    
         
            +
                            token : "constant.numeric", // float
         
     | 
| 
      
 218 
     | 
    
         
            +
                            regex : "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?\\b"
         
     | 
| 
      
 219 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 220 
     | 
    
         
            +
                            token : "constant.language.boolean",
         
     | 
| 
      
 221 
     | 
    
         
            +
                            regex : "(?:true|false)\\b"
         
     | 
| 
      
 222 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 223 
     | 
    
         
            +
                            token : function(value) {
         
     | 
| 
      
 224 
     | 
    
         
            +
                                if (value == "self")
         
     | 
| 
      
 225 
     | 
    
         
            +
                                    return "variable.language";
         
     | 
| 
      
 226 
     | 
    
         
            +
                                else if (keywords.hasOwnProperty(value))
         
     | 
| 
      
 227 
     | 
    
         
            +
                                    return "keyword";
         
     | 
| 
      
 228 
     | 
    
         
            +
                                else if (buildinConstants.hasOwnProperty(value))
         
     | 
| 
      
 229 
     | 
    
         
            +
                                    return "constant.language";
         
     | 
| 
      
 230 
     | 
    
         
            +
                                else if (builtinVariables.hasOwnProperty(value))
         
     | 
| 
      
 231 
     | 
    
         
            +
                                    return "variable.language";
         
     | 
| 
      
 232 
     | 
    
         
            +
                                else if (builtinFunctions.hasOwnProperty(value))
         
     | 
| 
      
 233 
     | 
    
         
            +
                                    return "support.function";
         
     | 
| 
      
 234 
     | 
    
         
            +
                                else if (value == "debugger")
         
     | 
| 
      
 235 
     | 
    
         
            +
                                    return "invalid.deprecated";
         
     | 
| 
      
 236 
     | 
    
         
            +
                                else
         
     | 
| 
      
 237 
     | 
    
         
            +
                                    return "identifier";
         
     | 
| 
      
 238 
     | 
    
         
            +
                            },
         
     | 
| 
      
 239 
     | 
    
         
            +
                            // TODO: Unicode escape sequences
         
     | 
| 
      
 240 
     | 
    
         
            +
                            // TODO: Unicode identifiers
         
     | 
| 
      
 241 
     | 
    
         
            +
                            regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
         
     | 
| 
      
 242 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 243 
     | 
    
         
            +
                            token : "keyword.operator",
         
     | 
| 
      
 244 
     | 
    
         
            +
                            regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
         
     | 
| 
      
 245 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 246 
     | 
    
         
            +
                            token : "paren.lparen",
         
     | 
| 
      
 247 
     | 
    
         
            +
                            regex : "[[({]"
         
     | 
| 
      
 248 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 249 
     | 
    
         
            +
                            token : "paren.rparen",
         
     | 
| 
      
 250 
     | 
    
         
            +
                            regex : "[\\])}]"
         
     | 
| 
      
 251 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 252 
     | 
    
         
            +
                            token : "text",
         
     | 
| 
      
 253 
     | 
    
         
            +
                            regex : "\\s+"
         
     | 
| 
      
 254 
     | 
    
         
            +
                        }
         
     | 
| 
      
 255 
     | 
    
         
            +
                    ],
         
     | 
| 
      
 256 
     | 
    
         
            +
                    "comment" : [
         
     | 
| 
      
 257 
     | 
    
         
            +
                        {
         
     | 
| 
      
 258 
     | 
    
         
            +
                            token : "comment", // closing comment
         
     | 
| 
      
 259 
     | 
    
         
            +
                            regex : "^\=end$",
         
     | 
| 
      
 260 
     | 
    
         
            +
                            next : "start"
         
     | 
| 
      
 261 
     | 
    
         
            +
                        }, {
         
     | 
| 
      
 262 
     | 
    
         
            +
                            token : "comment", // comment spanning whole line
         
     | 
| 
      
 263 
     | 
    
         
            +
                            merge : true,
         
     | 
| 
      
 264 
     | 
    
         
            +
                            regex : ".+"
         
     | 
| 
      
 265 
     | 
    
         
            +
                        }
         
     | 
| 
      
 266 
     | 
    
         
            +
                    ]
         
     | 
| 
      
 267 
     | 
    
         
            +
                };
         
     | 
| 
      
 268 
     | 
    
         
            +
            };
         
     | 
| 
      
 269 
     | 
    
         
            +
             
     | 
| 
      
 270 
     | 
    
         
            +
            oop.inherits(RubyHighlightRules, TextHighlightRules);
         
     | 
| 
      
 271 
     | 
    
         
            +
             
     | 
| 
      
 272 
     | 
    
         
            +
            exports.RubyHighlightRules = RubyHighlightRules;
         
     | 
| 
      
 273 
     | 
    
         
            +
            });
         
     | 
| 
      
 274 
     | 
    
         
            +
             
     | 
| 
      
 275 
     | 
    
         
            +
            define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
         
     | 
| 
      
 276 
     | 
    
         
            +
             
     | 
| 
      
 277 
     | 
    
         
            +
             
     | 
| 
      
 278 
     | 
    
         
            +
            var Range = require("../range").Range;
         
     | 
| 
      
 279 
     | 
    
         
            +
             
     | 
| 
      
 280 
     | 
    
         
            +
            var MatchingBraceOutdent = function() {};
         
     | 
| 
      
 281 
     | 
    
         
            +
             
     | 
| 
      
 282 
     | 
    
         
            +
            (function() {
         
     | 
| 
      
 283 
     | 
    
         
            +
             
     | 
| 
      
 284 
     | 
    
         
            +
                this.checkOutdent = function(line, input) {
         
     | 
| 
      
 285 
     | 
    
         
            +
                    if (! /^\s+$/.test(line))
         
     | 
| 
      
 286 
     | 
    
         
            +
                        return false;
         
     | 
| 
      
 287 
     | 
    
         
            +
             
     | 
| 
      
 288 
     | 
    
         
            +
                    return /^\s*\}/.test(input);
         
     | 
| 
      
 289 
     | 
    
         
            +
                };
         
     | 
| 
      
 290 
     | 
    
         
            +
             
     | 
| 
      
 291 
     | 
    
         
            +
                this.autoOutdent = function(doc, row) {
         
     | 
| 
      
 292 
     | 
    
         
            +
                    var line = doc.getLine(row);
         
     | 
| 
      
 293 
     | 
    
         
            +
                    var match = line.match(/^(\s*\})/);
         
     | 
| 
      
 294 
     | 
    
         
            +
             
     | 
| 
      
 295 
     | 
    
         
            +
                    if (!match) return 0;
         
     | 
| 
      
 296 
     | 
    
         
            +
             
     | 
| 
      
 297 
     | 
    
         
            +
                    var column = match[1].length;
         
     | 
| 
      
 298 
     | 
    
         
            +
                    var openBracePos = doc.findMatchingBracket({row: row, column: column});
         
     | 
| 
      
 299 
     | 
    
         
            +
             
     | 
| 
      
 300 
     | 
    
         
            +
                    if (!openBracePos || openBracePos.row == row) return 0;
         
     | 
| 
      
 301 
     | 
    
         
            +
             
     | 
| 
      
 302 
     | 
    
         
            +
                    var indent = this.$getIndent(doc.getLine(openBracePos.row));
         
     | 
| 
      
 303 
     | 
    
         
            +
                    doc.replace(new Range(row, 0, row, column-1), indent);
         
     | 
| 
      
 304 
     | 
    
         
            +
                };
         
     | 
| 
      
 305 
     | 
    
         
            +
             
     | 
| 
      
 306 
     | 
    
         
            +
                this.$getIndent = function(line) {
         
     | 
| 
      
 307 
     | 
    
         
            +
                    var match = line.match(/^(\s+)/);
         
     | 
| 
      
 308 
     | 
    
         
            +
                    if (match) {
         
     | 
| 
      
 309 
     | 
    
         
            +
                        return match[1];
         
     | 
| 
      
 310 
     | 
    
         
            +
                    }
         
     | 
| 
      
 311 
     | 
    
         
            +
             
     | 
| 
      
 312 
     | 
    
         
            +
                    return "";
         
     | 
| 
      
 313 
     | 
    
         
            +
                };
         
     | 
| 
      
 314 
     | 
    
         
            +
             
     | 
| 
      
 315 
     | 
    
         
            +
            }).call(MatchingBraceOutdent.prototype);
         
     | 
| 
      
 316 
     | 
    
         
            +
             
     | 
| 
      
 317 
     | 
    
         
            +
            exports.MatchingBraceOutdent = MatchingBraceOutdent;
         
     | 
| 
      
 318 
     | 
    
         
            +
            });
         
     |