Imported Upstream version 1.3 upstream/1.3
authorJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:14:13 +0000 (12:14 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:14:13 +0000 (12:14 +0900)
79 files changed:
AUTHORS
CHANGES
MANIFEST.in
PKG-INFO
Pygments.egg-info/PKG-INFO
Pygments.egg-info/SOURCES.txt
Pygments.egg-info/entry_points.txt [new file with mode: 0644]
docs/build/api.html
docs/build/authors.html
docs/build/changelog.html
docs/build/cmdline.html
docs/build/filterdevelopment.html
docs/build/filters.html
docs/build/formatterdevelopment.html
docs/build/formatters.html
docs/build/index.html
docs/build/installation.html
docs/build/integrate.html
docs/build/lexerdevelopment.html
docs/build/lexers.html
docs/build/moinmoin.html
docs/build/plugins.html
docs/build/quickstart.html
docs/build/rstdirective.html
docs/build/styles.html
docs/build/tokens.html
docs/build/unicode.html
docs/src/integrate.txt
external/pygments.bashcomp [new file with mode: 0644]
pygmentize [deleted file]
pygments/__init__.py
pygments/filters/__init__.py
pygments/formatters/__init__.py
pygments/formatters/html.py
pygments/lexer.py
pygments/lexers/__init__.py
pygments/lexers/_mapping.py
pygments/lexers/agile.py
pygments/lexers/asm.py
pygments/lexers/compiled.py
pygments/lexers/functional.py
pygments/lexers/math.py
pygments/lexers/other.py
pygments/lexers/parsers.py
pygments/lexers/templates.py
pygments/lexers/text.py
pygments/lexers/web.py
pygments/token.py
pygments/util.py
scripts/find_error.py [changed mode: 0644->0755]
setup.py
tests/examplefiles/CPDictionary.j [new file with mode: 0755]
tests/examplefiles/OrderedMap.hx [new file with mode: 0644]
tests/examplefiles/Sorting.mod [new file with mode: 0644]
tests/examplefiles/aspx-cs_example [new file with mode: 0644]
tests/examplefiles/demo.cfm [new file with mode: 0644]
tests/examplefiles/example.aspx [deleted file]
tests/examplefiles/example.xml [deleted file]
tests/examplefiles/r-console-transcript.Rout [new file with mode: 0644]
tests/examplefiles/test.adb [new file with mode: 0644]
tests/examplefiles/test.flx [new file with mode: 0644]
tests/examplefiles/test.mod [new file with mode: 0644]
tests/examplefiles/test.php
tests/examplefiles/underscore.coffee [new file with mode: 0644]
tests/examplefiles/xml_example [new file with mode: 0644]
tests/support.pyc [deleted file]
tests/test_basic_api.py
tests/test_basic_api.pyc [deleted file]
tests/test_clexer.pyc [deleted file]
tests/test_cmdline.pyc [deleted file]
tests/test_examplefiles.py
tests/test_examplefiles.pyc [deleted file]
tests/test_html_formatter.py
tests/test_html_formatter.pyc [deleted file]
tests/test_latex_formatter.pyc [deleted file]
tests/test_regexlexer.pyc [deleted file]
tests/test_token.pyc [deleted file]
tests/test_using_api.pyc [deleted file]
tests/test_util.pyc [deleted file]

diff --git a/AUTHORS b/AUTHORS
index 34cc6bed69c339d8519267a0e46f8aa2de373c33..d102686a2cf1e82edcd78f43f88b461f53c06953 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,9 +8,11 @@ Other contributors, listed alphabetically, are:
 * Kumar Appaiah -- Debian control lexer
 * Ali Afshar -- image formatter
 * Andreas Amann -- AppleScript lexer
+* Jeremy Ashkenas -- CoffeeScript lexer
 * Stefan Matthias Aust -- Smalltalk lexer
 * Ben Bangert -- Mako lexers
 * Max Battcher -- Darcs patch lexer
+* Paul Baumgart, 280 North, Inc. -- Objective-J lexer
 * Michael Bayer -- Myghty lexers
 * Jarrett Billingsley -- MiniD lexer
 * Adam Blinkinsop -- Haskell, Redcode lexers
@@ -18,17 +20,21 @@ Other contributors, listed alphabetically, are:
 * Pierre Bourdon -- bugfixes
 * Christopher Creutzig -- MuPAD lexer
 * Pete Curry -- bugfixes
+* Owen Durni -- haXe lexer
 * Nick Efford -- Python 3 lexer
 * Artem Egorkine -- terminal256 formatter
 * Laurent Gautier -- R/S lexer
 * Krzysiek Goj -- Scala lexer
 * Matt Good -- Genshi, Cheetah lexers
+* Patrick Gotthardt -- PHP namespaces support
 * Olivier Guibe -- Asymptote lexer
 * Matthew Harrison -- SVG formatter
 * Steven Hazel -- Tcl lexer
 * Aslak Hellesøy -- Gherkin lexer
+* David Hess, Fish Software, Inc. -- Objective-J lexer
 * Varun Hiremath -- Debian control lexer
 * Dennis Kaarsemaker -- sources.list lexer
+* Benjamin Kowarsch -- Modula-2 lexer
 * Marek Kubica -- Scheme lexer
 * Jochen Kupperschmidt -- Markdown processor
 * Gerd Kurzbach -- Modelica lexer
@@ -37,7 +43,7 @@ Other contributors, listed alphabetically, are:
 * Kirk McDonald -- D lexer
 * Lukas Meuser -- BBCode formatter, Lua lexer
 * Paulo Moura -- Logtalk lexer
-* Ana Nelson -- Ragel, ANTLR lexers
+* Ana Nelson -- Ragel, ANTLR, R console lexers
 * Nam T. Nguyen -- Monokai style
 * Jesper Noehr -- HTML formatter "anchorlinenos"
 * Jonas Obrist -- BBCode lexer
@@ -50,13 +56,16 @@ Other contributors, listed alphabetically, are:
 * Mario Ruggier -- Evoque lexers
 * Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers
 * Matteo Sasso -- Common Lisp lexer
+* Joe Schafer -- Ada lexer
 * Ken Schutte -- Matlab lexers
 * Tassilo Schweyer -- Io, MOOCode lexers
 * Joerg Sieker -- ABAP lexer
 * Kirill Simonov -- YAML lexer
 * Tiberius Teng -- default style overhaul
 * Jeremy Thurgood -- Erlang, Squid config lexers
+* Erick Tryzelaar -- Felix lexer
 * Whitney Young -- ObjectiveC lexer
+* Nathan Weizenbaum -- Haml and Sass lexers
 * Dietmar Winkler -- Modelica lexer
 * Nils Winter -- Smalltalk lexer
 * Davy Wybiral -- Clojure lexer
diff --git a/CHANGES b/CHANGES
index b81efa0049460848162d9c9122ccd1296561fe02..59d8860ea5ef6e8578b7698c44c6e81c53c8df5b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,45 @@ Pygments changelog
 
 Issue numbers refer to the tracker at http://dev.pocoo.org/projects/pygments/.
 
+Version 1.3
+-----------
+(codename Schneeglöckchen, released Mar 01, 2010)
+
+- Added the ``ensurenl`` lexer option, which can be used to suppress the
+  automatic addition of a newline to the lexer input.
+
+- Lexers added:
+
+  * Ada
+  * Coldfusion
+  * Modula-2
+  * haXe
+  * R console
+  * Objective-J
+  * Haml and Sass
+  * CoffeeScript
+
+- Enhanced reStructuredText highlighting.
+
+- Added support for PHP 5.3 namespaces in the PHP lexer.
+
+- Added a bash completion script for `pygmentize`, to the external/
+  directory (#466).
+
+- Fixed a bug in `do_insertions()` used for multi-lexer languages.
+
+- Fixed a Ruby regex highlighting bug (#476).
+
+- Fixed regex highlighting bugs in Perl lexer (#258).
+
+- Add small enhancements to the C lexer (#467) and Bash lexer (#469).
+
+- Small fixes for the Tcl, Debian control file, Nginx config,
+  Smalltalk, Objective-C, Clojure, Lua lexers.
+
+- Gherkin lexer: Fixed single apostrophe bug and added new i18n keywords.
+
+
 Version 1.2.2
 -------------
 (bugfix release, released Jan 02, 2010)
@@ -33,7 +72,10 @@ Version 1.2
   * Go
   * Gherkin (Cucumber)
   * CMake
-  * OOC
+  * Ooc
+  * Coldfusion
+  * haXe
+  * R console
 
 - Added options for rendering LaTeX in source code comments in the
   LaTeX formatter (#461).
index 2a39ef4765f4357813c037d9ea0c57c03cdac0cc..8fa0dfe8fc3f7d886a32aeaca8f4b4bd3f52208b 100644 (file)
@@ -1,4 +1,4 @@
-include external/*.py
+include external/*
 include Makefile CHANGES LICENSE AUTHORS TODO ez_setup.py
 recursive-include tests *
 recursive-include docs *
index 98c415d3ae3a05cbffed783411cdbf497dbc5578..1c8da057f66a0fa07b5662d1cf3e63cbca770395 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: Pygments
-Version: 1.2.2
+Version: 1.3
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
index 98c415d3ae3a05cbffed783411cdbf497dbc5578..1c8da057f66a0fa07b5662d1cf3e63cbca770395 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: Pygments
-Version: 1.2.2
+Version: 1.3
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
index a885aaa553d6d97fc336376852e0249ab53c7f14..1e12c0296383471c5bbce0d77b8d45b649db4e0c 100644 (file)
@@ -5,12 +5,12 @@ MANIFEST.in
 Makefile
 TODO
 ez_setup.py
-pygmentize
 setup.cfg
 setup.py
 Pygments.egg-info/PKG-INFO
 Pygments.egg-info/SOURCES.txt
 Pygments.egg-info/dependency_links.txt
+Pygments.egg-info/entry_points.txt
 Pygments.egg-info/not-zip-safe
 Pygments.egg-info/top_level.txt
 docs/generate.py
@@ -57,6 +57,7 @@ docs/src/tokens.txt
 docs/src/unicode.txt
 external/markdown-processor.py
 external/moin-parser.py
+external/pygments.bashcomp
 external/rst-directive-old.py
 external/rst-directive.py
 pygments/__init__.py
@@ -133,27 +134,16 @@ scripts/vim2pygments.py
 tests/old_run.py
 tests/run.py
 tests/support.py
-tests/support.pyc
 tests/test_basic_api.py
-tests/test_basic_api.pyc
 tests/test_clexer.py
-tests/test_clexer.pyc
 tests/test_cmdline.py
-tests/test_cmdline.pyc
 tests/test_examplefiles.py
-tests/test_examplefiles.pyc
 tests/test_html_formatter.py
-tests/test_html_formatter.pyc
 tests/test_latex_formatter.py
-tests/test_latex_formatter.pyc
 tests/test_regexlexer.py
-tests/test_regexlexer.pyc
 tests/test_token.py
-tests/test_token.pyc
 tests/test_using_api.py
-tests/test_using_api.pyc
 tests/test_util.py
-tests/test_util.pyc
 tests/dtds/HTML4-f.dtd
 tests/dtds/HTML4-s.dtd
 tests/dtds/HTML4.dcl
@@ -164,19 +154,23 @@ tests/dtds/HTMLspec.ent
 tests/dtds/HTMLsym.ent
 tests/examplefiles/ANTLRv3.g
 tests/examplefiles/AlternatingGroup.mu
+tests/examplefiles/CPDictionary.j
 tests/examplefiles/Constants.mo
 tests/examplefiles/DancingSudoku.lhs
 tests/examplefiles/Errors.scala
 tests/examplefiles/Intro.java
 tests/examplefiles/Makefile
 tests/examplefiles/Object.st
+tests/examplefiles/OrderedMap.hx
 tests/examplefiles/RegexMatcher.ns2
 tests/examplefiles/SmallCheck.hs
+tests/examplefiles/Sorting.mod
 tests/examplefiles/Sudoku.lhs
 tests/examplefiles/apache2.conf
 tests/examplefiles/as3_test.as
 tests/examplefiles/as3_test2.as
 tests/examplefiles/as3_test3.as
+tests/examplefiles/aspx-cs_example
 tests/examplefiles/badcase.java
 tests/examplefiles/batchfile.bat
 tests/examplefiles/boot-9.scm
@@ -186,12 +180,12 @@ tests/examplefiles/classes.dylan
 tests/examplefiles/condensed_ruby.rb
 tests/examplefiles/database.pytb
 tests/examplefiles/de.MoinMoin.po
+tests/examplefiles/demo.cfm
 tests/examplefiles/django_sample.html+django
 tests/examplefiles/dwarf.cw
 tests/examplefiles/erl_session
 tests/examplefiles/escape_semicolon.clj
 tests/examplefiles/evil_regex.js
-tests/examplefiles/example.aspx
 tests/examplefiles/example.c
 tests/examplefiles/example.cpp
 tests/examplefiles/example.lua
@@ -202,7 +196,6 @@ tests/examplefiles/example.rhtml
 tests/examplefiles/example.sh-session
 tests/examplefiles/example.weechatlog
 tests/examplefiles/example.xhtml
-tests/examplefiles/example.xml
 tests/examplefiles/example.yaml
 tests/examplefiles/example2.aspx
 tests/examplefiles/firefox.mak
@@ -244,6 +237,7 @@ tests/examplefiles/pycon_test.pycon
 tests/examplefiles/pytb_test2.pytb
 tests/examplefiles/python25-bsd.mak
 tests/examplefiles/qsort.prolog
+tests/examplefiles/r-console-transcript.Rout
 tests/examplefiles/ragel-cpp_rlscan
 tests/examplefiles/ragel-cpp_snippet
 tests/examplefiles/regex.js
@@ -258,6 +252,7 @@ tests/examplefiles/sqlite3.sqlite3-console
 tests/examplefiles/squid.conf
 tests/examplefiles/string_delimiters.d
 tests/examplefiles/test.R
+tests/examplefiles/test.adb
 tests/examplefiles/test.asy
 tests/examplefiles/test.bas
 tests/examplefiles/test.boo
@@ -266,9 +261,11 @@ tests/examplefiles/test.css
 tests/examplefiles/test.d
 tests/examplefiles/test.erl
 tests/examplefiles/test.evoque
+tests/examplefiles/test.flx
 tests/examplefiles/test.html
 tests/examplefiles/test.java
 tests/examplefiles/test.jsp
+tests/examplefiles/test.mod
 tests/examplefiles/test.moo
 tests/examplefiles/test.myt
 tests/examplefiles/test.pas
@@ -281,6 +278,8 @@ tests/examplefiles/test.tcsh
 tests/examplefiles/test.xsl
 tests/examplefiles/truncated.pytb
 tests/examplefiles/type.lisp
+tests/examplefiles/underscore.coffee
 tests/examplefiles/unicode.applescript
 tests/examplefiles/while.pov
+tests/examplefiles/xml_example
 tests/examplefiles/zmlrpc.f90
\ No newline at end of file
diff --git a/Pygments.egg-info/entry_points.txt b/Pygments.egg-info/entry_points.txt
new file mode 100644 (file)
index 0000000..756d801
--- /dev/null
@@ -0,0 +1,3 @@
+[console_scripts]
+pygmentize = pygments.cmdline:main
+
index 4cf421754cf0e35b2124d3557d365fce0f91405d..3ca8e31e8662194c500fee88d165e4c9795cd88f 100644 (file)
@@ -453,6 +453,6 @@ or a tuple, it is returned as a list.</dd>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:10.979303
+<!-- generated on: 2010-03-01 21:18:22.940790
      file id: api -->
 </html>
\ No newline at end of file
index ae566e110f08ea00f40639d3111c35fab3d6bf4f..a2ce2758c9f010fef61386a3e793c872b5d99816 100644 (file)
@@ -217,9 +217,11 @@ div.toc h2 {
 <li>Kumar Appaiah -- Debian control lexer</li>
 <li>Ali Afshar -- image formatter</li>
 <li>Andreas Amann -- AppleScript lexer</li>
+<li>Jeremy Ashkenas -- CoffeeScript lexer</li>
 <li>Stefan Matthias Aust -- Smalltalk lexer</li>
 <li>Ben Bangert -- Mako lexers</li>
 <li>Max Battcher -- Darcs patch lexer</li>
+<li>Paul Baumgart, 280 North, Inc. -- Objective-J lexer</li>
 <li>Michael Bayer -- Myghty lexers</li>
 <li>Jarrett Billingsley -- MiniD lexer</li>
 <li>Adam Blinkinsop -- Haskell, Redcode lexers</li>
@@ -227,17 +229,21 @@ div.toc h2 {
 <li>Pierre Bourdon -- bugfixes</li>
 <li>Christopher Creutzig -- MuPAD lexer</li>
 <li>Pete Curry -- bugfixes</li>
+<li>Owen Durni -- haXe lexer</li>
 <li>Nick Efford -- Python 3 lexer</li>
 <li>Artem Egorkine -- terminal256 formatter</li>
 <li>Laurent Gautier -- R/S lexer</li>
 <li>Krzysiek Goj -- Scala lexer</li>
 <li>Matt Good -- Genshi, Cheetah lexers</li>
+<li>Patrick Gotthardt -- PHP namespaces support</li>
 <li>Olivier Guibe -- Asymptote lexer</li>
 <li>Matthew Harrison -- SVG formatter</li>
 <li>Steven Hazel -- Tcl lexer</li>
 <li>Aslak Hellesøy -- Gherkin lexer</li>
+<li>David Hess, Fish Software, Inc. -- Objective-J lexer</li>
 <li>Varun Hiremath -- Debian control lexer</li>
 <li>Dennis Kaarsemaker -- sources.list lexer</li>
+<li>Benjamin Kowarsch -- Modula-2 lexer</li>
 <li>Marek Kubica -- Scheme lexer</li>
 <li>Jochen Kupperschmidt -- Markdown processor</li>
 <li>Gerd Kurzbach -- Modelica lexer</li>
@@ -246,7 +252,7 @@ div.toc h2 {
 <li>Kirk McDonald -- D lexer</li>
 <li>Lukas Meuser -- BBCode formatter, Lua lexer</li>
 <li>Paulo Moura -- Logtalk lexer</li>
-<li>Ana Nelson -- Ragel, ANTLR lexers</li>
+<li>Ana Nelson -- Ragel, ANTLR, R console lexers</li>
 <li>Nam T. Nguyen -- Monokai style</li>
 <li>Jesper Noehr -- HTML formatter &quot;anchorlinenos&quot;</li>
 <li>Jonas Obrist -- BBCode lexer</li>
@@ -259,13 +265,16 @@ div.toc h2 {
 <li>Mario Ruggier -- Evoque lexers</li>
 <li>Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers</li>
 <li>Matteo Sasso -- Common Lisp lexer</li>
+<li>Joe Schafer -- Ada lexer</li>
 <li>Ken Schutte -- Matlab lexers</li>
 <li>Tassilo Schweyer -- Io, MOOCode lexers</li>
 <li>Joerg Sieker -- ABAP lexer</li>
 <li>Kirill Simonov -- YAML lexer</li>
 <li>Tiberius Teng -- default style overhaul</li>
 <li>Jeremy Thurgood -- Erlang, Squid config lexers</li>
+<li>Erick Tryzelaar -- Felix lexer</li>
 <li>Whitney Young -- ObjectiveC lexer</li>
+<li>Nathan Weizenbaum -- Haml and Sass lexers</li>
 <li>Dietmar Winkler -- Modelica lexer</li>
 <li>Nils Winter -- Smalltalk lexer</li>
 <li>Davy Wybiral -- Clojure lexer</li>
@@ -274,6 +283,6 @@ div.toc h2 {
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:11.616011
+<!-- generated on: 2010-03-01 21:18:22.057737
      file id: authors -->
 </html>
\ No newline at end of file
index 6e38a8b931f0f52aa16fc2cf666e9e7bad4b1268..01777583ca95cf6589b3bc33c9669729c3eaec35 100644 (file)
@@ -213,6 +213,8 @@ div.toc h2 {
         <h2>Contents</h2>
         <ul class="contents">
         
+          <li><a href="#version-1-3">Version 1.3</a></li>
+        
           <li><a href="#version-1-2-2">Version 1.2.2</a></li>
         
           <li><a href="#version-1-2-1">Version 1.2.1</a></li>
@@ -251,6 +253,36 @@ div.toc h2 {
       </div>
     
     <p>Issue numbers refer to the tracker at <a class="reference external" href="http://dev.pocoo.org/projects/pygments/">http://dev.pocoo.org/projects/pygments/</a>.</p>
+<div class="section" id="version-1-3">
+<h3>Version 1.3</h3>
+<p>(codename Schneeglöckchen, released Mar 01, 2010)</p>
+<ul class="simple">
+<li>Added the <tt class="docutils literal">ensurenl</tt> lexer option, which can be used to suppress the
+automatic addition of a newline to the lexer input.</li>
+<li>Lexers added:<ul>
+<li>Ada</li>
+<li>Coldfusion</li>
+<li>Modula-2</li>
+<li>haXe</li>
+<li>R console</li>
+<li>Objective-J</li>
+<li>Haml and Sass</li>
+<li>CoffeeScript</li>
+</ul>
+</li>
+<li>Enhanced reStructuredText highlighting.</li>
+<li>Added support for PHP 5.3 namespaces in the PHP lexer.</li>
+<li>Added a bash completion script for <cite>pygmentize</cite>, to the external/
+directory (#466).</li>
+<li>Fixed a bug in <cite>do_insertions()</cite> used for multi-lexer languages.</li>
+<li>Fixed a Ruby regex highlighting bug (#476).</li>
+<li>Fixed regex highlighting bugs in Perl lexer (#258).</li>
+<li>Add small enhancements to the C lexer (#467) and Bash lexer (#469).</li>
+<li>Small fixes for the Tcl, Debian control file, Nginx config,
+Smalltalk, Objective-C, Clojure, Lua lexers.</li>
+<li>Gherkin lexer: Fixed single apostrophe bug and added new i18n keywords.</li>
+</ul>
+</div>
 <div class="section" id="version-1-2-2">
 <h3>Version 1.2.2</h3>
 <p>(bugfix release, released Jan 02, 2010)</p>
@@ -278,7 +310,10 @@ console traceback, resulting in clobbered output.</li>
 <li>Go</li>
 <li>Gherkin (Cucumber)</li>
 <li>CMake</li>
-<li>OOC</li>
+<li>Ooc</li>
+<li>Coldfusion</li>
+<li>haXe</li>
+<li>R console</li>
 </ul>
 </li>
 <li>Added options for rendering LaTeX in source code comments in the
@@ -702,6 +737,6 @@ continuations.</li>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:11.743625
+<!-- generated on: 2010-03-01 21:18:21.373497
      file id: changelog -->
 </html>
\ No newline at end of file
index e382e6da0c99dff00779fbd48e2464f707da8708..6db3dd617607eb212095a1ff6fe2c54e9801cc69 100644 (file)
@@ -348,6 +348,6 @@ formatter is the terminal encoding (<cite>sys.stdout.encoding</cite>).</li>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:12.317732
+<!-- generated on: 2010-03-01 21:18:20.444981
      file id: cmdline -->
 </html>
\ No newline at end of file
index 97ba876f82c368c583e305f87559124aadd8635d..f6de0c3b561fbaa2ba0897d98caad0767c15dcf1 100644 (file)
@@ -277,6 +277,6 @@ decorated function for filtering.</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:12.447556
+<!-- generated on: 2010-03-01 21:18:23.568890
      file id: filterdevelopment -->
 </html>
\ No newline at end of file
index a05e4b04e79387d9fa2c68b4bfb74a4d3cbe9b2a..e370f46f22fc0a4c8a7f578e08a65b94e8893843 100644 (file)
@@ -407,6 +407,6 @@ code to your styleguide.</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:12.534561
+<!-- generated on: 2010-03-01 21:18:21.142721
      file id: filters -->
 </html>
\ No newline at end of file
index cc4e9cb775ddd6ea1be2c391362bb470ca25e258..8a272460fd304941ef1751fb060ff1ec5b44bff8 100644 (file)
@@ -369,6 +369,6 @@ is up to the formatter) and has to return a string or <tt class="docutils litera
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:12.749801
+<!-- generated on: 2010-03-01 21:18:23.141347
      file id: formatterdevelopment -->
 </html>
\ No newline at end of file
index 478ee7915720c4a975e09be88c37d42cb9ac496f..b51578d1905d62292c304ef87b753f658da95c6e 100644 (file)
@@ -903,6 +903,6 @@ no support for common styles.</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:12.903585
+<!-- generated on: 2010-03-01 21:18:22.349606
      file id: formatters -->
 </html>
\ No newline at end of file
index 4a19e0cb51a7a670458da34b08ad7e688429f50e..ec386e8280049172a99fedbfb04816ee0c0693f6 100644 (file)
@@ -256,6 +256,6 @@ look <a class="reference external" href="http://pygments.org/contribute/">here</
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:13.756054
+<!-- generated on: 2010-03-01 21:18:22.245954
      file id: index -->
 </html>
\ No newline at end of file
index 815263c8ece0dd45963f8cbd9e51eb1473e777fb..e7ef9c47861fdac5924ea13a3597fb8167602297 100644 (file)
@@ -276,6 +276,6 @@ is run, the sources are updated from Subversion. -->
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:13.891713
+<!-- generated on: 2010-03-01 21:18:16.987157
      file id: installation -->
 </html>
\ No newline at end of file
index 903d7616dcdde11007ae3a5ffb110c986492d675..06773ec57f8012b745f5993a90250f0f540284e1 100644 (file)
@@ -221,6 +221,8 @@ div.toc h2 {
         
           <li><a href="#textmate">TextMate</a></li>
         
+          <li><a href="#bash-completion">Bash completion</a></li>
+        
         </ul>
       </div>
     
@@ -246,10 +248,15 @@ You can copy and adapt it to your liking.</p>
 <h3>TextMate</h3>
 <p>Antonio Cangiano has created a Pygments bundle for TextMate that allows to
 colorize code via a simple menu option.  It can be found <a class="reference external" href="http://antoniocangiano.com/2008/10/28/pygments-textmate-bundle/">here</a>.</p>
+</div>
+<div class="section" id="bash-completion">
+<h3>Bash completion</h3>
+<p>The source distribution contains a file <tt class="docutils literal">external/pygments.bashcomp</tt> that
+sets up completion for the <tt class="docutils literal">pygmentize</tt> command in bash.</p>
 </div>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:14.068980
+<!-- generated on: 2010-03-01 21:18:22.168270
      file id: integrate -->
 </html>
\ No newline at end of file
index 7602ec349932ffe9530d5412d7c3bfe44b0e1990..c7d52079949a4decad88871365e0694c905d4d18 100644 (file)
@@ -686,6 +686,6 @@ the <tt class="docutils literal">get_tokens_unprocessed()</tt> method. The follo
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:14.208796
+<!-- generated on: 2010-03-01 21:18:20.659342
      file id: lexerdevelopment -->
 </html>
\ No newline at end of file
index 70627a14a368b25c9ca9a6412bb5807d43357878..84c55e8a352e56e84b1e5fe2cfadd76e61a7be42 100644 (file)
@@ -442,7 +442,7 @@ language) source.</p>
 <tbody valign="top">
 <tr class="field"><th class="field-name">Short names:</th><td class="field-body">python, py</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.py, *.pyw, *.sc, SConstruct, SConscript</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.py, *.pyw, *.sc, SConstruct, SConscript, *.tac</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-python, application/x-python</td>
 </tr>
@@ -639,6 +639,23 @@ language) source.</p>
 </div>
 <div class="section" id="lexers-for-compiled-languages">
 <h3>Lexers for compiled languages</h3>
+<p><cite>AdaLexer</cite></p>
+<blockquote>
+<p>For Ada source code.</p>
+<p><em>New in Pygments 1.3.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">ada, ada95ada2005</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.adb, *.ads, *.ada</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-ada</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>CLexer</cite></p>
 <blockquote>
 <p>For C source code with preprocessor directives.</p>
@@ -752,6 +769,23 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>FelixLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://www.felix-lang.org">Felix</a> source code.</p>
+<p><em>New in Pygments 1.2.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">felix, flx</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.flx, *.flxh</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-felix</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>FortranLexer</cite></p>
 <blockquote>
 <p>Lexer for FORTRAN 90 code.</p>
@@ -818,6 +852,34 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>Modula2Lexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://www.modula2.org/">Modula-2</a> source code.</p>
+<p>Additional options that determine which keywords are highlighted:</p>
+<dl class="docutils">
+<dt><cite>pim</cite></dt>
+<dd>Select PIM Modula-2 dialect (default: True).</dd>
+<dt><cite>iso</cite></dt>
+<dd>Select ISO Modula-2 dialect (default: False).</dd>
+<dt><cite>objm2</cite></dt>
+<dd>Select Objective Modula-2 dialect (default: False).</dd>
+<dt><cite>gm2ext</cite></dt>
+<dd>Also highlight GNU extensions (default: False).</dd>
+</dl>
+<p><em>New in Pygments 1.3.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">modula2, m2</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.def, *.mod</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-modula2</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>ObjectiveCLexer</cite></p>
 <blockquote>
 <p>For Objective-C source code with preprocessor directives.</p>
@@ -1214,6 +1276,22 @@ Contributed by Christopher Creutzig &lt;<a class="reference external" href="mail
 </tbody>
 </table>
 </blockquote>
+<p><cite>RConsoleLexer</cite></p>
+<blockquote>
+<p>For R console transcripts or R CMD BATCH output files.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">rconsole, rout</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.Rout</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">None</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>SLexer</cite></p>
 <blockquote>
 <p>For S, S-plus, and R source code.</p>
@@ -1277,7 +1355,7 @@ Contributed by Andreas Amann &lt;<a class="reference external" href="mailto:aama
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field"><th class="field-name">Short names:</th><td class="field-body">asy</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">asy, asymptote</td>
 </tr>
 <tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.asy</td>
 </tr>
@@ -1288,15 +1366,15 @@ Contributed by Andreas Amann &lt;<a class="reference external" href="mailto:aama
 </blockquote>
 <p><cite>BashLexer</cite></p>
 <blockquote>
-<p>Lexer for (ba)sh shell scripts.</p>
+<p>Lexer for (ba|k|)sh shell scripts.</p>
 <p><em>New in Pygments 0.6.</em></p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
 <tbody valign="top">
-<tr class="field"><th class="field-name">Short names:</th><td class="field-body">bash, sh</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">bash, sh, ksh</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sh, *.ebuild, *.eclass</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sh, *.ksh, *.bash, *.ebuild, *.eclass</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-sh, application/x-shellscript</td>
 </tr>
@@ -2025,6 +2103,38 @@ with the <cite>XmlLexer</cite>.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>ColdfusionHtmlLexer</cite></p>
+<blockquote>
+<p>Coldfusion markup in html</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">cfm</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.cfm, *.cfml, *.cfc</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-coldfusion</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>ColdfusionLexer</cite></p>
+<blockquote>
+<p>Coldfusion statements</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">cfs</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">None</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">None</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>CssDjangoLexer</cite></p>
 <blockquote>
 <p>Subclass of the <cite>DjangoLexer</cite> that highlights unlexed data with the
@@ -3093,6 +3203,23 @@ language.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>CoffeeScriptLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> source code.</p>
+<p><em>New in Pygments 1.3.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">coffee-script, coffeescript</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.coffee</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/coffeescript</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>CssLexer</cite></p>
 <blockquote>
 <p>For CSS (Cascading Style Sheets).</p>
@@ -3109,6 +3236,39 @@ language.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>HamlLexer</cite></p>
+<blockquote>
+<p>For Haml markup.</p>
+<p><em>New in Pygments 1.3.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">haml, HAML</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.haml</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-haml</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>HaxeLexer</cite></p>
+<blockquote>
+<p>For haXe source code (<a class="reference external" href="http://haxe.org/">http://haxe.org/</a>).</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">hx, haXe</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.hx</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/haxe</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>HtmlLexer</cite></p>
 <blockquote>
 <p>For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted
@@ -3159,6 +3319,23 @@ Nested AS3 in &lt;script&gt; tags is highlighted by the appropriate lexer.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>ObjectiveJLexer</cite></p>
+<blockquote>
+<p>For Objective-J source code with preprocessor directives.</p>
+<p><em>New in Pygments 1.3.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">objective-j, objectivej, obj-j, objj</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.j</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-objective-j</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>PhpLexer</cite></p>
 <blockquote>
 <p>For <a class="reference external" href="http://www.php.net/">PHP</a> source code.
@@ -3200,6 +3377,23 @@ the php documentation.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>SassLexer</cite></p>
+<blockquote>
+<p>For Sass stylesheets.</p>
+<p><em>New in Pygments 1.3.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">sass, SASS</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sass</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-sass</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>XmlLexer</cite></p>
 <blockquote>
 <p>Generic lexer for XML (eXtensible Markup Language).</p>
@@ -3255,6 +3449,6 @@ in the form <tt class="docutils literal">(name, aliases, filetypes, mimetypes)</
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:14.909677
+<!-- generated on: 2010-03-01 21:18:17.323492
      file id: lexers -->
 </html>
\ No newline at end of file
index 007e1257a3edcd99cc651efdea1422c258151bf1..6f3e3c23f9afafe6eb9670e1cec20e478eaad799 100644 (file)
@@ -240,6 +240,6 @@ can set the <tt class="docutils literal">INLINESTYLES</tt> option to True.</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:19.009047
+<!-- generated on: 2010-03-01 21:18:20.345639
      file id: moinmoin -->
 </html>
\ No newline at end of file
index ed7484b043e39dcc2c77667ea4a12672ba7ba4f7..95641ad141863c79f8ca9660504a8aac812a8551 100644 (file)
@@ -289,6 +289,6 @@ distribution.</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:19.167617
+<!-- generated on: 2010-03-01 21:18:20.160548
      file id: plugins -->
 </html>
\ No newline at end of file
index 64cc0f0585b33bb2d9a98ff4eb7e68d1d84608ca..92e3a751cc57310d896d798a37d38e94a765d3e5 100644 (file)
@@ -385,6 +385,6 @@ $ pygmentize -S default -f html &gt; style.css
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:19.352414
+<!-- generated on: 2010-03-01 21:18:21.849281
      file id: quickstart -->
 </html>
\ No newline at end of file
index d7edf6b0e38a7cdcb6ac6a717bc0b5a479d8dfb2..bbec08f0b7a9495d7b4ba8d833cbc3b834a69c44 100644 (file)
@@ -224,6 +224,6 @@ if the `handlecodeblocks` option is true. -->
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:19.532040
+<!-- generated on: 2010-03-01 21:18:21.337328
      file id: rstdirective -->
 </html>
\ No newline at end of file
index 059f90c209c781cb1f79be9db0610495b01d6263..ee224efa6b75208e90b582201976149893c72a5f 100644 (file)
@@ -336,6 +336,6 @@ a way to iterate over all styles:</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:19.589769
+<!-- generated on: 2010-03-01 21:18:23.630305
      file id: styles -->
 </html>
\ No newline at end of file
index a8c048302071b1a211be3c5e4590bc99928b27e0..4290e09c7485847679a1d9e990d5986b5b613f7d 100644 (file)
@@ -536,6 +536,6 @@ highlight a programming language but a patch file.</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:19.766835
+<!-- generated on: 2010-03-01 21:18:23.269356
      file id: tokens -->
 </html>
\ No newline at end of file
index 0cb8f52a4e8383c14261e3a56c4c5b4fd1ec71a9..7a09e8b5d4bfe6827fc0ead3c8393b4d2f1e248d 100644 (file)
@@ -244,6 +244,6 @@ input and output encodings.</p>
 
   </div>
 </body>
-<!-- generated on: 2010-01-02 22:27:20.165454
+<!-- generated on: 2010-03-01 21:18:22.880164
      file id: unicode -->
 </html>
\ No newline at end of file
index fb3fa5a015d81b0679675e07f7a4969e793e47f2..51a3dac456c9940a1b076423e98dbe2565bf20d2 100644 (file)
@@ -35,3 +35,9 @@ Antonio Cangiano has created a Pygments bundle for TextMate that allows to
 colorize code via a simple menu option.  It can be found here_.
 
 .. _here: http://antoniocangiano.com/2008/10/28/pygments-textmate-bundle/
+
+Bash completion
+---------------
+
+The source distribution contains a file ``external/pygments.bashcomp`` that
+sets up completion for the ``pygmentize`` command in bash.
diff --git a/external/pygments.bashcomp b/external/pygments.bashcomp
new file mode 100644 (file)
index 0000000..1299fdb
--- /dev/null
@@ -0,0 +1,38 @@
+#!bash
+#
+# Bash completion support for Pygments (the 'pygmentize' command).
+#
+
+_pygmentize()
+{
+    local cur prev
+
+    COMPREPLY=()
+    cur=`_get_cword`
+    prev=${COMP_WORDS[COMP_CWORD-1]}
+
+    case "$prev" in
+        -f)
+            FORMATTERS=`pygmentize -L formatters | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'` 
+            COMPREPLY=( $( compgen -W '$FORMATTERS' -- "$cur" ) )
+            return 0
+            ;;
+        -l)
+            LEXERS=`pygmentize -L lexers | grep '* ' | cut -c3- | sed -e 's/,//g' -e 's/:$//'` 
+            COMPREPLY=( $( compgen -W '$LEXERS' -- "$cur" ) )
+            return 0
+            ;;
+        -S)
+            STYLES=`pygmentize -L styles | grep '* ' | cut -c3- | sed s/:$//`
+            COMPREPLY=( $( compgen -W '$STYLES' -- "$cur" ) )
+            return 0
+            ;;
+    esac
+
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '-f -l -S -L -g -O -P -F \
+                                   -N -H -h -V -o' -- "$cur" ) )
+        return 0
+    fi
+}
+complete -F _pygmentize -o default pygmentize
diff --git a/pygmentize b/pygmentize
deleted file mode 100755 (executable)
index e237919..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env python
-
-import sys, pygments.cmdline
-try:
-    sys.exit(pygments.cmdline.main(sys.argv))
-except KeyboardInterrupt:
-    sys.exit(1)
index ff17af4faa544d84907232bc2a4e5dfd231c5714..823862e32191ef5f01be60fbfc1f37c529ecfdc2 100644 (file)
     :license: BSD, see LICENSE for details.
 """
 
-__version__ = '1.2.2'
+__version__ = '1.3'
 __docformat__ = 'restructuredtext'
 
 __all__ = ['lex', 'format', 'highlight']
 
 
-import sys, os
+import sys
 
 from pygments.util import StringIO, BytesIO
 
index 382933b0adbdc2dc0ae37573c2de07ea1632d72b..504c3e1e47f17d3c03b63b9c64f79cb44c5974dd 100644 (file)
@@ -9,17 +9,14 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 import re
+
 from pygments.token import String, Comment, Keyword, Name, Error, Whitespace, \
     string_to_tokentype
 from pygments.filter import Filter
-from pygments.util import get_list_opt, get_int_opt, get_bool_opt, get_choice_opt, \
-     ClassNotFound, OptionError
+from pygments.util import get_list_opt, get_int_opt, get_bool_opt, \
+     get_choice_opt, ClassNotFound, OptionError
 from pygments.plugin import find_plugin_filters
 
 
index e5802b9925bf0ad1fb15ddc70a78f2d45f9a35a9..0e02a522b082082d89f30f41e0099edd0520feee 100644 (file)
@@ -13,7 +13,7 @@ import fnmatch
 
 from pygments.formatters._mapping import FORMATTERS
 from pygments.plugin import find_plugin_formatters
-from pygments.util import docstring_headline, ClassNotFound
+from pygments.util import ClassNotFound
 
 ns = globals()
 for fcls in FORMATTERS:
index 96cde3fb04111dc318296ec4ee9b692bb6028792..5c0972e3d1022b8f3d98b92117538fb274b644dc 100644 (file)
@@ -8,13 +8,10 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
-import sys, os
-import StringIO
 
-try:
-    set
-except NameError:
-    from sets import Set as set
+import os
+import sys
+import StringIO
 
 from pygments.formatter import Formatter
 from pygments.token import Token, Text, STANDARD_TYPES
index f28627b3a2e159f8d56a399794a24b569d676d3d..fbcc39a65d93f9876c4f229647a768e0f659c9c5 100644 (file)
 """
 import re
 
-try:
-    set
-except NameError:
-    from sets import Set as set
-
 from pygments.filter import apply_filters, Filter
 from pygments.filters import get_filter_by_name
 from pygments.token import Error, Text, Other, _TokenType
@@ -23,7 +18,7 @@ from pygments.util import get_bool_opt, get_int_opt, get_list_opt, \
 
 
 __all__ = ['Lexer', 'RegexLexer', 'ExtendedRegexLexer', 'DelegatingLexer',
-           'LexerContext', 'include', 'flags', 'bygroups', 'using', 'this']
+           'LexerContext', 'include', 'bygroups', 'using', 'this']
 
 
 _default_analyse = staticmethod(lambda x: 0.0)
@@ -51,6 +46,10 @@ class Lexer(object):
     ``stripall``
         Strip all leading and trailing whitespace from the input
         (default: False).
+    ``ensurenl``
+        Make sure that the input ends with a newline (default: True).  This
+        is required for some lexers that consume input linewise.
+        *New in Pygments 1.3.*
     ``tabsize``
         If given and greater than 0, expand tabs in the input (default: 0).
     ``encoding``
@@ -82,6 +81,7 @@ class Lexer(object):
         self.options = options
         self.stripnl = get_bool_opt(options, 'stripnl', True)
         self.stripall = get_bool_opt(options, 'stripall', False)
+        self.ensurenl = get_bool_opt(options, 'ensurenl', True)
         self.tabsize = get_int_opt(options, 'tabsize', 0)
         self.encoding = options.get('encoding', 'latin1')
         # self.encoding = options.get('inencoding', None) or self.encoding
@@ -155,7 +155,7 @@ class Lexer(object):
             text = text.strip('\n')
         if self.tabsize > 0:
             text = text.expandtabs(self.tabsize)
-        if not text.endswith('\n'):
+        if self.ensurenl and not text.endswith('\n'):
             text += '\n'
 
         def streamer():
@@ -646,9 +646,15 @@ def do_insertions(insertions, tokens):
         realpos += len(v) - oldi
 
     # leftover tokens
-    if insleft:
+    while insleft:
         # no normal tokens, set realpos to zero
         realpos = realpos or 0
         for p, t, v in itokens:
             yield realpos, t, v
             realpos += len(v)
+        try:
+            index, itokens = insertions.next()
+        except StopIteration:
+            insleft = False
+            break  # not strictly necessary
+
index c1890a907fdc297a08582f3fce2f5b6b17aa7d13..cce7e9b615201afc53ce3f497c40ce0b2c9576d0 100644 (file)
@@ -8,16 +8,12 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
+
 import sys
-import fnmatch
 import types
+import fnmatch
 from os.path import basename
 
-try:
-    set
-except NameError:
-    from sets import Set as set
-
 from pygments.lexers._mapping import LEXERS
 from pygments.plugin import find_plugin_lexers
 from pygments.util import ClassNotFound, bytes
@@ -223,7 +219,6 @@ class _automodule(types.ModuleType):
         raise AttributeError(name)
 
 
-import sys
 oldmod = sys.modules['pygments.lexers']
 newmod = _automodule('pygments.lexers')
 newmod.__dict__.update(oldmod.__dict__)
index 7e06831cf9ca8cd2b71e301227b8add747dc9f12..cdaf56a175323d209e0b2a2ffcfaf4e3ea54ca71 100644 (file)
@@ -17,6 +17,7 @@ LEXERS = {
     'ABAPLexer': ('pygments.lexers.other', 'ABAP', ('abap',), ('*.abap',), ('text/x-abap',)),
     'ActionScript3Lexer': ('pygments.lexers.web', 'ActionScript 3', ('as3', 'actionscript3'), ('*.as',), ('application/x-actionscript', 'text/x-actionscript', 'text/actionscript')),
     'ActionScriptLexer': ('pygments.lexers.web', 'ActionScript', ('as', 'actionscript'), ('*.as',), ('application/x-actionscript', 'text/x-actionscript', 'text/actionscript')),
+    'AdaLexer': ('pygments.lexers.compiled', 'Ada', ('ada', 'ada95ada2005'), ('*.adb', '*.ads', '*.ada'), ('text/x-ada',)),
     'AntlrActionScriptLexer': ('pygments.lexers.parsers', 'ANTLR With ActionScript Target', ('antlr-as', 'antlr-actionscript'), ('*.G', '*.g'), ()),
     'AntlrCSharpLexer': ('pygments.lexers.parsers', 'ANTLR With C# Target', ('antlr-csharp', 'antlr-c#'), ('*.G', '*.g'), ()),
     'AntlrCppLexer': ('pygments.lexers.parsers', 'ANTLR With CPP Target', ('antlr-cpp',), ('*.G', '*.g'), ()),
@@ -28,10 +29,10 @@ LEXERS = {
     'AntlrRubyLexer': ('pygments.lexers.parsers', 'ANTLR With Ruby Target', ('antlr-ruby', 'antlr-rb'), ('*.G', '*.g'), ()),
     'ApacheConfLexer': ('pygments.lexers.text', 'ApacheConf', ('apacheconf', 'aconf', 'apache'), ('.htaccess', 'apache.conf', 'apache2.conf'), ('text/x-apacheconf',)),
     'AppleScriptLexer': ('pygments.lexers.other', 'AppleScript', ('applescript',), ('*.applescript',), ()),
-    'AsymptoteLexer': ('pygments.lexers.other', 'Asymptote', ('asy',), ('*.asy',), ('text/x-asymptote',)),
+    'AsymptoteLexer': ('pygments.lexers.other', 'Asymptote', ('asy', 'asymptote'), ('*.asy',), ('text/x-asymptote',)),
     'BBCodeLexer': ('pygments.lexers.text', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)),
     'BaseMakefileLexer': ('pygments.lexers.text', 'Makefile', ('basemake',), (), ()),
-    'BashLexer': ('pygments.lexers.other', 'Bash', ('bash', 'sh'), ('*.sh', '*.ebuild', '*.eclass'), ('application/x-sh', 'application/x-shellscript')),
+    'BashLexer': ('pygments.lexers.other', 'Bash', ('bash', 'sh', 'ksh'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass'), ('application/x-sh', 'application/x-shellscript')),
     'BashSessionLexer': ('pygments.lexers.other', 'Bash Session', ('console',), ('*.sh-session',), ('application/x-shell-session',)),
     'BatchLexer': ('pygments.lexers.other', 'Batchfile', ('bat',), ('*.bat', '*.cmd'), ('application/x-dos-batch',)),
     'BefungeLexer': ('pygments.lexers.other', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)),
@@ -47,6 +48,9 @@ LEXERS = {
     'CheetahLexer': ('pygments.lexers.templates', 'Cheetah', ('cheetah', 'spitfire'), ('*.tmpl', '*.spt'), ('application/x-cheetah', 'application/x-spitfire')),
     'CheetahXmlLexer': ('pygments.lexers.templates', 'XML+Cheetah', ('xml+cheetah', 'xml+spitfire'), (), ('application/xml+cheetah', 'application/xml+spitfire')),
     'ClojureLexer': ('pygments.lexers.agile', 'Clojure', ('clojure', 'clj'), ('*.clj',), ('text/x-clojure', 'application/x-clojure')),
+    'CoffeeScriptLexer': ('pygments.lexers.web', 'CoffeeScript', ('coffee-script', 'coffeescript'), ('*.coffee',), ('text/coffeescript',)),
+    'ColdfusionHtmlLexer': ('pygments.lexers.templates', 'Coldufsion HTML', ('cfm',), ('*.cfm', '*.cfml', '*.cfc'), ('application/x-coldfusion',)),
+    'ColdfusionLexer': ('pygments.lexers.templates', 'cfstatement', ('cfs',), (), ()),
     'CommonLispLexer': ('pygments.lexers.functional', 'Common Lisp', ('common-lisp', 'cl'), ('*.cl', '*.lisp', '*.el'), ('text/x-common-lisp',)),
     'CppLexer': ('pygments.lexers.compiled', 'C++', ('cpp', 'c++'), ('*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx'), ('text/x-c++hdr', 'text/x-c++src')),
     'CppObjdumpLexer': ('pygments.lexers.asm', 'cpp-objdump', ('cpp-objdump', 'c++-objdumb', 'cxx-objdump'), ('*.cpp-objdump', '*.c++-objdump', '*.cxx-objdump'), ('text/x-cpp-objdump',)),
@@ -71,6 +75,7 @@ LEXERS = {
     'EvoqueHtmlLexer': ('pygments.lexers.templates', 'HTML+Evoque', ('html+evoque',), ('*.html',), ('text/html+evoque',)),
     'EvoqueLexer': ('pygments.lexers.templates', 'Evoque', ('evoque',), ('*.evoque',), ('application/x-evoque',)),
     'EvoqueXmlLexer': ('pygments.lexers.templates', 'XML+Evoque', ('xml+evoque',), ('*.xml',), ('application/xml+evoque',)),
+    'FelixLexer': ('pygments.lexers.compiled', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)),
     'FortranLexer': ('pygments.lexers.compiled', 'Fortran', ('fortran',), ('*.f', '*.f90'), ('text/x-fortran',)),
     'GLShaderLexer': ('pygments.lexers.compiled', 'GLSL', ('glsl',), ('*.vert', '*.frag', '*.geo'), ('text/x-glslsrc',)),
     'GasLexer': ('pygments.lexers.asm', 'GAS', ('gas',), ('*.s', '*.S'), ('text/x-gas',)),
@@ -81,7 +86,9 @@ LEXERS = {
     'GnuplotLexer': ('pygments.lexers.other', 'Gnuplot', ('gnuplot',), ('*.plot', '*.plt'), ('text/x-gnuplot',)),
     'GoLexer': ('pygments.lexers.compiled', 'Go', ('go',), ('*.go',), ('text/x-gosrc',)),
     'GroffLexer': ('pygments.lexers.text', 'Groff', ('groff', 'nroff', 'man'), ('*.[1234567]', '*.man'), ('application/x-troff', 'text/troff')),
+    'HamlLexer': ('pygments.lexers.web', 'Haml', ('haml', 'HAML'), ('*.haml',), ('text/x-haml',)),
     'HaskellLexer': ('pygments.lexers.functional', 'Haskell', ('haskell', 'hs'), ('*.hs',), ('text/x-haskell',)),
+    'HaxeLexer': ('pygments.lexers.web', 'haXe', ('hx', 'haXe'), ('*.hx',), ('text/haxe',)),
     'HtmlDjangoLexer': ('pygments.lexers.templates', 'HTML+Django/Jinja', ('html+django', 'html+jinja'), (), ('text/html+django', 'text/html+jinja')),
     'HtmlGenshiLexer': ('pygments.lexers.templates', 'HTML+Genshi', ('html+genshi', 'html+kid'), (), ('text/html+genshi',)),
     'HtmlLexer': ('pygments.lexers.web', 'HTML', ('html',), ('*.html', '*.htm', '*.xhtml', '*.xslt'), ('text/html', 'application/xhtml+xml')),
@@ -114,6 +121,7 @@ LEXERS = {
     'MatlabSessionLexer': ('pygments.lexers.math', 'Matlab session', ('matlabsession',), (), ()),
     'MiniDLexer': ('pygments.lexers.agile', 'MiniD', ('minid',), ('*.md',), ('text/x-minidsrc',)),
     'ModelicaLexer': ('pygments.lexers.other', 'Modelica', ('modelica',), ('*.mo',), ('text/x-modelica',)),
+    'Modula2Lexer': ('pygments.lexers.compiled', 'Modula-2', ('modula2', 'm2'), ('*.def', '*.mod'), ('text/x-modula2',)),
     'MoinWikiLexer': ('pygments.lexers.text', 'MoinMoin/Trac Wiki markup', ('trac-wiki', 'moin'), (), ('text/x-trac-wiki',)),
     'MuPADLexer': ('pygments.lexers.math', 'MuPAD', ('mupad',), ('*.mu',), ()),
     'MxmlLexer': ('pygments.lexers.web', 'MXML', ('mxml',), ('*.mxml',), ()),
@@ -129,6 +137,7 @@ LEXERS = {
     'NumPyLexer': ('pygments.lexers.math', 'NumPy', ('numpy',), (), ()),
     'ObjdumpLexer': ('pygments.lexers.asm', 'objdump', ('objdump',), ('*.objdump',), ('text/x-objdump',)),
     'ObjectiveCLexer': ('pygments.lexers.compiled', 'Objective-C', ('objective-c', 'objectivec', 'obj-c', 'objc'), ('*.m',), ('text/x-objective-c',)),
+    'ObjectiveJLexer': ('pygments.lexers.web', 'Objective-J', ('objective-j', 'objectivej', 'obj-j', 'objj'), ('*.j',), ('text/x-objective-j',)),
     'OcamlLexer': ('pygments.lexers.compiled', 'OCaml', ('ocaml',), ('*.ml', '*.mli', '*.mll', '*.mly'), ('text/x-ocaml',)),
     'OcamlLexer': ('pygments.lexers.functional', 'OCaml', ('ocaml',), ('*.ml', '*.mli', '*.mll', '*.mly'), ('text/x-ocaml',)),
     'OocLexer': ('pygments.lexers.compiled', 'Ooc', ('ooc',), ('*.ooc',), ('text/x-ooc',)),
@@ -139,8 +148,9 @@ LEXERS = {
     'Python3Lexer': ('pygments.lexers.agile', 'Python 3', ('python3', 'py3'), (), ('text/x-python3', 'application/x-python3')),
     'Python3TracebackLexer': ('pygments.lexers.agile', 'Python 3.0 Traceback', ('py3tb',), ('*.py3tb',), ('text/x-python3-traceback',)),
     'PythonConsoleLexer': ('pygments.lexers.agile', 'Python console session', ('pycon',), (), ('text/x-python-doctest',)),
-    'PythonLexer': ('pygments.lexers.agile', 'Python', ('python', 'py'), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript'), ('text/x-python', 'application/x-python')),
+    'PythonLexer': ('pygments.lexers.agile', 'Python', ('python', 'py'), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac'), ('text/x-python', 'application/x-python')),
     'PythonTracebackLexer': ('pygments.lexers.agile', 'Python Traceback', ('pytb',), ('*.pytb',), ('text/x-python-traceback',)),
+    'RConsoleLexer': ('pygments.lexers.math', 'RConsole', ('rconsole', 'rout'), ('*.Rout',), ()),
     'RagelCLexer': ('pygments.lexers.parsers', 'Ragel in C Host', ('ragel-c',), ('*.rl',), ()),
     'RagelCppLexer': ('pygments.lexers.parsers', 'Ragel in CPP Host', ('ragel-cpp',), ('*.rl',), ()),
     'RagelDLexer': ('pygments.lexers.parsers', 'Ragel in D Host', ('ragel-d',), ('*.rl',), ()),
@@ -157,6 +167,7 @@ LEXERS = {
     'RubyConsoleLexer': ('pygments.lexers.agile', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)),
     'RubyLexer': ('pygments.lexers.agile', 'Ruby', ('rb', 'ruby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx'), ('text/x-ruby', 'application/x-ruby')),
     'SLexer': ('pygments.lexers.math', 'S', ('splus', 's', 'r'), ('*.S', '*.R'), ('text/S-plus', 'text/S', 'text/R')),
+    'SassLexer': ('pygments.lexers.web', 'Sass', ('sass', 'SASS'), ('*.sass',), ('text/x-sass',)),
     'ScalaLexer': ('pygments.lexers.compiled', 'Scala', ('scala',), ('*.scala',), ('text/x-scala',)),
     'SchemeLexer': ('pygments.lexers.functional', 'Scheme', ('scheme', 'scm'), ('*.scm',), ('text/x-scheme', 'application/x-scheme')),
     'SmalltalkLexer': ('pygments.lexers.other', 'Smalltalk', ('smalltalk', 'squeak'), ('*.st',), ('text/x-smalltalk',)),
index dafed5c96fa6d5470b9a723c2528c6dcec52b412..bfaf0a68e2fdd0d7d56eea93a673fa2b754a586d 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
      LexerContext, include, combined, do_insertions, bygroups, using
@@ -41,7 +37,7 @@ class PythonLexer(RegexLexer):
 
     name = 'Python'
     aliases = ['python', 'py']
-    filenames = ['*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript']
+    filenames = ['*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac']
     mimetypes = ['text/x-python', 'application/x-python']
 
     tokens = {
@@ -659,7 +655,7 @@ class RubyLexer(ExtendedRegexLexer):
                  r'(?<=^match\s)|'
                  r'(?<=^if\s)|'
                  r'(?<=^elsif\s)'
-             r')(\s*)(/)(?!=)', bygroups(Text, String.Regex), 'multiline-regex'),
+             r')(\s*)(/)', bygroups(Text, String.Regex), 'multiline-regex'),
             # multiline regex (in method calls)
             (r'(?<=\(|,)/', String.Regex, 'multiline-regex'),
             # multiline regex (this time the funny no whitespace rule)
@@ -835,7 +831,6 @@ class PerlLexer(RegexLexer):
             (r'@(\\\\|\\\@|[^\@])*@[egimosx]*', String.Regex, '#pop'),
             (r'%(\\\\|\\\%|[^\%])*%[egimosx]*', String.Regex, '#pop'),
             (r'\$(\\\\|\\\$|[^\$])*\$[egimosx]*', String.Regex, '#pop'),
-            (r'!(\\\\|\\!|[^!])*![egimosx]*', String.Regex, '#pop'),
         ],
         'root': [
             (r'\#.*?$', Comment.Single),
@@ -859,6 +854,7 @@ class PerlLexer(RegexLexer):
             (r's\((\\\\|\\\)|[^\)])*\)\s*', String.Regex, 'balanced-regex'),
 
             (r'm?/(\\\\|\\/|[^/\n])*/[gcimosx]*', String.Regex),
+            (r'm(?=[/!\\{<\[\(@%\$])', String.Regex, 'balanced-regex'),
             (r'((?<==~)|(?<=\())\s*/(\\\\|\\/|[^/])*/[gcimosx]*', String.Regex),
             (r'\s+', Text),
             (r'(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|'
@@ -906,7 +902,7 @@ class PerlLexer(RegexLexer):
             (r'(q|qq|qw|qr|qx)\(', String.Other, 'rb-string'),
             (r'(q|qq|qw|qr|qx)\[', String.Other, 'sb-string'),
             (r'(q|qq|qw|qr|qx)\<', String.Other, 'lt-string'),
-            (r'(q|qq|qw|qr|qx)(.)[.\n]*?\1', String.Other),
+            (r'(q|qq|qw|qr|qx)([^a-zA-Z0-9])(.|\n)*?\2', String.Other),
             (r'package\s+', Keyword, 'modulename'),
             (r'sub\s+', Keyword, 'funcname'),
             (r'(\[\]|\*\*|::|<<|>>|>=|<=|<=>|={3}|!=|=~|'
@@ -970,7 +966,7 @@ class PerlLexer(RegexLexer):
             (r'\\', String.Other),
             (r'\<', String.Other, 'lt-string'),
             (r'\>', String.Other, '#pop'),
-            (r'[^\<\>]]+', String.Other)
+            (r'[^\<\>]+', String.Other)
         ],
         'end-part': [
             (r'.+', Comment.Preproc, '#pop')
@@ -1015,6 +1011,11 @@ class LuaLexer(RegexLexer):
 
     tokens = {
         'root': [
+            # lua allows a file to start with a shebang
+            (r'#!(.*?)$', Comment.Preproc),
+            (r'', Text, 'base'),
+        ],
+        'base': [
             (r'(?s)--\[(=*)\[.*?\]\1\]', Comment.Multiline),
             ('--.*$', Comment.Single),
 
@@ -1263,6 +1264,7 @@ class TclLexer(RegexLexer):
             include('command'),
             include('basic'),
             include('data'),
+            (r'}', Keyword),  # HACK: somehow we miscounted our braces
         ],
         'command': _gen_command_rules(keyword_cmds_re, builtin_cmds_re),
         'command-in-brace': _gen_command_rules(keyword_cmds_re,
@@ -1441,7 +1443,7 @@ class ClojureLexer(RegexLexer):
             # strings, symbols and characters
             (r'"(\\\\|\\"|[^"])*"', String),
             (r"'" + valid_name, String.Symbol),
-            (r"\\([()/'\".'_!§$%& ?;=+-]{1}|[a-zA-Z0-9]+)", String.Char),
+            (r"\\([()/'\".'_!§$%& ?;=#+-]{1}|[a-zA-Z0-9]+)", String.Char),
 
             # constants
             (r'(#t|#f)', Name.Constant),
index e574a59bd83ad33e12d830d45faa36a834d58062..4740569c698adcd0c7405bcadfee82f9651c2851 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingLexer
 from pygments.lexers.compiled import DLexer, CppLexer, CLexer
index e382a1b35d6b50835b45128d54286a0891e71e49..a2543e27366d92355c4eb1adeda7494b3383fdc0 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.scanner import Scanner
 from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
@@ -29,7 +25,8 @@ from pygments.lexers.functional import OcamlLexer
 __all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'JavaLexer',
            'ScalaLexer', 'DylanLexer', 'OcamlLexer', 'ObjectiveCLexer',
            'FortranLexer', 'GLShaderLexer', 'PrologLexer', 'CythonLexer',
-           'ValaLexer', 'OocLexer', 'GoLexer']
+           'ValaLexer', 'OocLexer', 'GoLexer', 'FelixLexer', 'AdaLexer',
+           'Modula2Lexer']
 
 
 class CLexer(RegexLexer):
@@ -63,6 +60,7 @@ class CLexer(RegexLexer):
             (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
             (r'0[0-7]+[Ll]?', Number.Oct),
             (r'\d+[Ll]?', Number.Integer),
+            (r'\*/', Error),
             (r'[~!%^&*+=|?:<>/-]', Operator),
             (r'[()\[\],.]', Punctuation),
             (r'\b(case)(.+?)(:)', bygroups(Keyword, using(this), Text)),
@@ -187,6 +185,7 @@ class CppLexer(RegexLexer):
             (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
             (r'0[0-7]+[Ll]?', Number.Oct),
             (r'\d+[Ll]?', Number.Integer),
+            (r'\*/', Error),
             (r'[~!%^&*+=|?:<>/-]', Operator),
             (r'[()\[\],.;]', Punctuation),
             (r'(asm|auto|break|case|catch|const|const_cast|continue|'
@@ -929,6 +928,7 @@ class JavaLexer(RegexLexer):
         ],
     }
 
+
 class ScalaLexer(RegexLexer):
     """
     For `Scala <http://www.scala-lang.org>`_ source code.
@@ -1122,14 +1122,14 @@ class ObjectiveCLexer(RegexLexer):
             (r'__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|'
              r'declspec|finally|int64|try|leave)\b', Keyword.Reserved),
             (r'(TRUE|FALSE|nil|NULL)\b', Name.Builtin),
-            ('[a-zA-Z_][a-zA-Z0-9_]*:(?!:)', Name.Label),
-            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            ('[a-zA-Z$_][a-zA-Z0-9$_]*:(?!:)', Name.Label),
+            ('[a-zA-Z$_][a-zA-Z0-9$_]*', Name),
         ],
         'root': [
             include('whitespace'),
             # functions
             (r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))'    # return arguments
-             r'([a-zA-Z_][a-zA-Z0-9_]*)'             # method name
+             r'([a-zA-Z$_][a-zA-Z0-9$_]*)'           # method name
              r'(\s*\([^;]*?\))'                      # signature
              r'(' + _ws + r')({)',
              bygroups(using(this), Name.Function,
@@ -1137,7 +1137,7 @@ class ObjectiveCLexer(RegexLexer):
              'function'),
             # function declarations
             (r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))'    # return arguments
-             r'([a-zA-Z_][a-zA-Z0-9_]*)'             # method name
+             r'([a-zA-Z$_][a-zA-Z0-9$_]*)'           # method name
              r'(\s*\([^;]*?\))'                      # signature
              r'(' + _ws + r')(;)',
              bygroups(using(this), Name.Function,
@@ -1151,18 +1151,18 @@ class ObjectiveCLexer(RegexLexer):
         ],
         'classname' : [
             # interface definition that inherits
-            ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*:\s*)([a-zA-Z_][a-zA-Z0-9_]*)?',
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*:\s*)([a-zA-Z$_][a-zA-Z0-9$_]*)?',
              bygroups(Name.Class, Text, Name.Class), '#pop'),
             # interface definition for a category
-            ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\([a-zA-Z_][a-zA-Z0-9_]*\))',
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*)(\([a-zA-Z$_][a-zA-Z0-9$_]*\))',
              bygroups(Name.Class, Text, Name.Label), '#pop'),
             # simple interface / implementation
-            ('([a-zA-Z_][a-zA-Z0-9_]*)', Name.Class, '#pop')
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)', Name.Class, '#pop')
         ],
         'forward_classname' : [
-          ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*,\s*)',
+          ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*,\s*)',
            bygroups(Name.Class, Text), 'forward_classname'),
-          ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*;?)',
+          ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*;?)',
            bygroups(Name.Class, Text), '#pop')
         ],
         'statement' : [
@@ -1790,3 +1790,576 @@ class GoLexer(RegexLexer):
             (r'[a-zA-Z_]\w*', Name),
         ]
     }
+
+
+class FelixLexer(RegexLexer):
+    """
+    For `Felix <http://www.felix-lang.org>`_ source code.
+
+    *New in Pygments 1.2.*
+    """
+
+    name = 'Felix'
+    aliases = ['felix', 'flx']
+    filenames = ['*.flx', '*.flxh']
+    mimetypes = ['text/x-felix']
+
+    preproc = [
+        'elif', 'else', 'endif', 'if', 'ifdef', 'ifndef',
+    ]
+
+    keywords = [
+        '_', '_deref', 'all', 'as',
+        'assert', 'attempt', 'call', 'callback', 'case', 'caseno', 'cclass',
+        'code', 'compound', 'ctypes', 'do', 'done', 'downto', 'elif', 'else',
+        'endattempt', 'endcase', 'endif', 'endmatch', 'enum', 'except',
+        'exceptions', 'expect', 'finally', 'for', 'forall', 'forget', 'fork',
+        'functor', 'goto', 'ident', 'if', 'incomplete', 'inherit', 'instance',
+        'interface', 'jump', 'lambda', 'loop', 'match', 'module', 'namespace',
+        'new', 'noexpand', 'nonterm', 'obj', 'of', 'open', 'parse', 'raise',
+        'regexp', 'reglex', 'regmatch', 'rename', 'return', 'the', 'then',
+        'to', 'type', 'typecase', 'typedef', 'typematch', 'typeof', 'upto',
+        'when', 'whilst', 'with', 'yield',
+    ]
+
+    keyword_directives = [
+        '_gc_pointer', '_gc_type', 'body', 'comment', 'const', 'export',
+        'header', 'inline', 'lval', 'macro', 'noinline', 'noreturn',
+        'package', 'private', 'pod', 'property', 'public', 'publish',
+        'requires', 'todo', 'virtual', 'use',
+    ]
+
+    keyword_declarations = [
+        'def', 'let', 'ref', 'val', 'var',
+    ]
+
+    keyword_types = [
+        'unit', 'void', 'any', 'bool',
+        'byte',  'offset',
+        'address', 'caddress', 'cvaddress', 'vaddress',
+        'tiny', 'short', 'int', 'long', 'vlong',
+        'utiny', 'ushort', 'vshort', 'uint', 'ulong', 'uvlong',
+        'int8', 'int16', 'int32', 'int64',
+        'uint8', 'uint16', 'uint32', 'uint64',
+        'float', 'double', 'ldouble',
+        'complex', 'dcomplex', 'lcomplex',
+        'imaginary', 'dimaginary', 'limaginary',
+        'char', 'wchar', 'uchar',
+        'charp', 'charcp', 'ucharp', 'ucharcp',
+        'string', 'wstring', 'ustring',
+        'cont',
+        'array', 'varray', 'list',
+        'lvalue', 'opt', 'slice',
+    ]
+
+    keyword_constants = [
+        'false', 'true',
+    ]
+
+    operator_words = [
+        'and', 'not', 'in', 'is', 'isin', 'or', 'xor',
+    ]
+
+    name_builtins = [
+        '_svc', 'while',
+    ]
+
+    name_pseudo = [
+        'root', 'self', 'this',
+    ]
+
+    decimal_suffixes = '([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?'
+
+    tokens = {
+        'root': [
+            include('whitespace'),
+
+            # Keywords
+            (r'(axiom|ctor|fun|gen|proc|reduce|union)\b', Keyword,
+             'funcname'),
+            (r'(class|cclass|cstruct|obj|struct)\b', Keyword, 'classname'),
+            (r'(instance|module|typeclass)\b', Keyword, 'modulename'),
+
+            (r'(%s)\b' % '|'.join(keywords), Keyword),
+            (r'(%s)\b' % '|'.join(keyword_directives), Name.Decorator),
+            (r'(%s)\b' % '|'.join(keyword_declarations), Keyword.Declaration),
+            (r'(%s)\b' % '|'.join(keyword_types), Keyword.Type),
+            (r'(%s)\b' % '|'.join(keyword_constants), Keyword.Constant),
+
+            # Operators
+            include('operators'),
+
+            # Float Literal
+            # -- Hex Float
+            (r'0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)'
+             r'[pP][+\-]?[0-9_]+[lLfFdD]?', Number.Float),
+            # -- DecimalFloat
+            (r'[0-9_]+(\.[0-9_]+[eE][+\-]?[0-9_]+|'
+             r'\.[0-9_]*|[eE][+\-]?[0-9_]+)[lLfFdD]?', Number.Float),
+            (r'\.(0|[1-9][0-9_]*)([eE][+\-]?[0-9_]+)?[lLfFdD]?',
+             Number.Float),
+
+            # IntegerLiteral
+            # -- Binary
+            (r'0[Bb][01_]+%s' % decimal_suffixes, Number),
+            # -- Octal
+            (r'0[0-7_]+%s' % decimal_suffixes, Number.Oct),
+            # -- Hexadecimal
+            (r'0[xX][0-9a-fA-F_]+%s' % decimal_suffixes, Number.Hex),
+            # -- Decimal
+            (r'(0|[1-9][0-9_]*)%s' % decimal_suffixes, Number.Integer),
+
+            # Strings
+            ('([rR][cC]?|[cC][rR])"""', String, 'tdqs'),
+            ("([rR][cC]?|[cC][rR])'''", String, 'tsqs'),
+            ('([rR][cC]?|[cC][rR])"', String, 'dqs'),
+            ("([rR][cC]?|[cC][rR])'", String, 'sqs'),
+            ('[cCfFqQwWuU]?"""', String, combined('stringescape', 'tdqs')),
+            ("[cCfFqQwWuU]?'''", String, combined('stringescape', 'tsqs')),
+            ('[cCfFqQwWuU]?"', String, combined('stringescape', 'dqs')),
+            ("[cCfFqQwWuU]?'", String, combined('stringescape', 'sqs')),
+
+            # Punctuation
+            (r'[\[\]{}:(),;?]', Punctuation),
+
+            # Labels
+            (r'[a-zA-Z_]\w*:>', Name.Label),
+
+            # Identifiers
+            (r'(%s)\b' % '|'.join(name_builtins), Name.Builtin),
+            (r'(%s)\b' % '|'.join(name_pseudo), Name.Builtin.Pseudo),
+            (r'[a-zA-Z_]\w*', Name),
+        ],
+        'whitespace': [
+            (r'\n', Text),
+            (r'\s+', Text),
+
+            include('comment'),
+
+            # Preprocessor
+            (r'#\s*if\s+0', Comment.Preproc, 'if0'),
+            (r'#', Comment.Preproc, 'macro'),
+        ],
+        'operators': [
+            (r'(%s)\b' % '|'.join(operator_words), Operator.Word),
+            (r'!=|==|<<|>>|\|\||&&|[-~+/*%=<>&^|.$]', Operator),
+        ],
+        'comment': [
+            (r'//(.*?)\n', Comment.Single),
+            (r'/[*]', Comment.Multiline, 'comment2'),
+        ],
+        'comment2': [
+            (r'[^\/*]', Comment.Multiline),
+            (r'/[*]', Comment.Multiline, '#push'),
+            (r'[*]/', Comment.Multiline, '#pop'),
+            (r'[\/*]', Comment.Multiline),
+        ],
+        'if0': [
+            (r'^\s*#if.*?(?<!\\)\n', Comment, '#push'),
+            (r'^\s*#endif.*?(?<!\\)\n', Comment, '#pop'),
+            (r'.*?\n', Comment),
+        ],
+        'macro': [
+            include('comment'),
+            (r'(import|include)(\s+)(<[^>]*?>)',
+             bygroups(Comment.Preproc, Text, String), '#pop'),
+            (r'(import|include)(\s+)("[^"]*?")',
+             bygroups(Comment.Preproc, Text, String), '#pop'),
+            (r"(import|include)(\s+)('[^']*?')",
+             bygroups(Comment.Preproc, Text, String), '#pop'),
+            (r'[^/\n]+', Comment.Preproc),
+            ##(r'/[*](.|\n)*?[*]/', Comment),
+            ##(r'//.*?\n', Comment, '#pop'),
+            (r'/', Comment.Preproc),
+            (r'(?<=\\)\n', Comment.Preproc),
+            (r'\n', Comment.Preproc, '#pop'),
+        ],
+        'funcname': [
+            include('whitespace'),
+            (r'[a-zA-Z_]\w*', Name.Function, '#pop'),
+            # anonymous functions
+            (r'(?=\()', Text, '#pop'),
+        ],
+        'classname': [
+            include('whitespace'),
+            (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
+            # anonymous classes
+            (r'(?=\{)', Text, '#pop'),
+        ],
+        'modulename': [
+            include('whitespace'),
+            (r'\[', Punctuation, ('modulename2', 'tvarlist')),
+            (r'', Error, 'modulename2'),
+        ],
+        'modulename2': [
+            include('whitespace'),
+            (r'([a-zA-Z_]\w*)', Name.Namespace, '#pop:2'),
+        ],
+        'tvarlist': [
+            include('whitespace'),
+            include('operators'),
+            (r'\[', Punctuation, '#push'),
+            (r'\]', Punctuation, '#pop'),
+            (r',', Punctuation),
+            (r'(with|where)\b', Keyword),
+            (r'[a-zA-Z_]\w*', Name),
+        ],
+        'stringescape': [
+            (r'\\([\\abfnrtv"\']|\n|N{.*?}|u[a-fA-F0-9]{4}|'
+             r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
+        ],
+        'strings': [
+            (r'%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
+             '[hlL]?[diouxXeEfFgGcrs%]', String.Interpol),
+            (r'[^\\\'"%\n]+', String),
+            # quotes, percents and backslashes must be parsed one at a time
+            (r'[\'"\\]', String),
+            # unhandled string formatting sign
+            (r'%', String)
+            # newlines are an error (use "nl" state)
+        ],
+        'nl': [
+            (r'\n', String)
+        ],
+        'dqs': [
+            (r'"', String, '#pop'),
+            # included here again for raw strings
+            (r'\\\\|\\"|\\\n', String.Escape),
+            include('strings')
+        ],
+        'sqs': [
+            (r"'", String, '#pop'),
+            # included here again for raw strings
+            (r"\\\\|\\'|\\\n", String.Escape),
+            include('strings')
+        ],
+        'tdqs': [
+            (r'"""', String, '#pop'),
+            include('strings'),
+            include('nl')
+        ],
+        'tsqs': [
+            (r"'''", String, '#pop'),
+            include('strings'),
+            include('nl')
+        ],
+     }
+
+
+class AdaLexer(RegexLexer):
+    """
+    For Ada source code.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Ada'
+    aliases = ['ada', 'ada95' 'ada2005']
+    filenames = ['*.adb', '*.ads', '*.ada']
+    mimetypes = ['text/x-ada']
+
+    flags = re.MULTILINE | re.I  # Ignore case
+
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'root': [
+            (r'[^\S\n]+', Text),
+            (r'--.*?\n', Comment.Single),
+            (r'[^\S\n]+', Text),
+            (r'function|procedure|entry', Keyword.Declaration, 'subprogram'),
+            (r'(subtype|type)(\s+)([a-z0-9_]+)',
+             bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'),
+            (r'task|protected', Keyword.Declaration),
+            (r'(subtype)(\s+)', bygroups(Keyword.Declaration, Text)),
+            (r'(end)(\s+)', bygroups(Keyword.Reserved, Text), 'end'),
+            (r'(pragma)(\s+)([a-zA-Z0-9_]+)', bygroups(Keyword.Reserved, Text,
+                                                       Comment.Preproc)),
+            (r'(true|false|null)\b', Keyword.Constant),
+            (r'(Byte|Character|Float|Integer|Long_Float|Long_Integer|'
+             r'Long_Long_Float|Long_Long_Integer|Natural|Positive|Short_Float|'
+             r'Short_Integer|Short_Short_Float|Short_Short_Integer|String|'
+             r'Wide_String|Duration)\b', Keyword.Type),
+            (r'(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b', Operator.Word),
+            (r'generic|private', Keyword.Declaration),
+            (r'package', Keyword.Declaration, 'package'),
+            (r'array\b', Keyword.Reserved, 'array_def'),
+            (r'(with|use)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
+            (r'([a-z0-9_]+)(\s*)(:)(\s*)(constant)',
+             bygroups(Name.Constant, Text, Punctuation, Text,
+                      Keyword.Reserved)),
+            (r'<<[a-z0-9_]+>>', Name.Label),
+            (r'([a-z0-9_]+)(\s*)(:)(\s*)(declare|begin|loop|for|while)',
+             bygroups(Name.Label, Text, Punctuation, Text, Keyword.Reserved)),
+            (r'\b(abort|abs|abstract|accept|access|aliased|all|array|at|begin|'
+             r'body|case|constant|declare|delay|delta|digits|do|else|elsif|end|'
+             r'entry|exception|exit|interface|for|goto|if|is|limited|loop|new|'
+             r'null|of|or|others|out|overriding|pragma|protected|raise|range|'
+             r'record|renames|requeue|return|reverse|select|separate|subtype|'
+             r'synchronized|task|tagged|terminate|then|type|until|when|while|'
+             r'xor)\b',
+             Keyword.Reserved),
+            (r'"[^"]*"', String),
+            include('attribute'),
+            include('numbers'),
+            (r"'[^']'", String.Character),
+            (r'([a-z0-9_]+)(\s*|[(,])', bygroups(Name, using(this))),
+            (r"(<>|=>|:=|[\(\)\|:;,.'])", Punctuation),
+            (r'[*<>+=/&-]', Operator),
+            (r'\n+', Text),
+        ],
+        'numbers' : [
+            (r'[0-9_]+#[0-9a-f]+#', Number.Hex),
+            (r'[0-9_]+\.[0-9_]*', Number.Float),
+            (r'[0-9_]+', Number.Integer),
+        ],
+        'attribute' : [
+            (r"(')([a-zA-Z0-9_]+)", bygroups(Punctuation, Name.Attribute)),
+        ],
+        'subprogram' : [
+            (r'\(', Punctuation, ('#pop', 'formal_part')),
+            (r';', Punctuation, '#pop'),
+            (r'is\b', Keyword.Reserved, '#pop'),
+            (r'"[^"]+"|[a-z0-9_]+', Name.Function),
+            include('root'),
+        ],
+        'end' : [
+            ('(if|case|record|loop|select)', Keyword.Reserved),
+            ('"[^"]+"|[a-zA-Z0-9_]+', Name.Function),
+            ('[\n\s]+', Text),
+            (';', Punctuation, '#pop'),
+        ],
+        'type_def': [
+            (r';', Punctuation, '#pop'),
+            (r'\(', Punctuation, 'formal_part'),
+            (r'with|and|use', Keyword.Reserved),
+            (r'array\b', Keyword.Reserved, ('#pop', 'array_def')),
+            (r'record\b', Keyword.Reserved, ('formal_part')),
+            include('root'),
+        ],
+        'array_def' : [
+            (r';', Punctuation, '#pop'),
+            (r'([a-z0-9_]+)(\s+)(range)', bygroups(Keyword.Type, Text,
+                                                   Keyword.Reserved)),
+            include('root'),
+        ],
+        'import': [
+            (r'[a-z0-9_.]+', Name.Namespace, '#pop'),
+        ],
+        'formal_part' : [
+            (r'\)', Punctuation, '#pop'),
+            (r'([a-z0-9_]+)(\s*)(,|:[^=])', bygroups(Name.Variable,
+                                                     Text, Punctuation)),
+            (r'(in|not|null|out|access)\b', Keyword.Reserved),
+            include('root'),
+        ],
+        'package': [
+            ('body', Keyword.Declaration),
+            ('is\s+new|renames', Keyword.Reserved),
+            ('is', Keyword.Reserved, '#pop'),
+            (';', Punctuation, '#pop'),
+            ('\(', Punctuation, 'package_instantiation'),
+            ('([a-zA-Z0-9_.]+)', Name.Class),
+            include('root'),
+        ],
+        'package_instantiation': [
+            (r'("[^"]+"|[a-z0-9_]+)(\s+)(=>)', bygroups(Name.Variable,
+                                                        Text, Punctuation)),
+            (r'[a-z0-9._\'"]', Text),
+            (r'\)', Punctuation, '#pop'),
+            include('root'),
+        ],
+    }
+
+
+class Modula2Lexer(RegexLexer):
+    """
+    For `Modula-2 <http://www.modula2.org/>`_ source code.
+
+    Additional options that determine which keywords are highlighted:
+
+    `pim`
+        Select PIM Modula-2 dialect (default: True).
+    `iso`
+        Select ISO Modula-2 dialect (default: False).
+    `objm2`
+        Select Objective Modula-2 dialect (default: False).
+    `gm2ext`
+        Also highlight GNU extensions (default: False).
+
+    *New in Pygments 1.3.*
+    """
+    name = 'Modula-2'
+    aliases = ['modula2', 'm2']
+    filenames = ['*.def', '*.mod']
+    mimetypes = ['text/x-modula2']
+
+    flags = re.MULTILINE | re.DOTALL
+
+    tokens = {
+        'whitespace': [
+            (r'\n+', Text), # blank lines
+            (r'\s+', Text), # whitespace
+        ],
+        'identifiers': [
+            (r'([a-zA-Z_\$][a-zA-Z0-9_\$]*)', Name),
+        ],
+        'numliterals': [
+            (r'[01]+B', Number.Binary),        # binary number (ObjM2)
+            (r'[0-7]+B', Number.Oct),          # octal number (PIM + ISO)
+            (r'[0-7]+C', Number.Oct),          # char code (PIM + ISO)
+            (r'[0-9A-F]+C', Number.Hex),       # char code (ObjM2)
+            (r'[0-9A-F]+H', Number.Hex),       # hexadecimal number
+            (r'[0-9]+\.[0-9]+E[+-][0-9]+', Number.Float), # real number
+            (r'[0-9]+\.[0-9]+', Number.Float), # real number
+            (r'[0-9]+', Number.Integer),       # decimal whole number
+        ],
+        'strings': [
+            (r"'(\\\\|\\'|[^'])*'", String), # single quoted string
+            (r'"(\\\\|\\"|[^"])*"', String), # double quoted string
+        ],
+        'operators': [
+            (r'[*/+=#~&<>\^-]', Operator),
+            (r':=', Operator),   # assignment
+            (r'@', Operator),    # pointer deref (ISO)
+            (r'\.\.', Operator), # ellipsis or range
+            (r'`', Operator),    # Smalltalk message (ObjM2)
+            (r'::', Operator),   # type conversion (ObjM2)
+        ],
+        'punctuation': [
+            (r'[\(\)\[\]{},.:;|]', Punctuation),
+        ],
+        'comments': [
+            (r'//.*?\n', Comment.Single),       # ObjM2
+            (r'/\*(.*?)\*/', Comment.Multiline), # ObjM2
+            (r'\(\*([^\$].*?)\*\)', Comment.Multiline),
+            # TO DO: nesting of (* ... *) comments
+        ],
+        'pragmas': [
+            (r'\(\*\$(.*?)\*\)', Comment.Preproc), # PIM
+            (r'<\*(.*?)\*>', Comment.Preproc),     # ISO + ObjM2
+        ],
+        'root': [
+            include('whitespace'),
+            include('comments'),
+            include('pragmas'),
+            include('identifiers'),
+            include('numliterals'),
+            include('strings'),
+            include('operators'),
+            include('punctuation'),
+        ]
+    }
+
+    pim_reserved_words = [
+        # 40 reserved words
+        'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION',
+        'DIV', 'DO', 'ELSE', 'ELSIF', 'END', 'EXIT', 'EXPORT', 'FOR',
+        'FROM', 'IF', 'IMPLEMENTATION', 'IMPORT', 'IN', 'LOOP', 'MOD',
+        'MODULE', 'NOT', 'OF', 'OR', 'POINTER', 'PROCEDURE', 'QUALIFIED',
+        'RECORD', 'REPEAT', 'RETURN', 'SET', 'THEN', 'TO', 'TYPE',
+        'UNTIL', 'VAR', 'WHILE', 'WITH',
+    ]
+
+    pim_pervasives = [
+        # 31 pervasives
+        'ABS', 'BITSET', 'BOOLEAN', 'CAP', 'CARDINAL', 'CHAR', 'CHR', 'DEC',
+        'DISPOSE', 'EXCL', 'FALSE', 'FLOAT', 'HALT', 'HIGH', 'INC', 'INCL',
+        'INTEGER', 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEW', 'NIL', 'ODD',
+        'ORD', 'PROC', 'REAL', 'SIZE', 'TRUE', 'TRUNC', 'VAL',
+    ]
+
+    iso_reserved_words = [
+        # 46 reserved words
+        'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV',
+        'DO', 'ELSE', 'ELSIF', 'END', 'EXCEPT', 'EXIT', 'EXPORT', 'FINALLY',
+        'FOR', 'FORWARD', 'FROM', 'IF', 'IMPLEMENTATION', 'IMPORT', 'IN',
+        'LOOP', 'MOD', 'MODULE', 'NOT', 'OF', 'OR', 'PACKEDSET', 'POINTER',
+        'PROCEDURE', 'QUALIFIED', 'RECORD', 'REPEAT', 'REM', 'RETRY',
+        'RETURN', 'SET', 'THEN', 'TO', 'TYPE', 'UNTIL', 'VAR', 'WHILE',
+        'WITH',
+    ]
+
+    iso_pervasives = [
+        # 42 pervasives
+        'ABS', 'BITSET', 'BOOLEAN', 'CAP', 'CARDINAL', 'CHAR', 'CHR', 'CMPLX',
+        'COMPLEX', 'DEC', 'DISPOSE', 'EXCL', 'FALSE', 'FLOAT', 'HALT', 'HIGH',
+        'IM', 'INC', 'INCL', 'INT', 'INTEGER', 'INTERRUPTIBLE', 'LENGTH',
+        'LFLOAT', 'LONGCOMPLEX', 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEW',
+        'NIL', 'ODD', 'ORD', 'PROC', 'PROTECTION', 'RE', 'REAL', 'SIZE',
+        'TRUE', 'TRUNC', 'UNINTERRUBTIBLE', 'VAL',
+    ]
+
+    objm2_reserved_words = [
+        # base language, 42 reserved words
+        'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV',
+        'DO', 'ELSE', 'ELSIF', 'END', 'ENUM', 'EXIT', 'FOR', 'FROM', 'IF',
+        'IMMUTABLE', 'IMPLEMENTATION', 'IMPORT', 'IN', 'IS', 'LOOP', 'MOD',
+        'MODULE', 'NOT', 'OF', 'OPAQUE', 'OR', 'POINTER', 'PROCEDURE',
+        'RECORD', 'REPEAT', 'RETURN', 'SET', 'THEN', 'TO', 'TYPE',
+        'UNTIL', 'VAR', 'VARIADIC', 'WHILE',
+        # OO extensions, 16 reserved words
+        'BYCOPY', 'BYREF', 'CLASS', 'CONTINUE', 'CRITICAL', 'INOUT', 'METHOD',
+        'ON', 'OPTIONAL', 'OUT', 'PRIVATE', 'PROTECTED', 'PROTOCOL', 'PUBLIC',
+        'SUPER', 'TRY',
+    ]
+
+    objm2_pervasives = [
+        # base language, 38 pervasives
+        'ABS', 'BITSET', 'BOOLEAN', 'CARDINAL', 'CHAR', 'CHR', 'DISPOSE',
+        'FALSE', 'HALT', 'HIGH', 'INTEGER', 'INRANGE', 'LENGTH', 'LONGCARD',
+        'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEG', 'NEW', 'NEXTV', 'NIL',
+        'OCTET', 'ODD', 'ORD', 'PRED', 'PROC', 'READ', 'REAL', 'SUCC', 'TMAX',
+        'TMIN', 'TRUE', 'TSIZE', 'UNICHAR', 'VAL', 'WRITE', 'WRITEF',
+        # OO extensions, 3 pervasives
+        'OBJECT', 'NO', 'YES',
+    ]
+
+    gnu_reserved_words = [
+        # 10 additional reserved words
+        'ASM', '__ATTRIBUTE__', '__BUILTIN__', '__COLUMN__', '__DATE__',
+        '__FILE__', '__FUNCTION__', '__LINE__', '__MODULE__', 'VOLATILE',
+    ]
+
+    gnu_pervasives = [
+        # 21 identifiers, actually from pseudo-module SYSTEM
+        # but we will highlight them as if they were pervasives
+        'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
+        'CARDINAL32', 'CARDINAL64', 'COMPLEX32', 'COMPLEX64', 'COMPLEX96',
+        'COMPLEX128', 'INTEGER8', 'INTEGER16', 'INTEGER32', 'INTEGER64',
+        'REAL8', 'REAL16', 'REAL32', 'REAL96', 'REAL128', 'THROW',
+    ]
+
+    def __init__(self, **options):
+        self.reserved_words = set()
+        self.pervasives = set()
+        # ISO Modula-2
+        if get_bool_opt(options, 'iso', False):
+            self.reserved_words.update(self.iso_reserved_words)
+            self.pervasives.update(self.iso_pervasives)
+        # Objective Modula-2
+        elif get_bool_opt(options, 'objm2', False):
+            self.reserved_words.update(self.objm2_reserved_words)
+            self.pervasives.update(self.objm2_pervasives)
+        # PIM Modula-2 (DEFAULT)
+        else:
+            self.reserved_words.update(self.pim_reserved_words)
+            self.pervasives.update(self.pim_pervasives)
+        # GNU extensions
+        if get_bool_opt(options, 'gm2ext', False):
+            self.reserved_words.update(self.gnu_reserved_words)
+            self.pervasives.update(self.gnu_pervasives)
+        # initialise
+        RegexLexer.__init__(self, **options)
+
+    def get_tokens_unprocessed(self, text):
+        for index, token, value in \
+            RegexLexer.get_tokens_unprocessed(self, text):
+            # check for reserved words and pervasives
+            if token is Name:
+                if value in self.reserved_words:
+                    token = Keyword.Reserved
+                elif value in self.pervasives:
+                    token = Keyword.Pervasive
+            # return result
+            yield index, token, value
index 8431ba3398b26750ed5d5787c7fed8f683c61a9a..ffbd7538738d250f6a0d428929a02969232465f8 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions
 from pygments.token import Text, Comment, Operator, Keyword, Name, \
@@ -474,7 +470,7 @@ class LiterateHaskellLexer(Lexer):
 
         style = self.options.get('litstyle')
         if style is None:
-            style = (text.lstrip()[0] in '%\\') and 'latex' or 'bird'
+            style = (text.lstrip()[0:1] in '%\\') and 'latex' or 'bird'
 
         code = ''
         insertions = []
index 79097f2849d32797a565e5e511c53bd73682abd2..448e299f6fd03ceacb7746d70974206520f5b4e8 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions
 from pygments.token import Comment, String, Punctuation, Keyword, Name, \
@@ -22,7 +18,7 @@ from pygments.token import Comment, String, Punctuation, Keyword, Name, \
 from pygments.lexers.agile import PythonLexer
 
 __all__ = ['MuPADLexer', 'MatlabLexer', 'MatlabSessionLexer', 'NumPyLexer',
-           'SLexer']
+           'RConsoleLexer', 'SLexer']
 
 
 class MuPADLexer(RegexLexer):
@@ -340,6 +336,52 @@ class NumPyLexer(PythonLexer):
                 yield index, token, value
 
 
+class RConsoleLexer(Lexer):
+    """
+    For R console transcripts or R CMD BATCH output files.
+    """
+
+    name = 'RConsole'
+    aliases = ['rconsole', 'rout']
+    filenames = ['*.Rout']
+
+    def get_tokens_unprocessed(self, text):
+        slexer = SLexer(**self.options)
+
+        current_code_block = ''
+        insertions = []
+
+        for match in line_re.finditer(text):
+            line = match.group()
+            if line.startswith('>') or line.startswith('+'):
+                # Colorize the prompt as such,
+                # then put rest of line into current_code_block
+                insertions.append((len(current_code_block),
+                                   [(0, Generic.Prompt, line[:2])]))
+                current_code_block += line[2:]
+            else:
+                # We have reached a non-prompt line!
+                # If we have stored prompt lines, need to process them first.
+                if current_code_block:
+                    # Weave together the prompts and highlight code.
+                    for item in do_insertions(insertions,
+                          slexer.get_tokens_unprocessed(current_code_block)):
+                        yield item
+                    # Reset vars for next code block.
+                    current_code_block = ''
+                    insertions = []
+                # Now process the actual line itself, this is output from R.
+                yield match.start(), Generic.Output, line
+
+        # If we happen to end on a code block with nothing after it, need to
+        # process the last code block. This is neither elegant nor DRY so
+        # should be changed.
+        if current_code_block:
+            for item in do_insertions(insertions,
+                    slexer.get_tokens_unprocessed(current_code_block)):
+                yield item
+
+
 class SLexer(RegexLexer):
     """
     For S, S-plus, and R source code.
index 7902435071d525ebc1985f7e0f037909fd6d32c0..8ca00fea2fda930eee5b41fe872d26b77cf8484a 100644 (file)
@@ -321,14 +321,14 @@ class BefungeLexer(RegexLexer):
 
 class BashLexer(RegexLexer):
     """
-    Lexer for (ba)sh shell scripts.
+    Lexer for (ba|k|)sh shell scripts.
 
     *New in Pygments 0.6.*
     """
 
     name = 'Bash'
-    aliases = ['bash', 'sh']
-    filenames = ['*.sh', '*.ebuild', '*.eclass']
+    aliases = ['bash', 'sh', 'ksh']
+    filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass']
     mimetypes = ['application/x-sh', 'application/x-shellscript']
 
     tokens = {
@@ -633,11 +633,11 @@ class SmalltalkLexer(RegexLexer):
         ],
         '_parenth_helper' : [
             include('whitespaces'),
+            (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
             (r'[-+*/\\~<>=|&#!?,@%\w+:]+', String.Symbol),
             # literals
             (r'\'[^\']*\'', String),
             (r'\$.', String.Char),
-            (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
             (r'#*\(', String.Symbol, 'inner_parenth'),
         ],
         'parenth' : [
@@ -2107,45 +2107,45 @@ class GherkinLexer(RegexLexer):
     feature_keywords_regexp  = ur'^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$'
     scenario_keywords_regexp = ur'^(\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарио|Сценарий структураси|Сценарий|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Основа|Концепт|Контекст|Założenia|Tình huống|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l\'escenari|Escenario|Escenari|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$'
     examples_regexp          = ur'^(\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$'
-    step_keywords_regexp     = ur'^(\s*)(하지만|조건|만일|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Унда |То |Онда |Но |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Агар |А |Și |És |anrhegedig a |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Yna |Ya know how |Ya gotta |Y |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Soit |Siis |Si |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Donat |Donada |Diyelim ki |Dengan |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |But y\'all |But |Biết |Bet |BUT |Atunci |And y\'all |And |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A )'
+    step_keywords_regexp     = ur'^(\s*)(하지만|조건|만일|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Унда |То |Онда |Но |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Агар |А |Și |És |anrhegedig a |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Yna |Ya know how |Ya gotta |Y |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Donat |Donada |Diyelim ki |Dengan |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |But y\'all |But |Biết |Bet |BUT |Atunci |And y\'all |And |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )'
 
     tokens = {
         'comments': [
-            (r'#.*$', Comment),
+            (r'#.*$', Comment)
           ],
         'multiline_descriptions' : [
             (step_keywords_regexp, Keyword, "#pop"),
             include('comments'),
-            (r"(\s|.)", Name.Constant),
+            (r"(\s|.)", Name.Constant)
           ],
         'multiline_descriptions_on_stack' : [
             (step_keywords_regexp, Keyword, "#pop:2"),
             include('comments'),
-            (r"(\s|.)", Name.Constant),
+            (r"(\s|.)", Name.Constant)
           ],
         'scenario_table_description': [
             (r"\s+\|", Text, 'scenario_table_header'),
             include('comments'),
-            (r"(\s|.)", Name.Constant),
+            (r"(\s|.)", Name.Constant)
           ],
         'scenario_table_header': [
             (r"\s+\|\s*$", Text, "#pop:2"),
             (r"(\s+\|\s*)(#.*)$", bygroups(Text, Comment), "#pop:2"),
             include('comments'),
             (r"\s+\|", Text),
-            (r"[^\|]", Name.Variable),
+            (r"[^\|]", Name.Variable)
           ],
         'scenario_sections_on_stack': [
             (scenario_keywords_regexp,
              bygroups(Text, Name.Class, Name.Class, Name.Constant),
-             "multiline_descriptions_on_stack"),
+             "multiline_descriptions_on_stack")
             ],
         'narrative': [
             include('scenario_sections_on_stack'),
-            (r"(\s|.)", Name.Builtin),
+            (r"(\s|.)", Name.Builtin)
           ],
         'table_vars': [
-            (r'(<[^>]*>)', bygroups(Name.Variable)),
+            (r'(<[^>]*>)', bygroups(Name.Variable))
           ],
         'string': [
             include('table_vars'),
@@ -2159,16 +2159,11 @@ class GherkinLexer(RegexLexer):
             (r'"', String, "#pop"),
             include('string'),
           ],
-        'single_string': [
-            (r"'", String, "#pop"),
-            include('string'),
-          ],
         'root': [
             (r'\n', Text),
             include('comments'),
             (r'"""', String, "py_string"),
             (r'"', String, "double_string"),
-            (r"'", String, "single_string"),
             include('table_vars'),
             (r'@[^@\s]+', Name.Namespace),
             (step_keywords_regexp, bygroups(Text, Keyword)),
@@ -2180,7 +2175,7 @@ class GherkinLexer(RegexLexer):
             (examples_regexp,
              bygroups(Text, Name.Class, Name.Class, Name.Constant),
              "scenario_table_description"),
-            (r'(\s|.)', Text),
+            (r'(\s|.)', Text)
         ]
     }
 
index 15d58ebf659f834609adca57641901c23dc17f53..0ead39bee97d4bb390afa757bda8700292b4dcef 100644 (file)
 import re
 
 from pygments.lexer import RegexLexer, DelegatingLexer, \
-    include, bygroups, using, this
-from pygments.token import Error, Punctuation, Generic, Other, \
-    Text, Comment, Operator, Keyword, Name, String, Number, Whitespace
+    include, bygroups, using
+from pygments.token import Punctuation, Other, Text, Comment, Operator, \
+     Keyword, Name, String, Number, Whitespace
 from pygments.lexers.compiled import JavaLexer, CLexer, CppLexer, \
     ObjectiveCLexer, DLexer
 from pygments.lexers.dotnet import CSharpLexer
 from pygments.lexers.agile import RubyLexer, PythonLexer, PerlLexer
 from pygments.lexers.web import ActionScriptLexer
-# Use TextLexer during development to just focus on one part of a delegating
-# lexer.
-from pygments.lexers.special import TextLexer
+
 
 __all__ = ['RagelLexer', 'RagelEmbeddedLexer', 'RagelCLexer', 'RagelDLexer',
            'RagelCppLexer', 'RagelObjectiveCLexer', 'RagelRubyLexer',
index 49b843d7717b369b7520329154955c66f47826cc..eb8474557a07d293bb4e10b4ddb8f8767a882b8a 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexers.web import \
      PhpLexer, HtmlLexer, XmlLexer, JavascriptLexer, CssLexer
@@ -38,7 +34,8 @@ __all__ = ['HtmlPhpLexer', 'XmlPhpLexer', 'CssPhpLexer',
            'MakoHtmlLexer', 'MakoXmlLexer', 'MakoJavascriptLexer',
            'MakoCssLexer', 'JspLexer', 'CheetahLexer', 'CheetahHtmlLexer',
            'CheetahXmlLexer', 'CheetahJavascriptLexer',
-           'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer']
+           'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer',
+           'ColdfusionLexer', 'ColdfusionHtmlLexer']
 
 
 class ErbLexer(Lexer):
@@ -246,7 +243,7 @@ class DjangoLexer(RegexLexer):
             (r'\.[a-zA-Z0-9_]+', Name.Variable),
             (r':?"(\\\\|\\"|[^"])*"', String.Double),
             (r":?'(\\\\|\\'|[^'])*'", String.Single),
-            (r'([{}()\[\]+\-*/,:]|[><=]=?)', Operator),
+            (r'([{}()\[\]+\-*/,:~]|[><=]=?)', Operator),
             (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
              r"0[xX][0-9a-fA-F]+[Ll]?", Number),
         ],
@@ -1294,3 +1291,97 @@ class EvoqueXmlLexer(DelegatingLexer):
     def __init__(self, **options):
         super(EvoqueXmlLexer, self).__init__(XmlLexer, EvoqueLexer,
                                              **options)
+
+class ColdfusionLexer(RegexLexer):
+    """
+    Coldfusion statements
+    """
+    name = 'cfstatement'
+    aliases = ['cfs']
+    filenames = []
+    mimetypes = []
+    flags = re.IGNORECASE | re.MULTILINE
+
+    tokens = {
+        'root': [
+            (r'//.*', Comment),
+            (r'\+\+|--', Operator),
+            (r'[-+*/^&=!]', Operator),
+            (r'<=|>=|<|>', Operator),
+            (r'mod\b', Operator),
+            (r'(eq|lt|gt|lte|gte|not|is|and|or)\b', Operator),
+            (r'\|\||&&', Operator),
+            (r'"', String.Double, 'string'),
+            # There is a special rule for allowing html in single quoted
+            # strings, evidently.
+            (r"'.*?'", String.Single),
+            (r'\d+', Number),
+            (r'(if|else|len|var|case|default|break|switch)\b', Keyword),
+            (r'([A-Za-z_$][A-Za-z0-9_.]*)\s*(\()', bygroups(Name.Function, Punctuation)),
+            (r'[A-Za-z_$][A-Za-z0-9_.]*', Name.Variable),
+            (r'[()\[\]{};:,.\\]', Punctuation),
+            (r'\s+', Text),
+        ],
+        'string': [
+            (r'""', String.Double),
+            (r'#.+?#', String.Interp),
+            (r'[^"#]+', String.Double),
+            (r'#', String.Double),
+            (r'"', String.Double, '#pop'),
+        ],
+    }
+
+class ColdfusionMarkupLexer(RegexLexer):
+    """
+    Coldfusion markup only
+    """
+    name = 'Coldfusion'
+    aliases = ['cf']
+    filenames = []
+    mimetypes = []
+
+    tokens = {
+        'root': [
+            (r'[^<]+', Other),
+            include('tags'),
+            (r'<[^<>]*', Other),
+        ],
+        'tags': [
+            (r'(?s)<!---.*?--->', Comment.Multiline),
+            (r'(?s)<!--.*?-->', Comment),
+            (r'<cfoutput.*?>', Name.Builtin, 'cfoutput'),
+            (r'(?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)',
+             bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
+            # negative lookbehind is for strings with embedded >
+            (r'(?s)(</?cf(?:component|include|if|else|elseif|loop|return|'
+             r'dbinfo|dump|abort|location|invoke|throw|file|savecontent|'
+             r'mailpart|mail|header|content|zip|image|lock|argument|try|'
+             r'catch|break|directory|http|set|function|param)\b)(.*?)((?<!\\)>)',
+             bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
+        ],
+        'cfoutput': [
+            (r'[^#<]+', Other),
+            (r'(#)(.*?)(#)', bygroups(Punctuation, using(ColdfusionLexer),
+                                      Punctuation)),
+            #(r'<cfoutput.*?>', Name.Builtin, '#push'),
+            (r'</cfoutput.*?>', Name.Builtin, '#pop'),
+            include('tags'),
+            (r'(?s)<[^<>]*', Other),
+            (r'#', Other),
+        ],
+    }
+
+
+class ColdfusionHtmlLexer(DelegatingLexer):
+    """
+    Coldfusion markup in html
+    """
+    name = 'Coldufsion HTML'
+    aliases = ['cfm']
+    filenames = ['*.cfm', '*.cfml', '*.cfc']
+    mimetypes = ['application/x-coldfusion']
+
+    def __init__(self, **options):
+        super(ColdfusionHtmlLexer, self).__init__(HtmlLexer, ColdfusionMarkupLexer,
+                                                  **options)
+
index 1d7f89fdec621306f03b9a8f5e7ce7500f142327..6b223703695eaf551f7cdf54f3773d81832f8598 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 from bisect import bisect
 
 from pygments.lexer import Lexer, LexerContext, RegexLexer, ExtendedRegexLexer, \
@@ -638,7 +634,8 @@ class RstLexer(RegexLexer):
     tokens = {
         'root': [
             # Heading with overline
-            (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)(.+)(\n)(\1)(\n)',
+            (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)'
+             r'(.+)(\n)(\1)(\n)',
              bygroups(Generic.Heading, Text, Generic.Heading,
                       Text, Generic.Heading, Text)),
             # Plain heading
@@ -658,24 +655,33 @@ class RstLexer(RegexLexer):
              bygroups(Text, Number, using(this, state='inline'))),
             (r'^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1  .+\n)+)',
              bygroups(Text, Number, using(this, state='inline'))),
+            # Line blocks
+            (r'^(\s*)(\|)( .+\n(?:\|  .+\n)*)',
+             bygroups(Text, Operator, using(this, state='inline'))),
             # Sourcecode directives
             (r'^( *\.\.)(\s*)((?:source)?code)(::)([ \t]*)([^\n]+)'
              r'(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*|)\n)+)',
              _handle_sourcecode),
             # A directive
-            (r'^( *\.\.)(\s*)([\w-]+)(::)(?:([ \t]*)(.+))?',
-             bygroups(Punctuation, Text, Operator.Word, Punctuation, Text, Keyword)),
+            (r'^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
+             bygroups(Punctuation, Text, Operator.Word, Punctuation, Text,
+                      using(this, state='inline'))),
             # A reference target
             (r'^( *\.\.)(\s*)([\w\t ]+:)(.*?)$',
              bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
             # A footnote target
             (r'^( *\.\.)(\s*)(\[.+\])(.*?)$',
              bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
+            # A substitution def
+            (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
+             bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word,
+                      Punctuation, Text, using(this, state='inline'))),
             # Comments
             (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc),
             # Field list
-            (r'^( *)(:.*?:)([ \t]+)(.*?)$', bygroups(Text, Name.Class, Text,
-                                                     Name.Function)),
+            (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)),
+            (r'^( *)(:.*?:)([ \t]+)(.*?)$',
+             bygroups(Text, Name.Class, Text, Name.Function)),
             # Definition list
             (r'^([^ ].*(?<!::)\n)((?:(?: +.*)\n)+)',
              bygroups(using(this, state='inline'), using(this, state='inline'))),
@@ -687,12 +693,13 @@ class RstLexer(RegexLexer):
         'inline': [
             (r'\\.', Text), # escape
             (r'``', String, 'literal'), # code
-            (r'(`)(.+?)(`__?)',
-             bygroups(Punctuation, using(this), Punctuation)), # reference
-            (r'(`.+?`)(:[a-zA-Z0-9-]+?:)?',
+            (r'(`.+?)(<.+?>)(`__?)',  # reference with inline target
+             bygroups(String, String.Interpol, String)),
+            (r'`.+?`__?', String), # reference
+            (r'(`.+?`)(:[a-zA-Z0-9:-]+?:)?',
              bygroups(Name.Variable, Name.Attribute)), # role
-            (r'(:[a-zA-Z0-9-]+?:)(`.+?`)',
-             bygroups(Name.Attribute, Name.Variable)), # user-defined role
+            (r'(:[a-zA-Z0-9:-]+?:)(`.+?`)',
+             bygroups(Name.Attribute, Name.Variable)), # role (content first)
             (r'\*\*.+?\*\*', Generic.Strong), # Strong emphasis
             (r'\*.+?\*', Generic.Emph), # Emphasis
             (r'\[.*?\]_', String), # Footnote or citation
@@ -1013,6 +1020,7 @@ class DebianControlLexer(RegexLexer):
             (r'[}]', Text),
             (r'[^,]$', Name.Function, '#pop'),
             (r'([\+\.a-zA-Z0-9-][\s\n]*)', Name.Function),
+            (r'\[.*?\]', Name.Entity),
         ],
         'depend_vers': [
             (r'\),', Text, '#pop'),
@@ -1503,6 +1511,7 @@ class NginxConfLexer(RegexLexer):
             (r'[^\s;#{}$]+', String), # catch all
             (r'/[^\s;#]*', Name), # pathname
             (r'\s+', Text),
+            (r'[$;]', Text),  # leftover characters
         ],
     }
 
index 598611d44cd3277804f306e15f0c867f7b33d48d..ec0b27be9bc5f6083d73cf6363ae9abc0ad22b42 100644 (file)
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
-from pygments.lexer import RegexLexer, bygroups, using, include, this
+from pygments.lexer import RegexLexer, ExtendedRegexLexer, bygroups, using, \
+     include, this
 from pygments.token import \
      Text, Comment, Operator, Keyword, Name, String, Number, Other, Punctuation
 from pygments.util import get_bool_opt, get_list_opt, looks_like_xml, \
                           html_doctype_matches
+from pygments.lexers.agile import RubyLexer
 
 
 __all__ = ['HtmlLexer', 'XmlLexer', 'JavascriptLexer', 'CssLexer',
            'PhpLexer', 'ActionScriptLexer', 'XsltLexer', 'ActionScript3Lexer',
-           'MxmlLexer']
+           'MxmlLexer', 'HaxeLexer', 'HamlLexer', 'SassLexer',
+           'ObjectiveJLexer', 'CoffeeScriptLexer']
 
 
 class JavascriptLexer(RegexLexer):
@@ -312,7 +311,7 @@ class CssLexer(RegexLexer):
              r'list-style|margin-bottom|margin-left|margin-right|'
              r'margin-top|margin|marker-offset|marks|max-height|max-width|'
              r'min-height|min-width|opacity|orphans|outline|outline-color|'
-             r'outline-style|outline-width|overflow|padding-bottom|'
+             r'outline-style|outline-width|overflow(?:-x|-y|)|padding-bottom|'
              r'padding-left|padding-right|padding-top|padding|page|'
              r'page-break-after|page-break-before|page-break-inside|'
              r'pause-after|pause-before|pause|pitch|pitch-range|'
@@ -390,6 +389,229 @@ class CssLexer(RegexLexer):
     }
 
 
+class ObjectiveJLexer(RegexLexer):
+    """
+    For Objective-J source code with preprocessor directives.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Objective-J'
+    aliases = ['objective-j', 'objectivej', 'obj-j', 'objj']
+    filenames = ['*.j']
+    mimetypes = ['text/x-objective-j']
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)*'
+
+    flags = re.DOTALL | re.MULTILINE
+
+    tokens = {
+        'root': [
+            include('whitespace'),
+
+            # function definition
+            (r'^(' + _ws + r'[\+-]' + _ws + r')([\(a-zA-Z_].*?[^\(])(' + _ws + '{)',
+             bygroups(using(this), using(this, state='function_signature'),
+                      using(this))),
+
+            # class definition
+            (r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text),
+             'classname'),
+            (r'(@class|@protocol)(\s*)', bygroups(Keyword, Text),
+             'forward_classname'),
+            (r'(\s*)(@end)(\s*)', bygroups(Text, Keyword, Text)),
+
+            include('statements'),
+            ('[{\(\)}]', Punctuation),
+            (';', Punctuation),
+        ],
+        'whitespace': [
+            (r'(@import)(\s+)("(\\\\|\\"|[^"])*")',
+             bygroups(Comment.Preproc, Text, String.Double)),
+            (r'(@import)(\s+)(<(\\\\|\\>|[^>])*>)',
+             bygroups(Comment.Preproc, Text, String.Double)),
+            (r'(#(?:include|import))(\s+)("(\\\\|\\"|[^"])*")',
+             bygroups(Comment.Preproc, Text, String.Double)),
+            (r'(#(?:include|import))(\s+)(<(\\\\|\\>|[^>])*>)',
+             bygroups(Comment.Preproc, Text, String.Double)),
+
+            (r'#if\s+0', Comment.Preproc, 'if0'),
+            (r'#', Comment.Preproc, 'macro'),
+
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text), # line continuation
+            (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+            (r'<!--', Comment),
+        ],
+        'slashstartsregex': [
+            include('whitespace'),
+            (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
+             r'([gim]+\b|\B)', String.Regex, '#pop'),
+            (r'(?=/)', Text, ('#pop', 'badregex')),
+            (r'', Text, '#pop'),
+        ],
+        'badregex': [
+            ('\n', Text, '#pop'),
+        ],
+        'statements': [
+            (r'(L|@)?"', String, 'string'),
+            (r"(L|@)?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
+             String.Char),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+            (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
+            (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
+            (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
+            (r'0[0-7]+[Ll]?', Number.Oct),
+            (r'\d+[Ll]?', Number.Integer),
+
+            (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
+
+            (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
+             r'(<<|>>>?|==?|!=?|[-<>+*%&\|\^/])=?',
+             Operator, 'slashstartsregex'),
+            (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
+            (r'[})\].]', Punctuation),
+
+            (r'(for|in|while|do|break|return|continue|switch|case|default|if|'
+             r'else|throw|try|catch|finally|new|delete|typeof|instanceof|void|'
+             r'prototype|__proto__)\b', Keyword, 'slashstartsregex'),
+
+            (r'(var|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
+
+            (r'(@selector|@private|@protected|@public|@encode|'
+             r'@synchronized|@try|@throw|@catch|@finally|@end|@property|'
+             r'@synthesize|@dynamic|@for|@accessors|new)\b', Keyword),
+
+            (r'(int|long|float|short|double|char|unsigned|signed|void|'
+             r'id|BOOL|bool|boolean|IBOutlet|IBAction|SEL|@outlet|@action)\b',
+             Keyword.Type),
+
+            (r'(self|super)\b', Name.Builtin),
+
+            (r'(TRUE|YES|FALSE|NO|Nil|nil|NULL)\b', Keyword.Constant),
+            (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
+            (r'(ABS|ASIN|ACOS|ATAN|ATAN2|SIN|COS|TAN|EXP|POW|CEIL|FLOOR|ROUND|'
+             r'MIN|MAX|RAND|SQRT|E|LN2|LN10|LOG2E|LOG10E|PI|PI2|PI_2|SQRT1_2|'
+             r'SQRT2)\b', Keyword.Constant),
+
+            (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
+             r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
+             r'decodeURIComponent|encodeURI|encodeURIComponent|'
+             r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
+             r'window)\b', Name.Builtin),
+
+            (r'([$a-zA-Z_][a-zA-Z0-9_]*)(' + _ws + r')(?=\()',
+             bygroups(Name.Function, using(this))),
+
+            (r'[$a-zA-Z_][a-zA-Z0-9_]*', Name),
+        ],
+        'classname' : [
+            # interface definition that inherits
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(' + _ws + r':' + _ws +
+             r')([a-zA-Z_][a-zA-Z0-9_]*)?',
+             bygroups(Name.Class, using(this), Name.Class), '#pop'),
+            # interface definition for a category
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(' + _ws + r'\()([a-zA-Z_][a-zA-Z0-9_]*)(\))',
+             bygroups(Name.Class, using(this), Name.Label, Text), '#pop'),
+            # simple interface / implementation
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)', Name.Class, '#pop'),
+        ],
+        'forward_classname' : [
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*,\s*)',
+             bygroups(Name.Class, Text), '#push'),
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*;?)',
+             bygroups(Name.Class, Text), '#pop'),
+        ],
+        'function_signature': [
+            include('whitespace'),
+
+            # start of a selector w/ parameters
+            (r'(\(' + _ws + r')'                # open paren
+             r'([a-zA-Z_][a-zA-Z0-9_]+)'        # return type
+             r'(' + _ws + r'\)' + _ws + r')'    # close paren
+             r'([$a-zA-Z_][a-zA-Z0-9_]+' + _ws + r':)', # function name
+             bygroups(using(this), Keyword.Type, using(this),
+                 Name.Function), 'function_parameters'),
+
+            # no-param function
+            (r'(\(' + _ws + r')'                # open paren
+             r'([a-zA-Z_][a-zA-Z0-9_]+)'        # return type
+             r'(' + _ws + r'\)' + _ws + r')'    # close paren
+             r'([$a-zA-Z_][a-zA-Z0-9_]+)',      # function name
+             bygroups(using(this), Keyword.Type, using(this),
+                 Name.Function), "#pop"),
+
+            # no return type given, start of a selector w/ parameters
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+' + _ws + r':)', # function name
+             bygroups (Name.Function), 'function_parameters'),
+
+            # no return type given, no-param function
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+)',      # function name
+             bygroups(Name.Function), "#pop"),
+
+            ('', Text, '#pop'),
+        ],
+        'function_parameters': [
+            include('whitespace'),
+
+            # parameters
+            (r'(\(' + _ws + ')'                 # open paren
+             r'([^\)]+)'                        # type
+             r'(' + _ws + r'\)' + _ws + r')+'   # close paren
+             r'([$a-zA-Z_][a-zA-Z0-9_]+)',      # param name
+             bygroups(using(this), Keyword.Type, using(this), Text)),
+
+            # one piece of a selector name
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+' + _ws + r':)',     # function name
+             Name.Function),
+
+            # smallest possible selector piece
+            (r'(:)', Name.Function),
+
+            # var args
+            (r'(,' + _ws + r'...)', using(this)),
+
+            # param name
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+)', Text),
+        ],
+        'expression' : [
+            (r'([$a-zA-Z_][a-zA-Z0-9_]*)(\()', bygroups(Name.Function,
+                                                        Punctuation)),
+            (r'(\))', Punctuation, "#pop"),
+        ],
+        'string': [
+            (r'"', String, '#pop'),
+            (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
+            (r'[^\\"\n]+', String), # all other characters
+            (r'\\\n', String), # line continuation
+            (r'\\', String), # stray backslash
+        ],
+        'macro': [
+            (r'[^/\n]+', Comment.Preproc),
+            (r'/[*](.|\n)*?[*]/', Comment.Multiline),
+            (r'//.*?\n', Comment.Single, '#pop'),
+            (r'/', Comment.Preproc),
+            (r'(?<=\\)\n', Comment.Preproc),
+            (r'\n', Comment.Preproc, '#pop'),
+        ],
+        'if0': [
+            (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
+            (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
+            (r'.*?\n', Comment),
+        ]
+    }
+
+    def analyse_text(text):
+        if re.search('^\s*@import\s+[<"]', text, re.MULTILINE):
+            # special directive found in most Objective-J files
+            return True
+        return False
+
+
 class HtmlLexer(RegexLexer):
     """
     For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted
@@ -493,7 +715,7 @@ class PhpLexer(RegexLexer):
         ],
         'php': [
             (r'\?>', Comment.Preproc, '#pop'),
-            (r'<<<([a-zA-Z_][a-zA-Z0-9_]*)\n.*?\n\1\;?\n', String),
+            (r'<<<(\'?)([a-zA-Z_][a-zA-Z0-9_]*)\1\n.*?\n\2\;?\n', String),
             (r'\s+', Text),
             (r'#.*?\n', Comment.Single),
             (r'//.*?\n', Comment.Single),
@@ -507,6 +729,7 @@ class PhpLexer(RegexLexer):
             (r'[~!%^&*+=|:.<>/?@-]+', Operator),
             (r'[\[\]{}();,]+', Punctuation),
             (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
+            (r'(function)(\s*)(?=\()', bygroups(Keyword, Text)),
             (r'(function)(\s+)(&?)(\s*)',
               bygroups(Keyword, Text, Operator, Text), 'functionname'),
             (r'(const)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)',
@@ -520,11 +743,11 @@ class PhpLexer(RegexLexer):
              r'endif|list|__LINE__|endswitch|new|__sleep|endwhile|not|'
              r'array|__wakeup|E_ALL|NULL|final|php_user_filter|interface|'
              r'implements|public|private|protected|abstract|clone|try|'
-             r'catch|throw|this)\b', Keyword),
+             r'catch|throw|this|use|namespace)\b', Keyword),
             ('(true|false|null)\b', Keyword.Constant),
             (r'\$\{\$+[a-zA-Z_][a-zA-Z0-9_]*\}', Name.Variable),
             (r'\$+[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
-            ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Other),
+            (r'[\\a-zA-Z_][\\a-zA-Z0-9_]*', Name.Other),
             (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
              r"0[xX][0-9a-fA-F]+[Ll]?", Number),
             (r"'([^'\\]*(?:\\.[^'\\]*)*)'", String.Single),
@@ -532,7 +755,7 @@ class PhpLexer(RegexLexer):
             (r'"', String.Double, 'string'),
         ],
         'classname': [
-            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
+            (r'[a-zA-Z_][\\a-zA-Z0-9_]*', Name.Class, '#pop')
         ],
         'functionname': [
             (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Function, '#pop')
@@ -680,7 +903,6 @@ class XsltLexer(XmlLexer):
             return 0.8
 
 
-
 class MxmlLexer(RegexLexer):
     """
     For MXML markup.
@@ -721,3 +943,677 @@ class MxmlLexer(RegexLexer):
                 (r'[^\s>]+', String, '#pop'),
             ],
         }
+
+
+class HaxeLexer(RegexLexer):
+    """
+    For haXe source code (http://haxe.org/).
+    """
+
+    name = 'haXe'
+    aliases = ['hx', 'haXe']
+    filenames = ['*.hx']
+    mimetypes = ['text/haxe']
+
+    ident = r'(?:[a-zA-Z_][a-zA-Z0-9_]*)'
+    typeid = r'(?:(?:[a-z0-9_\.])*[A-Z_][A-Za-z0-9_]*)'
+    key_prop = r'(?:default|null|never)'
+    key_decl_mod = r'(?:public|private|override|static|inline|extern|dynamic)'
+
+    flags = re.DOTALL | re.MULTILINE
+
+    tokens = {
+        'root': [
+            include('whitespace'),
+            include('comments'),
+            (key_decl_mod, Keyword.Declaration),
+            include('enumdef'),
+            include('typedef'),
+            include('classdef'),
+            include('imports'),
+        ],
+
+        # General constructs
+        'comments': [
+            (r'//.*?\n', Comment.Single),
+            (r'/\*.*?\*/', Comment.Multiline),
+            (r'#[^\n]*', Comment.Preproc),
+        ],
+        'whitespace': [
+            include('comments'),
+            (r'\s+', Text),
+        ],
+        'codekeywords': [
+            (r'\b(if|else|while|do|for|in|break|continue|'
+             r'return|switch|case|try|catch|throw|null|trace|'
+             r'new|this|super|untyped|cast|callback|here)\b',
+             Keyword.Reserved),
+        ],
+        'literals': [
+            (r'0[xX][0-9a-fA-F]+', Number.Hex),
+            (r'[0-9]+', Number.Integer),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r'~/([^\n])*?/[gisx]*', String.Regex),
+            (r'\b(true|false|null)\b', Keyword.Constant),
+        ],
+        'codeblock': [
+          include('whitespace'),
+          include('new'),
+          include('case'),
+          include('anonfundef'),
+          include('literals'),
+          include('vardef'),
+          include('codekeywords'),
+          (r'[();,\[\]]', Punctuation),
+          (r'(?:=|\+=|-=|\*=|/=|%=|&=|\|=|\^=|<<=|>>=|>>>=|\|\||&&|'
+           r'\.\.\.|==|!=|>|<|>=|<=|\||&|\^|<<|>>|>>>|\+|\-|\*|/|%|'
+           r'!|\+\+|\-\-|~|\.|\?|\:)',
+           Operator),
+          (ident, Name),
+
+          (r'}', Punctuation,'#pop'),
+          (r'{', Punctuation,'#push'),
+        ],
+
+        # Instance/Block level constructs
+        'propertydef': [
+            (r'(\()(' + key_prop + ')(,)(' + key_prop + ')(\))',
+             bygroups(Punctuation, Keyword.Reserved, Punctuation,
+                      Keyword.Reserved, Punctuation)),
+        ],
+        'new': [
+            (r'\bnew\b', Keyword, 'typedecl'),
+        ],
+        'case': [
+            (r'\b(case)(\s+)(' + ident + ')(\s*)(\()',
+             bygroups(Keyword.Reserved, Text, Name, Text, Punctuation),
+             'funargdecl'),
+        ],
+        'vardef': [
+            (r'\b(var)(\s+)(' + ident + ')',
+             bygroups(Keyword.Declaration, Text, Name.Variable), 'vardecl'),
+        ],
+        'vardecl': [
+            include('whitespace'),
+            include('typelabel'),
+            (r'=', Operator,'#pop'),
+            (r';', Punctuation,'#pop'),
+        ],
+        'instancevardef': [
+            (key_decl_mod,Keyword.Declaration),
+            (r'\b(var)(\s+)(' + ident + ')',
+             bygroups(Keyword.Declaration, Text, Name.Variable.Instance),
+             'instancevardecl'),
+        ],
+        'instancevardecl': [
+            include('vardecl'),
+            include('propertydef'),
+        ],
+
+        'anonfundef': [
+            (r'\bfunction\b', Keyword.Declaration, 'fundecl'),
+        ],
+        'instancefundef': [
+            (key_decl_mod, Keyword.Declaration),
+            (r'\b(function)(\s+)(' + ident + ')',
+             bygroups(Keyword.Declaration, Text, Name.Function), 'fundecl'),
+        ],
+        'fundecl': [
+            include('whitespace'),
+            include('typelabel'),
+            include('generictypedecl'),
+            (r'\(',Punctuation,'funargdecl'),
+            (r'(?=[a-zA-Z0-9_])',Text,'#pop'),
+            (r'{',Punctuation,('#pop','codeblock')),
+            (r';',Punctuation,'#pop'),
+        ],
+        'funargdecl': [
+            include('whitespace'),
+            (ident, Name.Variable),
+            include('typelabel'),
+            include('literals'),
+            (r'=', Operator),
+            (r',', Punctuation),
+            (r'\?', Punctuation),
+            (r'\)', Punctuation, '#pop'),
+        ],
+
+        'typelabel': [
+            (r':', Punctuation, 'type'),
+        ],
+        'typedecl': [
+            include('whitespace'),
+            (typeid, Name.Class),
+            (r'<', Punctuation, 'generictypedecl'),
+            (r'(?=[{}()=,a-z])', Text,'#pop'),
+        ],
+        'type': [
+            include('whitespace'),
+            (typeid, Name.Class),
+            (r'<', Punctuation, 'generictypedecl'),
+            (r'->', Keyword.Type),
+            (r'(?=[{}(),;=])', Text, '#pop'),
+        ],
+        'generictypedecl': [
+            include('whitespace'),
+            (typeid, Name.Class),
+            (r'<', Punctuation, '#push'),
+            (r'>', Punctuation, '#pop'),
+            (r',', Punctuation),
+        ],
+
+        # Top level constructs
+        'imports': [
+            (r'(package|import|using)(\s+)([^;]+)(;)',
+             bygroups(Keyword.Namespace, Text, Name.Namespace,Punctuation)),
+        ],
+        'typedef': [
+            (r'typedef', Keyword.Declaration, ('typedefprebody', 'typedecl')),
+        ],
+        'typedefprebody': [
+            include('whitespace'),
+            (r'(=)(\s*)({)', bygroups(Punctuation, Text, Punctuation),
+             ('#pop', 'typedefbody')),
+        ],
+        'enumdef': [
+            (r'enum', Keyword.Declaration, ('enumdefprebody', 'typedecl')),
+        ],
+        'enumdefprebody': [
+            include('whitespace'),
+            (r'{', Punctuation, ('#pop','enumdefbody')),
+        ],
+        'classdef': [
+            (r'class', Keyword.Declaration, ('classdefprebody', 'typedecl')),
+        ],
+        'classdefprebody': [
+            include('whitespace'),
+            (r'(extends|implements)', Keyword.Declaration,'typedecl'),
+            (r'{', Punctuation, ('#pop', 'classdefbody')),
+        ],
+        'interfacedef': [
+            (r'interface', Keyword.Declaration,
+             ('interfacedefprebody', 'typedecl')),
+        ],
+        'interfacedefprebody': [
+            include('whitespace'),
+            (r'(extends)', Keyword.Declaration, 'typedecl'),
+            (r'{', Punctuation, ('#pop', 'classdefbody')),
+        ],
+
+        'typedefbody': [
+          include('whitespace'),
+          include('instancevardef'),
+          include('instancefundef'),
+          (r'>', Punctuation, 'typedecl'),
+          (r',', Punctuation),
+          (r'}', Punctuation, '#pop'),
+        ],
+        'enumdefbody': [
+          include('whitespace'),
+          (ident, Name.Variable.Instance),
+          (r'\(', Punctuation, 'funargdecl'),
+          (r';', Punctuation),
+          (r'}', Punctuation, '#pop'),
+        ],
+        'classdefbody': [
+          include('whitespace'),
+          include('instancevardef'),
+          include('instancefundef'),
+          (r'}', Punctuation, '#pop'),
+          include('codeblock'),
+        ],
+    }
+
+    def analyse_text(text):
+        if re.match(r'\w+\s*:\s*\w', text): return 0.3
+
+
+def _indentation(lexer, match, ctx):
+    indentation = match.group(0)
+    yield match.start(), Text, indentation
+    ctx.last_indentation = indentation
+    ctx.pos = match.end()
+
+    if hasattr(ctx, 'block_state') and ctx.block_state and \
+            indentation.startswith(ctx.block_indentation) and \
+            indentation != ctx.block_indentation:
+        ctx.stack.append(ctx.block_state)
+    else:
+        ctx.block_state = None
+        ctx.block_indentation = None
+        ctx.stack.append('content')
+
+def _starts_block(token, state):
+    def callback(lexer, match, ctx):
+        yield match.start(), token, match.group(0)
+
+        if hasattr(ctx, 'last_indentation'):
+            ctx.block_indentation = ctx.last_indentation
+        else:
+            ctx.block_indentation = ''
+
+        ctx.block_state = state
+        ctx.pos = match.end()
+
+    return callback
+
+
+class HamlLexer(ExtendedRegexLexer):
+    """
+    For Haml markup.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Haml'
+    aliases = ['haml', 'HAML']
+    filenames = ['*.haml']
+    mimetypes = ['text/x-haml']
+
+    flags = re.IGNORECASE
+    # Haml can include " |\n" anywhere,
+    # which is ignored and used to wrap long lines.
+    # To accomodate this, use this custom faux dot instead.
+    _dot = r'(?: \|\n(?=.* \|)|.)'
+    tokens = {
+        'root': [
+            (r'[ \t]*\n', Text),
+            (r'[ \t]*', _indentation),
+        ],
+
+        'css': [
+            (r'\.[a-z0-9_:-]+', Name.Class, 'tag'),
+            (r'\#[a-z0-9_:-]+', Name.Function, 'tag'),
+        ],
+
+        'eval-or-plain': [
+            (r'[&!]?==', Punctuation, 'plain'),
+            (r'([&!]?[=~])(' + _dot + '*\n)',
+             bygroups(Punctuation, using(RubyLexer)),
+             'root'),
+            (r'', Text, 'plain'),
+        ],
+
+        'content': [
+            include('css'),
+            (r'%[a-z0-9_:-]+', Name.Tag, 'tag'),
+            (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
+            (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
+             bygroups(Comment, Comment.Special, Comment),
+             '#pop'),
+            (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
+             '#pop'),
+            (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
+                                                 'haml-comment-block'), '#pop'),
+            (r'(-)(' + _dot + '*\n)',
+             bygroups(Punctuation, using(RubyLexer)),
+             '#pop'),
+            (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
+             '#pop'),
+            include('eval-or-plain'),
+        ],
+
+        'tag': [
+            include('css'),
+            (r'\{(,\n|' + _dot + ')*?\}', using(RubyLexer)),
+            (r'\[' + _dot + '*?\]', using(RubyLexer)),
+            (r'\(', Text, 'html-attributes'),
+            (r'/[ \t]*\n', Punctuation, '#pop:2'),
+            (r'[<>]{1,2}(?=[ \t=])', Punctuation),
+            include('eval-or-plain'),
+        ],
+
+        'plain': [
+            (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Text),
+            (r'(#\{)(' + _dot + '*?)(\})',
+             bygroups(String.Interpol, using(RubyLexer), String.Interpol)),
+            (r'\n', Text, 'root'),
+        ],
+
+        'html-attributes': [
+            (r'\s+', Text),
+            (r'[a-z0-9_:-]+[ \t]*=', Name.Attribute, 'html-attribute-value'),
+            (r'[a-z0-9_:-]+', Name.Attribute),
+            (r'\)', Text, '#pop'),
+        ],
+
+        'html-attribute-value': [
+            (r'[ \t]+', Text),
+            (r'[a-z0-9_]+', Name.Variable, '#pop'),
+            (r'@[a-z0-9_]+', Name.Variable.Instance, '#pop'),
+            (r'\$[a-z0-9_]+', Name.Variable.Global, '#pop'),
+            (r"'(\\\\|\\'|[^'\n])*'", String, '#pop'),
+            (r'"(\\\\|\\"|[^"\n])*"', String, '#pop'),
+        ],
+
+        'html-comment-block': [
+            (_dot + '+', Comment),
+            (r'\n', Text, 'root'),
+        ],
+
+        'haml-comment-block': [
+            (_dot + '+', Comment.Preproc),
+            (r'\n', Text, 'root'),
+        ],
+
+        'filter-block': [
+            (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Name.Decorator),
+            (r'(#\{)(' + _dot + '*?)(\})',
+             bygroups(String.Interpol, using(RubyLexer), String.Interpol)),
+            (r'\n', Text, 'root'),
+        ],
+    }
+
+
+class SassLexer(ExtendedRegexLexer):
+    """
+    For Sass stylesheets.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Sass'
+    aliases = ['sass', 'SASS']
+    filenames = ['*.sass']
+    mimetypes = ['text/x-sass']
+
+    flags = re.IGNORECASE
+    tokens = {
+        'root': [
+            (r'[ \t]*\n', Text),
+            (r'[ \t]*', _indentation),
+        ],
+
+        'content': [
+            (r'//[^\n]*', _starts_block(Comment.Single, 'single-comment'),
+             'root'),
+            (r'/\*[^\n]*', _starts_block(Comment.Multiline, 'multi-comment'),
+             'root'),
+            (r'@import', Keyword, 'import'),
+            (r'@for', Keyword, 'for'),
+            (r'@(debug|if|while)', Keyword, 'script'),
+            (r'@[a-z0-9_-]+', Keyword, 'selector'),
+            (r'=[\w-]+', Name.Function, 'script'),
+            (r'\+[\w-]+', Name.Decorator, 'script'),
+            (r'(![a-z_]\w*)([ \t]*(?:\|\|)?=)',
+             bygroups(Name.Variable, Operator), 'script'),
+            (r':', Name.Attribute, 'old-style-attr'),
+            (r'(?=[^\s:"\[]+\s*[=:]([ \t]|$))', Name.Attribute, 'new-style-attr'),
+            (r'', Text, 'selector'),
+        ],
+
+        'single-comment': [
+            (r'.+', Comment.Single),
+            (r'\n', Text, 'root'),
+        ],
+
+        'multi-comment': [
+            (r'.+', Comment.Multiline),
+            (r'\n', Text, 'root'),
+        ],
+
+        'import': [
+            (r'[ \t]+', Text),
+            (r'[^\s]+', String),
+            (r'\n', Text, 'root'),
+        ],
+
+        'for': [
+            (r'(from|to|through)', Operator.Word),
+            include('script'),
+        ],
+
+        'old-style-attr': [
+            (r'[^\s:="\[]+', Name.Attribute),
+            (r'#{', String.Interpol, 'interpolation'),
+            (r'[ \t]*=', Operator, 'script'),
+            (r'', Text, 'value'),
+        ],
+
+        'new-style-attr': [
+            (r'[^\s:="\[]+', Name.Attribute),
+            (r'#{', String.Interpol, 'interpolation'),
+            (r'[ \t]*=', Operator, 'script'),
+            (r':', Name.Attribute, 'value'),
+        ],
+
+        'value': [
+            (r'[ \t]+', Text),
+            (r'url\(', String.Other, 'string-url'),
+            (r'(azimuth|background-attachment|background-color|'
+             r'background-image|background-position|background-repeat|'
+             r'background|border-bottom-color|border-bottom-style|'
+             r'border-bottom-width|border-left-color|border-left-style|'
+             r'border-left-width|border-right|border-right-color|'
+             r'border-right-style|border-right-width|border-top-color|'
+             r'border-top-style|border-top-width|border-bottom|'
+             r'border-collapse|border-left|border-width|border-color|'
+             r'border-spacing|border-style|border-top|border|caption-side|'
+             r'clear|clip|color|content|counter-increment|counter-reset|'
+             r'cue-after|cue-before|cue|cursor|direction|display|'
+             r'elevation|empty-cells|float|font-family|font-size|'
+             r'font-size-adjust|font-stretch|font-style|font-variant|'
+             r'font-weight|font|height|letter-spacing|line-height|'
+             r'list-style-type|list-style-image|list-style-position|'
+             r'list-style|margin-bottom|margin-left|margin-right|'
+             r'margin-top|margin|marker-offset|marks|max-height|max-width|'
+             r'min-height|min-width|opacity|orphans|outline|outline-color|'
+             r'outline-style|outline-width|overflow|padding-bottom|'
+             r'padding-left|padding-right|padding-top|padding|page|'
+             r'page-break-after|page-break-before|page-break-inside|'
+             r'pause-after|pause-before|pause|pitch|pitch-range|'
+             r'play-during|position|quotes|richness|right|size|'
+             r'speak-header|speak-numeral|speak-punctuation|speak|'
+             r'speech-rate|stress|table-layout|text-align|text-decoration|'
+             r'text-indent|text-shadow|text-transform|top|unicode-bidi|'
+             r'vertical-align|visibility|voice-family|volume|white-space|'
+             r'widows|width|word-spacing|z-index|bottom|left|'
+             r'above|absolute|always|armenian|aural|auto|avoid|baseline|'
+             r'behind|below|bidi-override|blink|block|bold|bolder|both|'
+             r'capitalize|center-left|center-right|center|circle|'
+             r'cjk-ideographic|close-quote|collapse|condensed|continuous|'
+             r'crop|crosshair|cross|cursive|dashed|decimal-leading-zero|'
+             r'decimal|default|digits|disc|dotted|double|e-resize|embed|'
+             r'extra-condensed|extra-expanded|expanded|fantasy|far-left|'
+             r'far-right|faster|fast|fixed|georgian|groove|hebrew|help|'
+             r'hidden|hide|higher|high|hiragana-iroha|hiragana|icon|'
+             r'inherit|inline-table|inline|inset|inside|invert|italic|'
+             r'justify|katakana-iroha|katakana|landscape|larger|large|'
+             r'left-side|leftwards|level|lighter|line-through|list-item|'
+             r'loud|lower-alpha|lower-greek|lower-roman|lowercase|ltr|'
+             r'lower|low|medium|message-box|middle|mix|monospace|'
+             r'n-resize|narrower|ne-resize|no-close-quote|no-open-quote|'
+             r'no-repeat|none|normal|nowrap|nw-resize|oblique|once|'
+             r'open-quote|outset|outside|overline|pointer|portrait|px|'
+             r'relative|repeat-x|repeat-y|repeat|rgb|ridge|right-side|'
+             r'rightwards|s-resize|sans-serif|scroll|se-resize|'
+             r'semi-condensed|semi-expanded|separate|serif|show|silent|'
+             r'slow|slower|small-caps|small-caption|smaller|soft|solid|'
+             r'spell-out|square|static|status-bar|super|sw-resize|'
+             r'table-caption|table-cell|table-column|table-column-group|'
+             r'table-footer-group|table-header-group|table-row|'
+             r'table-row-group|text|text-bottom|text-top|thick|thin|'
+             r'transparent|ultra-condensed|ultra-expanded|underline|'
+             r'upper-alpha|upper-latin|upper-roman|uppercase|url|'
+             r'visible|w-resize|wait|wider|x-fast|x-high|x-large|x-loud|'
+             r'x-low|x-small|x-soft|xx-large|xx-small|yes)\b', Name.Constant),
+            (r'(indigo|gold|firebrick|indianred|yellow|darkolivegreen|'
+             r'darkseagreen|mediumvioletred|mediumorchid|chartreuse|'
+             r'mediumslateblue|black|springgreen|crimson|lightsalmon|brown|'
+             r'turquoise|olivedrab|cyan|silver|skyblue|gray|darkturquoise|'
+             r'goldenrod|darkgreen|darkviolet|darkgray|lightpink|teal|'
+             r'darkmagenta|lightgoldenrodyellow|lavender|yellowgreen|thistle|'
+             r'violet|navy|orchid|blue|ghostwhite|honeydew|cornflowerblue|'
+             r'darkblue|darkkhaki|mediumpurple|cornsilk|red|bisque|slategray|'
+             r'darkcyan|khaki|wheat|deepskyblue|darkred|steelblue|aliceblue|'
+             r'gainsboro|mediumturquoise|floralwhite|coral|purple|lightgrey|'
+             r'lightcyan|darksalmon|beige|azure|lightsteelblue|oldlace|'
+             r'greenyellow|royalblue|lightseagreen|mistyrose|sienna|'
+             r'lightcoral|orangered|navajowhite|lime|palegreen|burlywood|'
+             r'seashell|mediumspringgreen|fuchsia|papayawhip|blanchedalmond|'
+             r'peru|aquamarine|white|darkslategray|ivory|dodgerblue|'
+             r'lemonchiffon|chocolate|orange|forestgreen|slateblue|olive|'
+             r'mintcream|antiquewhite|darkorange|cadetblue|moccasin|'
+             r'limegreen|saddlebrown|darkslateblue|lightskyblue|deeppink|'
+             r'plum|aqua|darkgoldenrod|maroon|sandybrown|magenta|tan|'
+             r'rosybrown|pink|lightblue|palevioletred|mediumseagreen|'
+             r'dimgray|powderblue|seagreen|snow|mediumblue|midnightblue|'
+             r'paleturquoise|palegoldenrod|whitesmoke|darkorchid|salmon|'
+             r'lightslategray|lawngreen|lightgreen|tomato|hotpink|'
+             r'lightyellow|lavenderblush|linen|mediumaquamarine|green|'
+             r'blueviolet|peachpuff)\b', Name.Entity),
+            (r'\!important', Name.Exception),
+            (r'/\*', Comment, 'inline-comment'),
+            (r'\#[a-z0-9]{1,6}', Number.Hex),
+            (r'(-?\d+)(\%|[a-z]+)?', bygroups(Number.Integer, Keyword.Type)),
+            (r'(-?\d*\.\d+)(\%|[a-z]+)?', bygroups(Number.Float, Keyword.Type)),
+            (r'#{', String.Interpol, 'interpolation'),
+            (r'[~\^\*!&%<>\|+=@:,./?-]+', Operator),
+            (r'[\[\]();]+', Punctuation),
+            (r'"', String.Double, 'string-double'),
+            (r"'", String.Single, 'string-single'),
+            (r'[a-z][\w-]*', Name),
+            (r'\n', Text, 'root'),
+        ],
+
+        'script': [
+            (r'[ \t]+', Text),
+            (r'![\w_]+', Name.Variable),
+            (r'[+\-*/%=(),!><]', Operator),
+            (r'"', String.Double, 'string-double'),
+            (r"'", String.Single, 'string-single'),
+            (r'\#[a-z0-9]{1,6}', Number.Hex),
+            (r'(-?\d+)(\%|[a-z]+)?', bygroups(Number.Integer, Keyword.Type)),
+            (r'(-?\d*\.\d+)(\%|[a-z]+)?', bygroups(Number.Float, Keyword.Type)),
+            (r'(black|silver|gray|white|maroon|red|purple|fuchsia|green|'
+             r'lime|olive|yellow|navy|blue|teal|aqua)\b', Name.Builtin),
+            (r'(true|false)', Name.Pseudo),
+            (r'(and|or|not)', Operator.Word),
+            (r'(\\.|[^\s\\+*\/%(),=!])+(?=[ \t]*\()', Name.Function),
+            (r'(\\.|[^\s\\+*\/%(),=!])+', Name),
+            (r'\n', Text, 'root'),
+        ],
+
+        'interpolation': [
+            (r'\}', String.Interpol, '#pop'),
+            include('script'),
+        ],
+
+        'selector': [
+            (r'[ \t]+', Text),
+            (r'\:', Name.Decorator, 'pseudo-class'),
+            (r'\.', Name.Class, 'class'),
+            (r'\#', Name.Namespace, 'id'),
+            (r'[a-zA-Z0-9_-]+', Name.Tag),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'&', Keyword),
+            (r'[~\^\*!&\[\]\(\)<>\|+=@:;,./?-]', Operator),
+            (r'"', String.Double, 'string-double'),
+            (r"'", String.Single, 'string-single'),
+            (r'\n', Text, 'root'),
+        ],
+
+        'string-double': [
+            (r'(\\.|#(?=[^\n{])|[^\n"#])+', String.Double),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'"', String.Double, '#pop'),
+        ],
+
+        'string-single': [
+            (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Double),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r"'", String.Double, '#pop'),
+        ],
+
+        'string-url': [
+            (r'(\\#|#(?=[^\n{])|[^\n#)])+', String.Other),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'\)', String.Other, '#pop'),
+        ],
+
+        'inline-comment': [
+            (r"(\\#|#(?=[^\n{])|\*(?=[^\n/])|[^\n#*])+", Comment),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r"\*/", Comment, '#pop'),
+        ],
+
+        'pseudo-class': [
+            (r'[\w-]+', Name.Decorator),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'', Text, '#pop'),
+        ],
+
+        'class': [
+            (r'[\w-]+', Name.Class),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'', Text, '#pop'),
+        ],
+
+        'id': [
+            (r'[\w-]+', Name.Namespace),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'', Text, '#pop'),
+        ],
+    }
+
+
+class CoffeeScriptLexer(RegexLexer):
+    """
+    For `CoffeeScript`_ source code.
+
+    .. _CoffeeScript: http://jashkenas.github.com/coffee-script/
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'CoffeeScript'
+    aliases = ['coffee-script', 'coffeescript']
+    filenames = ['*.coffee']
+    mimetypes = ['text/coffeescript']
+
+    flags = re.DOTALL
+    tokens = {
+        'commentsandwhitespace': [
+            (r'\s+', Text),
+            (r'#.*?\n', Comment.Single),
+        ],
+        'slashstartsregex': [
+            include('commentsandwhitespace'),
+            (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
+             r'([gim]+\b|\B)', String.Regex, '#pop'),
+            (r'(?=/)', Text, ('#pop', 'badregex')),
+            (r'', Text, '#pop'),
+        ],
+        'badregex': [
+            ('\n', Text, '#pop'),
+        ],
+        'root': [
+            (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
+            include('commentsandwhitespace'),
+            (r'\+\+|--|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|'
+             r'\|\||\\(?=\n)|(<<|>>>?|==?|!=?|[-<>+*`%&\|\^/])=?',
+             Operator, 'slashstartsregex'),
+            (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
+            (r'[})\].]', Punctuation),
+            (r'(for|in|of|while|break|return|continue|switch|when|then|if|else|'
+             r'throw|try|catch|finally|new|delete|typeof|instanceof|super|'
+             r'extends|this)\b', Keyword, 'slashstartsregex'),
+            (r'(true|false|yes|no|on|off|null|NaN|Infinity|undefined)\b',
+             Keyword.Constant),
+            (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
+             r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
+             r'decodeURIComponent|encodeURI|encodeURIComponent|'
+             r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
+             r'window)\b', Name.Builtin),
+            (r'[$a-zA-Z_][a-zA-Z0-9_\.:]*:\s', Name.Variable,
+             'slashstartsregex'),
+            (r'[$a-zA-Z_][a-zA-Z0-9_]*', Name.Other),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r'0x[0-9a-fA-F]+', Number.Hex),
+            (r'[0-9]+', Number.Integer),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+        ]
+    }
index f0a6541a026762e578b5af890f475a0fa1e89068..4815ddfbf86fdc6c75bda07d3b852b235d2eb739 100644 (file)
@@ -8,11 +8,6 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
-try:
-    set
-except NameError:
-    from sets import Set as set
-
 
 class _TokenType(tuple):
     parent = None
index fc65b676618741d87001c49c77164ea4a66792ec..1bd1455f2733ec2c04946e627adba85d057a3481 100644 (file)
@@ -8,8 +8,10 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
+
 import re
 import sys
+import codecs
 
 
 split_path_re = re.compile(r'[/\\ ]')
@@ -206,6 +208,7 @@ if sys.version_info < (3,0):
     import StringIO, cStringIO
     BytesIO = cStringIO.StringIO
     StringIO = StringIO.StringIO
+    uni_open = codecs.open
 else:
     import builtins
     bytes = builtins.bytes
@@ -220,3 +223,4 @@ else:
     import io
     BytesIO = io.BytesIO
     StringIO = io.StringIO
+    uni_open = builtins.open
old mode 100644 (file)
new mode 100755 (executable)
index a3cdad4..6b82fcd
@@ -18,42 +18,148 @@ try:
     import pygments
 except ImportError:
     # try parent path
-    sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
+    sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
 
-from pygments import highlight
+
+from pygments.lexer import RegexLexer
 from pygments.lexers import get_lexer_for_filename, get_lexer_by_name
-from pygments.token import Error
+from pygments.token import Error, Text, _TokenType
+
+
+class DebuggingRegexLexer(RegexLexer):
+    """Make the state stack, position and current match instance attributes."""
+
+    def get_tokens_unprocessed(self, text, stack=('root',)):
+        """
+        Split ``text`` into (tokentype, text) pairs.
 
-def main(fn):
-    try:
-        lx = get_lexer_for_filename(fn)
-    except ValueError:
+        ``stack`` is the inital stack (default: ``['root']``)
+        """
+        self.pos = 0
+        tokendefs = self._tokens
+        self.statestack = list(stack)
+        statetokens = tokendefs[self.statestack[-1]]
+        while 1:
+            for rexmatch, action, new_state in statetokens:
+                self.m = m = rexmatch(text, self.pos)
+                if m:
+                    if type(action) is _TokenType:
+                        yield self.pos, action, m.group()
+                    else:
+                        for item in action(self, m):
+                            yield item
+                    self.pos = m.end()
+                    if new_state is not None:
+                        # state transition
+                        if isinstance(new_state, tuple):
+                            for state in new_state:
+                                if state == '#pop':
+                                    self.statestack.pop()
+                                elif state == '#push':
+                                    self.statestack.append(self.statestack[-1])
+                                else:
+                                    self.statestack.append(state)
+                        elif isinstance(new_state, int):
+                            # pop
+                            del self.statestack[new_state:]
+                        elif new_state == '#push':
+                            self.statestack.append(self.statestack[-1])
+                        else:
+                            assert False, 'wrong state def: %r' % new_state
+                        statetokens = tokendefs[self.statestack[-1]]
+                    break
+            else:
+                try:
+                    if text[self.pos] == '\n':
+                        # at EOL, reset state to 'root'
+                        self.pos += 1
+                        self.statestack = ['root']
+                        statetokens = tokendefs['root']
+                        yield self.pos, Text, u'\n'
+                        continue
+                    yield self.pos, Error, text[self.pos]
+                    self.pos += 1
+                except IndexError:
+                    break
+
+
+def main(fn, lexer=None):
+    if lexer is not None:
+        lx = get_lexer_by_name(lexer)
+    else:
         try:
-            name, rest = fn.split("_", 1)
-            lx = get_lexer_by_name(name)
+            lx = get_lexer_for_filename(os.path.basename(fn))
         except ValueError:
-            raise AssertionError('no lexer found for file %r' % fn)
+            try:
+                name, rest = fn.split('_', 1)
+                lx = get_lexer_by_name(name)
+            except ValueError:
+                raise AssertionError('no lexer found for file %r' % fn)
+    debug_lexer = False
+    # does not work for e.g. ExtendedRegexLexers
+    if lx.__class__.__bases__ == (RegexLexer,):
+        lx.__class__.__bases__ = (DebuggingRegexLexer,)
+        debug_lexer = True
+    lno = 1
     text = file(fn, 'U').read()
     text = text.strip('\n') + '\n'
     text = text.decode('latin1')
-    ntext = []
+    tokens = []
+    states = []
+
+    def show_token(tok, state):
+        reprs = map(repr, tok)
+        print '   ' + reprs[1] + ' ' + ' ' * (29-len(reprs[1])) + reprs[0],
+        if debug_lexer:
+            print ' ' + ' ' * (29-len(reprs[0])) + repr(state),
+        print
+
     for type, val in lx.get_tokens(text):
+        lno += val.count('\n')
         if type == Error:
-            print "Error parsing", fn
-            print "\n".join(['   ' + repr(x) for x in ntext[-num:]])
-            print `val` + "<<<"
+            print 'Error parsing', fn, 'on line', lno
+            print 'Previous tokens' + (debug_lexer and ' and states' or '') + ':'
+            if showall:
+                for tok, state in zip(tokens, states):
+                    show_token(tok, state)
+            else:
+                for i in range(len(tokens) - num, len(tokens)):
+                    show_token(tokens[i], states[i])
+            print 'Error token:'
+            l = len(repr(val))
+            print '   ' + repr(val),
+            if debug_lexer and hasattr(lx, 'statestack'):
+                print ' ' * (60-l) + repr(lx.statestack),
+            print
+            print
             return 1
-        ntext.append((type,val))
+        tokens.append((type,val))
+        if debug_lexer:
+            if hasattr(lx, 'statestack'):
+                states.append(lx.statestack[:])
+            else:
+                states.append(None)
+    if showall:
+        for tok, state in zip(tokens, states):
+            show_token(tok, state)
     return 0
 
 
 num = 10
+showall = False
+lexer = None
 
-if __name__ == "__main__":
-    if sys.argv[1][:2] == '-n':
-        num = int(sys.argv[1][2:])
-        del sys.argv[1]
+if __name__ == '__main__':
+    import getopt
+    opts, args = getopt.getopt(sys.argv[1:], 'n:l:a')
+    for opt, val in opts:
+        if opt == '-n':
+            num = int(val)
+        elif opt == '-a':
+            showall = True
+        elif opt == '-l':
+            lexer = val
     ret = 0
-    for f in sys.argv[1:]:
-        ret += main(f)
+    for f in args:
+        ret += main(f, lexer)
     sys.exit(bool(ret))
index 6a863b9ebe3e40f4c064f7d4c80baf743f4ad8db..eda31b57aa7c65dbae4cea7d9c4ac17c84200647 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -29,6 +29,7 @@
 
 try:
     from setuptools import setup, find_packages
+    have_setuptools = True
 except ImportError:
     from distutils.core import setup
     def find_packages():
@@ -39,15 +40,27 @@ except ImportError:
             'pygments.styles',
             'pygments.filters',
         ]
+    have_setuptools = False
 
 try:
     from distutils.command.build_py import build_py_2to3 as build_py
 except ImportError:
     from distutils.command.build_py import build_py
 
+if have_setuptools:
+    add_keywords = dict(
+        entry_points = {
+            'console_scripts': ['pygmentize = pygments.cmdline:main'],
+        },
+    )
+else:
+    add_keywords = dict(
+        scripts = ['pygmentize'],
+    )
+
 setup(
     name = 'Pygments',
-    version = '1.2.2',
+    version = '1.3',
     url = 'http://pygments.org/',
     license = 'BSD License',
     author = 'Georg Brandl',
@@ -56,7 +69,6 @@ setup(
     long_description = __doc__,
     keywords = 'syntax highlighting',
     packages = find_packages(),
-    scripts = ['pygmentize'],
     platforms = 'any',
     zip_safe = False,
     include_package_data = True,
@@ -72,4 +84,5 @@ setup(
         'Operating System :: OS Independent',
     ],
     cmdclass = {'build_py': build_py},
+    **add_keywords
 )
diff --git a/tests/examplefiles/CPDictionary.j b/tests/examplefiles/CPDictionary.j
new file mode 100755 (executable)
index 0000000..50243f1
--- /dev/null
@@ -0,0 +1,611 @@
+/*
+ * CPDictionary.j
+ * Foundation
+ *
+ * Created by Francisco Tolmasky.
+ * Copyright 2008, 280 North, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+//@import "CPRange.j"
+@import "CPObject.j"
+@import "CPEnumerator.j"
+@import "CPException.j"
+
+/* @ignore */
+@implementation _CPDictionaryValueEnumerator : CPEnumerator
+{
+    CPEnumerator    _keyEnumerator;
+    CPDictionary    _dictionary;
+}
+
+- (id)initWithDictionary:(CPDictionary)aDictionary
+{
+    self = [super init];
+    
+    if (self)
+    {
+        _keyEnumerator = [aDictionary keyEnumerator];
+        _dictionary = aDictionary;
+    }
+    
+    return self;
+}
+
+- (id)nextObject
+{
+    var key = [_keyEnumerator nextObject];
+    
+    if (!key)
+        return nil;
+
+    return [_dictionary objectForKey:key];
+}
+
+@end
+
+/*! 
+    @class CPDictionary
+    @ingroup foundation
+    @brief A mutable key-value pair collection.
+
+    A dictionary is the standard way of passing around key-value pairs in
+    the Cappuccino framework. It is similar to the
+    <a href="http://java.sun.com/javase/6/docs/api/index.html">Java map interface</a>,
+    except all keys are CPStrings and values can be any
+    Cappuccino or JavaScript object.
+
+    If you are familiar with dictionaries in Cocoa, you'll notice that
+    there is no CPMutableDictionary class. The regular CPDictionary
+    has \c -setObject:forKey: and \c -removeObjectForKey: methods.
+    In Cappuccino there is no distinction between immutable and mutable classes.
+    They are all mutable.
+*/
+@implementation CPDictionary : CPObject
+{
+}
+
+/*
+    @ignore
+*/
++ (id)alloc
+{
+    return new objj_dictionary();
+}
+
+/*!
+    Returns a new empty CPDictionary.
+*/
++ (id)dictionary
+{
+    return [[self alloc] init];
+}
+
+/*!
+    Returns a new dictionary, initialized with the contents of \c aDictionary.
+    @param aDictionary the dictionary to copy key-value pairs from
+    @return the new CPDictionary
+*/
++ (id)dictionaryWithDictionary:(CPDictionary)aDictionary
+{
+    return [[self alloc] initWithDictionary:aDictionary];
+}
+
+/*!
+    Creates a new dictionary with single key-value pair.
+    @param anObject the object for the paring
+    @param aKey the key for the pairing
+    @return the new CPDictionary
+*/
++ (id)dictionaryWithObject:(id)anObject forKey:(id)aKey
+{
+    return [[self alloc] initWithObjects:[anObject] forKeys:[aKey]];
+}
+
+/*!
+    Creates a dictionary with multiple key-value pairs.
+    @param objects the objects to place in the dictionary
+    @param keys the keys for each of the objects
+    @throws CPInvalidArgumentException if the number of objects and keys is different
+    @return the new CPDictionary
+*/
++ (id)dictionaryWithObjects:(CPArray)objects forKeys:(CPArray)keys
+{
+    return [[self alloc] initWithObjects:objects forKeys:keys];
+}
+
+/*!
+    Creates a dictionary with multiple key-value pairs.
+    @param JavaScript object
+    @return the new CPDictionary
+*/
++ (id)dictionaryWithJSObject:(JSObject)object
+{
+    return [self dictionaryWithJSObject:object recursively:NO];
+}
+
+/*!
+    Creates a dictionary with multiple key-value pairs, recursively.
+    @param JavaScript object
+    @return the new CPDictionary
+*/
++ (id)dictionaryWithJSObject:(JSObject)object recursively:(BOOL)recursively
+{
+    var dictionary = [[self alloc] init];
+        
+    for (var key in object)
+    {
+        var value = object[key];
+    
+        if (recursively && value.constructor === Object)
+            value = [CPDictionary dictionaryWithJSObject:value recursively:YES];
+    
+        [dictionary setObject:value forKey:key];
+    }
+    
+    return dictionary;
+}
+
+/*!
+    Creates and returns a dictionary constructed by a given pairs of keys and values.
+    @param firstObject first object value
+    @param ... key for the first object and ongoing value-key pairs for more objects.
+    @throws CPInvalidArgumentException if the number of objects and keys is different
+    @return the new CPDictionary
+    
+    Assuming that there's no object retaining in Cappuccino, you can create
+    dictionaries same way as with alloc and initWithObjectsAndKeys:
+    var dict = [CPDictionary dictionaryWithObjectsAndKeys:
+    @"value1", @"key1",
+    @"value2", @"key2"];
+    
+    Note, that there's no final nil like in Objective-C/Cocoa.
+    
+    @see [CPDictionary initWithObjectsAndKeys:]
+*/
++ (id)dictionaryWithObjectsAndKeys:(id)firstObject, ...
+{
+    arguments[0] = [self alloc];
+    arguments[1] = @selector(initWithObjectsAndKeys:);
+    
+    return objj_msgSend.apply(this, arguments);
+}
+
+/*!
+    Initializes the dictionary with the contents of another dictionary.
+    @param aDictionary the dictionary to copy key-value pairs from
+    @return the initialized dictionary
+*/
+- (id)initWithDictionary:(CPDictionary)aDictionary
+{
+    var key = "",
+        dictionary = [[CPDictionary alloc] init];
+    
+    for (key in aDictionary._buckets)
+        [dictionary setObject:[aDictionary objectForKey:key] forKey:key];
+        
+    return dictionary;
+}
+
+/*!
+    Initializes the dictionary from the arrays of keys and objects.
+    @param objects the objects to put in the dictionary
+    @param keyArray the keys for the objects to put in the dictionary
+    @throws CPInvalidArgumentException if the number of objects and keys is different
+    @return the initialized dictionary
+*/
+- (id)initWithObjects:(CPArray)objects forKeys:(CPArray)keyArray
+{
+    self = [super init];
+
+    if ([objects count] != [keyArray count])
+        [CPException raise:CPInvalidArgumentException reason:"Counts are different.("+[objects count]+"!="+[keyArray count]+")"];
+
+    if (self)
+    {
+        var i = [keyArray count];
+        
+        while (i--)
+            [self setObject:objects[i] forKey:keyArray[i]];
+    }
+    
+    return self;
+}
+
+/*!
+    Creates and returns a dictionary constructed by a given pairs of keys and values.
+    @param firstObject first object value
+    @param ... key for the first object and ongoing value-key pairs for more objects.
+    @throws CPInvalidArgumentException if the number of objects and keys is different
+    @return the new CPDictionary
+    
+    You can create dictionaries this way:
+    var dict = [[CPDictionary alloc] initWithObjectsAndKeys:
+    @"value1", @"key1",
+    @"value2", @"key2"];
+    
+    Note, that there's no final nil like in Objective-C/Cocoa.
+*/
+- (id)initWithObjectsAndKeys:(id)firstObject, ...
+{
+    var argCount = arguments.length;
+    
+    if (argCount % 2 !== 0)
+        [CPException raise:CPInvalidArgumentException reason:"Key-value count is mismatched. (" + argCount + " arguments passed)"];
+
+    self = [super init];
+    
+    if (self)
+    {
+        // The arguments array contains self and _cmd, so the first object is at position 2.
+        var index = 2;
+        
+        for(; index < argCount; index += 2)
+        {
+            var value = arguments[index];
+
+            if (value === nil)
+                break;
+
+            [self setObject:value forKey:arguments[index + 1]];
+        }
+    }
+
+    return self;
+}
+
+/*!
+    return a copy of the receiver (does not deep copy the objects contained in the dictionary).
+*/
+- (CPDictionary)copy
+{
+    return [CPDictionary dictionaryWithDictionary:self];
+}
+
+/*!
+    Returns the number of entries in the dictionary
+*/
+- (int)count
+{
+    return count;
+}
+
+/*!
+    Returns an array of keys for all the entries in the dictionary.
+*/
+- (CPArray)allKeys
+{
+    return _keys;
+}
+
+/*!
+    Returns an array of values for all the entries in the dictionary.
+*/
+- (CPArray)allValues
+{
+    var index = _keys.length,
+        values = [];
+        
+    while (index--)
+        values.push(dictionary_getValue(self, [_keys[index]]));
+
+    return values;
+}
+
+/*!
+    Returns an enumerator that enumerates over all the dictionary's keys.
+*/
+- (CPEnumerator)keyEnumerator
+{
+    return [_keys objectEnumerator];
+}
+
+/*!
+    Returns an enumerator that enumerates over all the dictionary's values.
+*/
+- (CPEnumerator)objectEnumerator
+{
+    return [[_CPDictionaryValueEnumerator alloc] initWithDictionary:self];
+}
+
+/*!
+    Compare the receiver to this dictionary, and return whether or not they are equal. 
+*/
+- (BOOL)isEqualToDictionary:(CPDictionary)aDictionary
+{
+    if (count !== [aDictionary count])
+        return NO;
+
+    var index = count;
+    while (index--)
+    {
+        var currentKey = _keys[index],
+            lhsObject = _buckets[currentKey],
+            rhsObject = aDictionary._buckets[currentKey];
+
+        if (lhsObject === rhsObject)
+            continue;
+            
+        if (lhsObject.isa && rhsObject.isa && [lhsObject respondsToSelector:@selector(isEqual:)] && [lhsObject isEqual:rhsObject])
+            continue;
+        
+        return NO;
+    }
+
+    return YES;
+}
+
+/*
+    Instance.isEqualToDictionary(aDictionary)
+    {
+        if(this.count()!=aDictionary.count()) return NO;
+        
+        var i= this._keys.count();
+        while(i--) if(this.objectForKey(this._keys[i])!=aDictionary.objectForKey(this._keys[i])) return NO;
+        
+        return YES;
+    }
+    
+    Instance.allKeys()
+    {
+        return this._keys;
+    }
+    
+    Instance.allKeysForObject(anObject)
+    {
+        var i= 0,
+            keys= CPArray.array(),
+            count= this.count();
+        
+        while((i= this._objects.indexOfObjectInRage(0, count-i))!=CPNotFound) keys.addObject(this._keys[i]);
+        
+        return keys;
+    }
+    
+    Instance.allValues()
+    {
+        return this._objects;
+    }
+    
+    Instance.keyEnumerator()
+    {
+        return this._keys.objectEnumerator();
+    }
+    
+    Instance.keysSortedByValueUsingSelector(aSelector)
+    {
+        var dictionary= this,
+            objectSelector= function(rhs)
+            {
+                return aSelector.apply(dictionary.objectForKey(this), [dictionary.objectForKey(rhs)]);
+            };
+        
+        return this._keys.sortedArrayUsingSelector(objectSelector);
+    }
+    
+    Instance.objectEnumerator()
+    {
+        return this._objects.objectEnumerator();
+    }
+*/
+/*!
+    Returns the object for the entry with key \c aKey.
+    @param aKey the key for the object's entry
+    @return the object for the entry
+*/
+- (id)objectForKey:(CPString)aKey
+{
+    var object = _buckets[aKey];
+    
+    return (object === undefined) ? nil : object;
+}
+/*
+    Instance.objectsForKeys(keys, aNotFoundMarker)
+    {
+        var i= keys.length,
+            objects= CPArray.array();
+        
+        while(i--)
+        {
+            var object= this.objectForKey(keys[i]);
+            objects.addObject(object==nil?aNotFoundMarker:object);
+        }
+        
+        return objects;
+    }
+    
+    Instance.valueForKey(aKey)
+    {
+        if(aKey.length && aKey[0]=="@") return this.objectForKey(aKey.substr(1));
+        
+        return base.valueForKey(aKey);
+    }
+    
+    //
+    
+    Instance.addEntriesFromDictionary(aDictionary)
+    {
+        var key,
+            keyEnumerator= aDictionary.keyEnumerator();
+
+        while(key= keyEnumerator.nextObject()) this.setObjectForKey(aDictionary.objectForKey(key), key);
+    }
+*/
+/*!
+    Removes all the entries from the dictionary.
+*/
+- (void)removeAllObjects
+{
+    _keys = [];
+    count = 0;
+    _buckets = {};
+}
+
+/*!
+    Removes the entry for the specified key.
+    @param aKey the key of the entry to be removed
+*/
+- (void)removeObjectForKey:(id)aKey
+{
+    dictionary_removeValue(self, aKey);
+}
+
+/*!
+    Removes each entry in allKeys from the receiver.
+    @param allKeys an array of keys that will be removed from the dictionary
+*/
+- (void)removeObjectsForKeys:(CPArray)allKeys
+{
+    var index = allKeys.length;
+
+    while (index--)
+        dictionary_removeValue(self, allKeys[index]);
+}
+
+/*
+    Instance.removeObjectForKey(aKey)
+    {
+        var entry= this._dictionary[aKey];
+        
+        if(entry)
+        {
+            var range= CPMakeRange(entry.index, 1);
+            
+            this._keys.removeObjectsInRange(range);
+            this._objects.removeObjectsInRange(range);
+        
+            delete this._dictionary[aKey];
+        }
+    }
+    
+    Instance.setDictionary(aDictionary)
+    {
+        this._keys= CPArray.arrayWithArray(aDictionary.allKeys());
+        this._objects= CPArray.arrayWithArray(aDictionary.allValues());
+        
+        this._dictionary= { };
+        
+        var i= this._keys.count();
+        while(i--) this._dictionary[this._keys[i]]= { object: this._objects[i], index: i };
+    }
+*/
+/*!
+    Adds an entry into the dictionary.
+    @param anObject the object for the entry
+    @param aKey the entry's key
+*/
+- (void)setObject:(id)anObject forKey:(id)aKey
+{
+    dictionary_setValue(self, aKey, anObject);
+}
+/*
+    Instance.setValueForKey(aValue, aKey)
+    {
+        if(!aValue) this.removeObjectForKey(aKey);
+        else this.setObjectForKey(aValue, aKey);
+    }
+    
+    Instance.copy()
+    {
+        return CPDictionary.alloc().dictionaryWithDictionary(this);
+    }
+*/
+
+/*!
+    Take all the key/value pairs in aDictionary and apply them to this dictionary.
+*/
+- (void)addEntriesFromDictionary:(CPDictionary)aDictionary
+{
+    if (!aDictionary)
+        return;
+        
+    var keys = [aDictionary allKeys],
+        index = [keys count];
+    
+    while (index--)
+    {
+        var key = keys[index];
+
+        [self setObject:[aDictionary objectForKey:key] forKey:key];
+    }
+}
+
+/*!
+    Returns a human readable description of the dictionary.
+*/
+- (CPString)description
+{
+    var description = @"CPDictionary {\n";
+    
+    var i = _keys.length;
+    
+    while (i--)
+    {
+        description += _keys[i] + ":";
+
+        var object = _buckets[_keys[i]];
+
+        if (object && object.isa)
+            description += [object description];
+        else
+            description += object;
+
+        description += "\n";
+    }
+
+    description += "}";
+
+    return description;
+}
+
+@end
+
+@implementation CPDictionary (CPCoding)
+
+/*
+    Initializes the dictionary by unarchiving the data from a coder.
+    @param aCoder the coder from which the data will be unarchived.
+    @return the initialized dictionary
+*/
+- (id)initWithCoder:(CPCoder)aCoder
+{
+    return [aCoder _decodeDictionaryOfObjectsForKey:@"CP.objects"];
+}
+
+/*!
+    Archives the dictionary to a provided coder.
+    @param aCoder the coder to which the dictionary data will be archived.
+*/
+- (void)encodeWithCoder:(CPCoder)aCoder
+{
+    [aCoder _encodeDictionaryOfObjects:self forKey:@"CP.objects"];
+}
+
+@end
+
+/*!
+    @class CPMutableDictionary
+    @ingroup compatability
+
+    This class is just an empty subclass of CPDictionary.
+    CPDictionary already implements mutable methods and
+    this class only exists for source compatability.
+*/
+@implementation CPMutableDictionary : CPDictionary
+
+@end
+
+objj_dictionary.prototype.isa = CPDictionary;
diff --git a/tests/examplefiles/OrderedMap.hx b/tests/examplefiles/OrderedMap.hx
new file mode 100644 (file)
index 0000000..13b21f2
--- /dev/null
@@ -0,0 +1,584 @@
+package util;
+
+import util.Map;
+import util.Collection;
+import util.Set;
+import util.Option;
+import util.Debug;
+import util.Throwable;
+
+using util.StringFormat;
+
+/**
+ * An ordered map of (key,value) pairs. The key ordering is defined by
+ * a comparison function specified at construction. Duplicate keys
+ * are not allowed.
+ *
+ * Worst Case Time and Space Complexities:
+ * [operation]   [time]      [space]
+ * insert        O(lg(n))    O(lg(n))
+ * find          O(lg(n))    O(1)
+ * delete        O(lg(n))    O(lg(n))
+ * range-query   O(lg(n))*   O(lg(n))
+ * iteration     O(n)**      O(lg(n))
+ *   *range-query returns an iterator over elements in the range
+ *   **total cost of iterating over the entire map
+ *
+ * The map is backed by a Left-Leaning Red-Black 2-3 Tree
+ * adapted from Robert Sedgewick (2008) (http://www.cs.princeton.edu/~rs/)
+ *
+ * Implementation choices (let size of tree be n)
+ * - Parent Pointers
+ *   - This implementation omits parent pointers.
+ *   - Omitting parent pointers saves n words of persistent memory
+ *     at the expense of lg(n) stack space per operation.
+ *   - Without parent pointers, most operations in the tree must
+ *     either use recursion, or simulate recursion by saving a history
+ *     of nodes via a stack. For example, each iterator will require
+ *     lg(n) extra space to track progress through the tree. Insertions
+ *     and deletions into the tree will also invalidate any existing
+ *     iterators.
+ * - Node Size Information
+ *   - This implementation omits the size of each node.
+ *   - Omitting size information saves n words of long-term memory at
+ *     the expense of not providing a find-kth operation.
+ *   - This seems like a reasonable trade-off as range queries are
+ *     generally more common than find-kth operations. The implementation
+ *     used below could easily be modified to provide a version with
+ *     size information should find-kth be of specific interest.
+ * - Recursive vs. Iterative
+ *   - This implementation uses recursive algorithms.
+ *   - The recursive implementations allow the code to remain compact and
+ *     understandable. Since the height of LLRB 2-3 Trees is gaurenteed
+ *     to be at most 2lg(n), stack overflow is typically not a concern.
+ *     Unlike the standard single-rotation red-black algorithm, LLRB
+ *     operations are not tail-recursive, so even an iterative
+ *     version will require lg(n) extra memory.
+ */
+class OrderedMap<K,V>
+{
+  private var root  :Null<Node<K,V>>;
+  private var nodeCount :Int;
+  private var comp  :K -> K -> Int;
+
+  public function new( keyComp :K -> K -> Int )
+  {
+    root = null;
+    comp = keyComp;
+    nodeCount = 0;
+    assertInvariants();
+  }
+
+  /**
+   * @returns Some(v) if (\key,v) is in the map, None otherwise.
+   */
+  public function get(key :K) :Option<V>
+  {
+    //normal BST search
+    var n = root;
+    while( n != null )
+    {
+      var cmp = comp(key,n.key);
+      if( cmp < 0 )
+      {
+        n = n.left;
+      }
+      else if ( cmp > 0 )
+      {
+        n = n.right;
+      }
+      else
+      {
+        return Some(n.val);
+      }
+    }
+    return None;
+  }
+
+  /**
+   * Puts (\key,\val) into the map or replaces the current value of \key
+   * with \val.
+   *
+   * @return None if \key currently is not in the map, or Some(v) if (\key,v)
+   *   was in the map before the put operation.
+   */
+  public function set(key :K, val :V) :Option<V>
+  {
+    var ret = new Ref<V>(null);
+    root = insertNode(root,key,val,ret);
+    root.color = black;
+
+    assertInvariants();
+
+    if( ret.r == null )
+    {
+      return None;
+    }
+    return Some(ret.r);
+  }
+
+  private function insertNode(n :Node<K,V>, key :K, val :V, ret :Ref<V>)
+  {
+    //do the insertion at the leaf level
+    if( n == null )
+    {
+      ++nodeCount;
+      return new Node<K,V>(key,val);
+    }
+
+    //normal BST search
+    var cmp = comp(key,n.key);
+    if( cmp < 0 )
+    {
+      n.left = insertNode(n.left,key,val,ret);
+    }
+    else if( cmp > 0 )
+    {
+      n.right = insertNode(n.right,key,val,ret);
+    }
+    else
+    {
+      //the key is already in the map, update the value
+      ret.r = n.val;
+      n.val = val;
+    }
+
+    return fixInvariants(n);
+  }
+
+  /**
+   * Removes (\key,v) from the map if it exists.
+   *
+   * @return None if (\key,v) wasn't in the map, Some(v) otherwise.
+   */
+  public function remove(key :K) :Option<V>
+  {
+    var ret = new Ref<V>(null);
+    if( root != null )
+    {
+      root = deleteNode(root,key,ret);
+      if( root != null )
+      {
+        root.color = black;
+      }
+    }
+
+    assertInvariants();
+
+    if( ret.r == null )
+    {
+      return None;
+    }
+    return Some(ret.r);
+  }
+
+  private function deleteNode( n :Node<K,V>, key :K, ret :Ref<V> )
+  {
+    if( comp(key,n.key) < 0 )
+    {
+      if( isBlack(n.left) && isBlack(n.left.left) )
+      {
+        //ensure we move into a 3-node
+        n = moveRedLeft(n);
+      }
+      n.left = deleteNode(n.left,key,ret);
+    }
+    else
+    {
+      if( isRed(n.left) )
+      {
+        //ensure we move into a 3-node
+        n = rotateRight(n);
+      }
+      if( comp(key,n.key) == 0 && n.right == null )
+      {
+        //delete the node
+        ret.r = n.val;
+        --nodeCount;
+        return null;
+      }
+      if( isBlack(n.right) && isBlack(n.right.left) )
+      {
+        //ensure we move into a 3-node
+        n = moveRedRight(n);
+      }
+      if( comp(key,n.key) == 0 )
+      {
+        Debug.assert(n.right != null);
+
+        ret.r = n.val;
+
+        //ensure we are deleting a node with at most one child
+        var min = minNode(n.right);
+        n.val = min.val;
+        n.key = min.key;
+        n.right = deleteMinNode(n.right);
+      }
+      else
+      {
+        n.right = deleteNode(n.right,key,ret);
+      }
+    }
+
+    return fixInvariants(n);
+  }
+
+  /** returns a view of the set of keys in this TreeMap **/
+  public function keys() :SetView<K>
+  {
+    var _this = this;
+
+    return {
+      size: function() return _this.size(),
+      iterator: function() return IterTools.mapIter(new NodeIterator(_this.root),function(x) return x.key),
+      exists: function(x) {
+        return switch(_this.get(x))
+        {
+          case None: false;
+          case Some(_): true;
+        };
+      },
+    };
+  }
+
+  /** returns a view of the collection of values in this TreeMap **/
+  public function values() :CollectionView<V>
+  {
+    var _this = this;
+
+    return {
+      size: function() return _this.size(),
+      iterator: function() return IterTools.mapIter(new NodeIterator(_this.root),function(x) return x.val),
+    };
+  }
+
+  /** returns a view of the (key,value) pairs in this TreeMap **/
+  public function entries() :CollectionView<Entry<K,V>>
+  {
+    var _this = this;
+
+    return {
+      size: function() {
+        return _this.size();
+      },
+      iterator: function() {
+        return cast new NodeIterator(_this.root);
+      },
+    };
+  }
+
+  /** returns the number of (key,value) pairs in the map **/
+  public function size() :Int
+  {
+    return nodeCount;
+  }
+
+  public function toString() :String
+  {
+    var sb = new StringBuf();
+
+    sb.add("{");
+    for( entry in this.entries() )
+    {
+      sb.add("%y => %y, ".sprintf([entry.key,entry.val]));
+    }
+    sb.add("}");
+
+    return sb.toString();
+  }
+
+  private static function isRed<K,V>( n :Node<K,V> )
+  {
+    if( n == null ) return false;
+    return switch(n.color)
+    {
+      case red: true;
+      case black: false;
+    };
+  }
+
+  private static inline function isBlack<K,V>( n :Node<K,V> )
+  {
+    return !isRed(n);
+  }
+
+  private static function colorFlip<K,V>( n :Node<K,V> )
+  {
+    n.color = oppositeColor(n.color);
+    n.left.color = oppositeColor(n.left.color);
+    n.right.color = oppositeColor(n.right.color);
+  }
+
+  private static inline function oppositeColor( c :Color )
+  {
+    return switch(c)
+    {
+      case red: black;
+      case black: red;
+    };
+  }
+
+  private static function rotateLeft<K,V>( n :Node<K,V> )
+  {
+    Debug.assert(n != null);
+    Debug.assert(n.right != null);
+    /*
+           n            x
+          / \          / \
+         a   x   =>   n   c
+            / \      / \
+           b   c    a   b
+    */
+    var x = n.right;
+    n.right = x.left;
+    x.left  = n;
+    x.color = n.color;
+    n.color = red;
+    return x;
+  }
+
+  private static function rotateRight<K,V>( n :Node<K,V> )
+  {
+    Debug.assert( n != null );
+    Debug.assert( n.left != null );
+    /*
+           n          x
+          / \        / \
+         x   c  =>  a   n
+        / \            / \
+       a   b          b   c
+    */
+    var x = n.left;
+    n.left = x.right;
+    x.right = n;
+    x.color = n.color;
+    n.color = red;
+    return x;
+  }
+
+  private static function moveRedLeft<K,V>( n :Node<K,V> )
+  {
+    //borrow extra node from right child (which is a 3-node)
+    colorFlip(n);
+    if( isRed(n.right.left) )
+    {
+      n.right = rotateRight(n.right);
+      n = rotateLeft(n);
+      colorFlip(n);
+    }
+    return n;
+  }
+
+  private static function moveRedRight<K,V>( n :Node<K,V> )
+  {
+    //borrow extra node from left child (which is a 3-node)
+    colorFlip(n);
+    if( isRed(n.left.left) )
+    {
+      n = rotateRight(n);
+      colorFlip(n);
+    }
+    return n;
+  }
+
+  private static function fixInvariants<K,V>( n :Node<K,V> )
+  {
+    if( isRed(n.right) && isBlack(n.left) )
+    {
+      //ensure left-leaning property
+      n = rotateLeft(n);
+    }
+    if( isRed(n.left) && isRed(n.left.left) )
+    {
+      //balance 4-node
+      n = rotateRight(n);
+    }
+    if( isRed(n.left) && isRed(n.right) )
+    {
+      //split 4-node
+      colorFlip(n);
+    }
+    return n;
+  }
+
+  private function deleteMinNode<K,V>( n :Node<K,V> )
+  {
+    if( n.left == null )
+    {
+      //delete
+      --nodeCount;
+      return null;
+    }
+
+    if( isBlack(n.left) && isBlack(n.left.left) )
+    {
+      n = moveRedLeft(n);
+    }
+
+    n.left = deleteMinNode(n.left);
+
+    return fixInvariants(n);
+  }
+
+  private static function minNode<K,V>( n :Node<K,V> )
+  {
+    Debug.assert(n != null);
+
+    while( n.left != null )
+    {
+      n = n.left;
+    }
+    return n;
+  }
+
+  private static function maxNode<K,V>( n :Node<K,V> )
+  {
+    Debug.assert(n != null);
+
+    while( n.right != null )
+    {
+      n = n.right;
+    }
+    return n;
+  }
+
+  /** Used to verify that the invariants of the tree hold **/
+  private inline function assertInvariants()
+  {
+  #if DEBUG
+    Debug.assert( isBlack(root), "root is black: " + root );
+
+    assertIsTree(root,new List<Node<K,V>>());
+    assertBlackNodeCount(root);
+    assertBSTOrdering(root,comp);
+  #end
+  }
+
+  private static function assertIsTree<K,V>( n: Node<K,V>, visited :List<Node<K,V>> )
+  {
+    if( n == null )
+    {
+      return;
+    }
+
+    for( r in visited )
+    {
+      Debug.assert( n != r );
+    }
+    visited.push(n);
+    assertIsTree(n.left,visited);
+    assertIsTree(n.right,visited);
+  }
+
+  private static function assertBlackNodeCount<K,V>( n: Node<K,V> ) :Int
+  {
+    if( n == null )
+    {
+      return 1;
+    }
+
+    var leftCount  = assertBlackNodeCount(n.left);
+    var rightCount = assertBlackNodeCount(n.right);
+
+    Debug.assert(
+      leftCount == rightCount,
+      "num of black nodes in all paths for left and right child not equal" + n
+    );
+
+    return leftCount + switch(n.color) {
+      case red: 0;
+      case black: 1;
+    }
+  }
+
+  private static function assertBSTOrdering<K,V>( n: Node<K,V>, compK :K -> K -> Int ) :Void
+  {
+    if( n == null )
+    {
+      return;
+    }
+
+    if( n.left != null && n.left.val != null )
+    {
+      Debug.assert( compK(n.left.key,n.key) < 0, "left child not less than its parent" + n );
+      assertBSTOrdering(n.left,compK);
+    }
+
+    if( n.right != null && n.right.val != null )
+    {
+      Debug.assert( compK(n.key,n.right.key) < 0, "parent not less than its right child" + n );
+      assertBSTOrdering(n.right,compK);
+    }
+  }
+}
+
+private enum Color
+{
+  red;
+  black;
+}
+
+private class Node<K,V> /*implements Entry<K,V>*/
+{
+  public var left   :Null<Node<K,V>>;
+  public var right  :Null<Node<K,V>>;
+  public var color  :Color;
+
+  public var key :K;
+  public var val :V;
+
+  public function new(k :K, v :V)
+  {
+    key = k;
+    val = v;
+    color = red;
+  }
+}
+
+private class NodeIterator<K,V>
+{
+  private var curr   :Node<K,V>;
+  private var fringe :Array<Node<K,V>>;
+
+  public function new( root :Node<K,V> )
+  {
+    fringe = new Array<Node<K,V>>();
+    traverseToMin(root);
+    curr = fringe.pop();
+  }
+
+  public inline function hasNext() :Bool
+  {
+    return curr != null;
+  }
+
+  public function next() :Node<K,V>
+  {
+    if( !hasNext() )
+    {
+      throw new NoSuchElement();
+    }
+    var ret = curr;
+
+    if( fringe.length > 0 )
+    {
+      curr = fringe.pop();
+      traverseToMin(curr.right);
+    }
+    else
+    {
+      curr = null;
+    }
+
+    return ret;
+  }
+
+  private function traverseToMin( n :Node<K,V> )
+  {
+    while( n != null )
+    {
+      fringe.push(n);
+      n = n.left;
+    }
+  }
+}
\ No newline at end of file
diff --git a/tests/examplefiles/Sorting.mod b/tests/examplefiles/Sorting.mod
new file mode 100644 (file)
index 0000000..d6a27c1
--- /dev/null
@@ -0,0 +1,470 @@
+IMPLEMENTATION MODULE Sorting;
+
+(* J. Andrea, Dec.16/91 *)
+(* This code may be freely used and distributed, it may not be sold. *)
+
+(* Adapted to ISO Module-2 by Frank Schoonjans  Feb 2004 *)
+
+FROM Storage IMPORT ALLOCATE;
+
+CONST
+   max_stack = 20;
+   n_small   = 6; (* use a simple sort for this size and smaller *)
+
+VAR
+  rtemp :REAL;
+  ctemp :CARDINAL;
+
+  L, R, n               :INTEGER;
+  top, bottom, lastflip :INTEGER;
+
+  tos            :CARDINAL;
+  Lstack, Rstack :ARRAY [1..max_stack] OF INTEGER;
+
+      (* --------------------------------------------------- *)
+      PROCEDURE CardQSortIndex( x :ARRAY OF CARDINAL; array_len :CARDINAL;
+                                VAR index :ARRAY OF CARDINAL );
+
+      VAR
+        median : CARDINAL;
+        i,j    : INTEGER;
+      BEGIN
+
+        n := VAL(INTEGER,array_len) - 1; (* back to zero offset *)
+
+        (* initialize the index *)
+        FOR i := 0 TO n DO
+          index[i] := VAL(CARDINAL,i);
+        END;
+
+        tos := 0;
+
+        L := 0;  R := n;
+
+        (* PUSH very first set *)
+        tos := tos + 1;  Lstack[tos] := L;  Rstack[tos] := R;
+
+        REPEAT
+
+          (* POP *)
+          L := Lstack[tos];  R := Rstack[tos];  tos := tos - 1;
+
+          IF R - L + 1 > n_small THEN
+
+            REPEAT
+              i := L;  j := R;    median := x[index[( L + R ) DIV 2]];
+
+              REPEAT
+                WHILE x[index[i]] < median DO
+                  i := i + 1;
+                END;
+                WHILE median < x[index[j]] DO
+                  j := j - 1;
+                END;
+
+                IF i <= j THEN (* swap *)
+                  ctemp := index[i];  index[i] := index[j];  index[j] := ctemp;
+                  i := i + 1;  j := j - 1;
+                END;
+              UNTIL i > j;
+
+              IF j - L < R - i THEN
+                IF i < R THEN (* PUSH *)
+                  tos := tos + 1;  Lstack[tos] := i;  Rstack[tos] := R;
+                END;
+                R := j;
+              ELSE
+                IF L < j THEN (* push *)
+                  tos := tos + 1;  Lstack[tos] := L;  Rstack[tos] := j;
+                END;
+                L := i;
+              END;
+
+            UNTIL L >= R;
+
+         ELSE
+
+           (* small sort for small number of values *)
+           FOR i := L TO R - 1 DO
+             FOR j := i TO R DO
+               IF x[index[i]] > x[index[j]] THEN
+                  ctemp    := index[i];
+                  index[i] := index[j];
+                  index[j] := ctemp
+               END;
+             END;
+           END;
+
+         END; (* check for small *)
+
+       UNTIL tos = 0;
+
+      END CardQSortIndex;
+
+      (* --------------------------------------------------- *)
+      PROCEDURE RealQSortIndex( x :ARRAY OF REAL; array_len :CARDINAL;
+                                VAR index :ARRAY OF CARDINAL );
+
+      VAR
+        median :REAL;
+        i,j    :INTEGER;
+      BEGIN
+
+        n := VAL(INTEGER,array_len) - 1; (* back to zero offset *)
+
+        (* initialize the index *)
+        FOR i := 0 TO n DO
+          index[i] := VAL(CARDINAL,i);
+        END;
+
+        tos := 0;
+
+        L := 0;  R := n;
+
+        (* PUSH very first set *)
+        tos := tos + 1;  Lstack[tos] := L;  Rstack[tos] := R;
+
+        REPEAT
+
+          (* POP *)
+          L := Lstack[tos];  R := Rstack[tos];  tos := tos - 1;
+
+          IF R - L + 1 > n_small THEN
+
+            REPEAT
+              i := L;  j := R;    median := x[index[( L + R ) DIV 2]];
+
+              REPEAT
+                WHILE x[index[i]] < median DO
+                  i := i + 1;
+                END;
+                WHILE median < x[index[j]] DO
+                  j := j - 1;
+                END;
+
+                IF i <= j THEN (* swap *)
+                  ctemp := index[i];  index[i] := index[j];  index[j] := ctemp;
+                  i := i + 1;  j := j - 1;
+                END;
+              UNTIL i > j;
+
+              IF j - L < R - i THEN
+                IF i < R THEN (* PUSH *)
+                  tos := tos + 1;  Lstack[tos] := i;  Rstack[tos] := R;
+                END;
+                R := j;
+              ELSE
+                IF L < j THEN (* push *)
+                  tos := tos + 1;  Lstack[tos] := L;  Rstack[tos] := j;
+                END;
+                L := i;
+              END;
+
+            UNTIL L >= R;
+
+         ELSE
+
+           (* small sort for small number of values *)
+           FOR i := L TO R - 1 DO
+             FOR j := i TO R DO
+               IF x[index[i]] > x[index[j]] THEN
+                  ctemp    := index[i];
+                  index[i] := index[j];
+                  index[j] := ctemp
+               END;
+             END;
+           END;
+
+         END; (* check for small *)
+
+       UNTIL tos = 0;
+
+      END RealQSortIndex;
+
+      (* --------------------------------------------------- *)
+      PROCEDURE CardQSort( VAR x :ARRAY OF CARDINAL; array_len :CARDINAL );
+
+      VAR
+        median : CARDINAL;
+        n,i,j  : INTEGER;
+      BEGIN
+
+        n := VAL(INTEGER,array_len) - 1; (* back to zero offset *)
+
+        tos := 0;
+
+        L := 0;  R := n;
+
+        (* PUSH very first set *)
+        tos := tos + 1;  Lstack[tos] := L;  Rstack[tos] := R;
+
+        REPEAT
+
+          (* POP *)
+          L := Lstack[tos];  R := Rstack[tos];  tos := tos - 1;
+
+          IF R - L + 1 > n_small THEN
+
+            REPEAT
+              i := L;  j := R;    median := x[( L + R ) DIV 2];
+
+              REPEAT
+                WHILE x[i] < median DO
+                  i := i + 1;
+                END;
+                WHILE median < x[j] DO
+                  j := j - 1;
+                END;
+
+                IF i <= j THEN (* swap *)
+                  ctemp := x[i];  x[i] := x[j];  x[j] := ctemp;
+                  i := i + 1;  j := j - 1;
+                END;
+              UNTIL i > j;
+
+              IF j - L < R - i THEN
+                IF i < R THEN (* PUSH *)
+                  tos := tos + 1;  Lstack[tos] := i;  Rstack[tos] := R;
+                END;
+                R := j;
+              ELSE
+                IF L < j THEN (* push *)
+                  tos := tos + 1;  Lstack[tos] := L;  Rstack[tos] := j;
+                END;
+                L := i;
+              END;
+
+            UNTIL L >= R;
+
+         ELSE
+
+           (* small sort for small number of values *)
+           FOR i := L TO R - 1 DO
+             FOR j := i TO R DO
+               IF x[i] > x[j] THEN
+                  ctemp := x[i];
+                  x[i]  := x[j];
+                  x[j]  := ctemp
+               END;
+             END;
+           END;
+
+         END; (* check for small *)
+
+       UNTIL tos = 0;
+
+      END CardQSort;
+
+      (* ----------------------------------------------------- *)
+      PROCEDURE CardBSort( VAR x :ARRAY OF CARDINAL; array_len :CARDINAL );
+      VAR i,j : INTEGER;
+      BEGIN
+        top    := 0;      (* open arrays are zero offset *)
+        bottom := VAL(INTEGER,array_len) - 1;
+
+        WHILE top < bottom DO
+
+          lastflip := top;
+
+          FOR i := top TO bottom-1 DO
+             IF x[i] > x[i+1] THEN    (* flip *)
+               ctemp  := x[i];
+               x[i]   := x[i+1];
+               x[i+1] := ctemp;
+               lastflip := i;
+             END;
+          END;
+
+          bottom := lastflip;
+
+          IF bottom > top THEN
+
+             i := bottom - 1;
+             FOR j := top TO bottom-1 DO
+               IF x[i] > x[i+1] THEN    (* flip *)
+                 ctemp  := x[i];
+                 x[i]   := x[i+1];
+                 x[i+1] := ctemp;
+                 lastflip := i;
+               END;
+               i := i - 1;
+             END;
+
+             top := lastflip + 1;
+
+          ELSE
+             (* force a loop failure *)
+             top := bottom + 1;
+          END;
+
+       END;
+
+      END CardBSort;
+
+
+      (* ----------------------------------------------------- *)
+      PROCEDURE RealBSort( VAR x :ARRAY OF REAL; array_len :CARDINAL );
+      VAR bottom,top : INTEGER;
+          i,j        : INTEGER;
+      BEGIN
+        top    := 0;      (* open arrays are zero offset *)
+        bottom := VAL(INTEGER,array_len) - 1;
+
+        WHILE top < bottom DO
+
+          lastflip := top;
+
+          FOR i := top TO bottom-1 DO
+             IF x[i] > x[i+1] THEN    (* flip *)
+               rtemp  := x[i];
+               x[i]   := x[i+1];
+               x[i+1] := rtemp;
+               lastflip := i;
+             END;
+          END;
+
+          bottom := lastflip;
+
+          IF bottom > top THEN
+
+             i := bottom - 1;
+             FOR j := top TO bottom-1 DO
+               IF x[i] > x[i+1] THEN    (* flip *)
+                 rtemp  := x[i];
+                 x[i]   := x[i+1];
+                 x[i+1] := rtemp;
+                 lastflip := i;
+               END;
+               i := i - 1;
+             END;
+
+             top := lastflip + 1;
+
+          ELSE
+             (* force a loop failure *)
+             top := bottom + 1;
+          END;
+
+       END;
+
+      END RealBSort;
+
+
+    (* ----------------------------------------------------- *)
+    PROCEDURE TopoSort( x, y :ARRAY OF CARDINAL; n_pairs :CARDINAL;
+                       VAR solution :ARRAY OF CARDINAL; VAR n_solution :CARDINAL;
+                       VAR error, sorted :BOOLEAN );
+    (*
+     This procedure needs some garbage collection added, i've tried but
+     will little success. J. Andrea, Dec.18/91
+    *)
+
+    TYPE
+      LPtr = POINTER TO Leader;
+      TPtr = POINTER TO Trailer;
+
+      Leader = RECORD
+                  key   :CARDINAL;
+                  count :INTEGER;
+                  trail :TPtr;
+                  next  :LPtr;
+               END;
+
+      Trailer = RECORD
+                  id   :LPtr;
+                  next :TPtr;
+                END;
+
+    VAR
+      p, q, head, tail :LPtr;
+      t                :TPtr;
+      i, max_solutions :CARDINAL;
+
+      (* -------------------------------------------- *)
+      PROCEDURE Find( w :CARDINAL ) :LPtr;
+      VAR h :LPtr;
+      BEGIN
+        h := head;   tail^.key := w;  (* sentinel *)
+        WHILE h^.key # w DO
+           h := h^.next;
+        END;
+        IF h = tail THEN
+          NEW( tail );
+          n := n + 1;
+          h^.count := 0;
+          h^.trail := NIL;
+          h^.next  := tail;
+        END;
+        RETURN h;
+      END Find;
+
+    BEGIN
+
+        error      := FALSE;
+        n_solution := 0;
+
+        IF n_pairs < 2 THEN
+          error := TRUE;
+        ELSE
+
+          max_solutions := HIGH( solution ) + 1;
+
+          NEW( head );  tail := head;  n := 0;
+
+          (* add all of the given pairs *)
+
+          FOR i := 0 TO n_pairs - 1 DO
+            p := Find( x[i] );   q := Find( y[i] );
+            NEW(t);
+            t^.id    := q;
+            t^.next  := p^.trail;
+            p^.trail := t;
+            q^.count := q^.count + 1;
+          END;
+
+          (* search for leaders without predecessors *)
+
+           p := head;  head := NIL;
+           WHILE p # tail DO
+            q := p;  p := q^.next;
+            IF q^.count = 0 THEN
+              (* insert q^ in new chain *)
+              q^.next := head;   head := q;
+            END;
+          END;
+
+          (* output phase *)
+
+          q := head;
+          WHILE ( NOT error ) & ( q # NIL ) DO
+            n_solution := n_solution + 1;
+            IF n_solution > max_solutions THEN
+              error := TRUE;
+            ELSE
+
+              solution[n_solution-1] := q^.key;
+              n := n - 1;
+              t := q^.trail;  q := q^.next;
+              WHILE t # NIL DO
+                p := t^.id;  p^.count := p^.count - 1;
+                IF p^.count = 0 THEN
+                  (* insert p^ in leader list *)
+                  p^.next := q;  q := p;
+                END;
+                t := t^.next;
+              END;
+            END;
+          END;
+
+          IF n # 0 THEN
+            sorted := FALSE;
+          ELSE
+            sorted := TRUE;
+          END;
+
+       END;
+
+    END TopoSort;
+
+BEGIN
+END Sorting.
diff --git a/tests/examplefiles/aspx-cs_example b/tests/examplefiles/aspx-cs_example
new file mode 100644 (file)
index 0000000..01de00e
--- /dev/null
@@ -0,0 +1,27 @@
+<%@ Page Language="C#" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<script runat="server">
+    protected void Page_Load(object sender, EventArgs e)
+    {
+        Label1.Text = DateTime.Now.ToLongDateString();
+    }
+</script>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+    <title>Sample page</title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+        The current time is: <asp:Label runat="server" id="Label1" />
+    </div>
+    </form>
+</body>
+</html>
diff --git a/tests/examplefiles/demo.cfm b/tests/examplefiles/demo.cfm
new file mode 100644 (file)
index 0000000..d94a06a
--- /dev/null
@@ -0,0 +1,38 @@
+<!--- cfcomment --->
+<!-- html comment -->
+<html>
+<head>
+<title>Date Functions</title>
+</head>
+<body>
+<cfset RightNow = Now()>
+<cfoutput>
+ #RightNow#<br />
+ #DateFormat(RightNow)#<br />
+ #DateFormat(RightNow,"mm/dd/yy")#<br />
+ #TimeFormat(RightNow)#<br />
+ #TimeFormat(RightNow,"hh:mm tt")#<br />
+ #IsDate(RightNow)#<br />
+ #IsDate("January 31, 2007")#<br />
+ #IsDate("foo")#<br />
+ #DaysInMonth(RightNow)#
+</cfoutput>
+<cfoutput group="x">
+    #x#
+    <cfoutput>#y#</cfoutput>
+    #z#
+</cfoutput>
+</body>
+</html>
+
+<cfset person = "Paul">
+<cfset greeting = "Hello #person#">
+
+<cfset greeting = "Hello" & " world!">
+<cfset c = a^b>
+<cfset c = a MOD b>
+<cfset c = a / b>
+<cfset c = a * b>
+<cfset c = a + b>
+<cfset c = a - b>
+
diff --git a/tests/examplefiles/example.aspx b/tests/examplefiles/example.aspx
deleted file mode 100644 (file)
index 01de00e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<%@ Page Language="C#" %>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<script runat="server">
-    protected void Page_Load(object sender, EventArgs e)
-    {
-        Label1.Text = DateTime.Now.ToLongDateString();
-    }
-</script>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head runat="server">
-    <title>Sample page</title>
-</head>
-<body>
-    <form id="form1" runat="server">
-    <div>
-        The current time is: <asp:Label runat="server" id="Label1" />
-    </div>
-    </form>
-</body>
-</html>
diff --git a/tests/examplefiles/example.xml b/tests/examplefiles/example.xml
deleted file mode 100644 (file)
index e657e56..0000000
+++ /dev/null
@@ -1,1897 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="Ada" version="1.04" kateversion="2.1" section="Sources" extensions="*.adb;*.ads;*.ada;*.a" mimetype="text/x-adasrc">\r
-        <highlighting>\r
-                <list name="keywords">\r
-                        <item> abort </item>\r
-                        <item> abs </item>\r
-                        <item> abstract </item>\r
-                        <item> accept </item>\r
-                        <item> access </item>\r
-                        <item> aliased </item>\r
-                        <item> all </item>\r
-                        <item> and </item>\r
-                        <item> array </item>\r
-                        <item> at </item>\r
-                        <item> begin </item>\r
-                        <item> body </item>\r
-                        <item> constant </item>\r
-                        <item> declare </item>\r
-                        <item> delay </item>\r
-                        <item> delta </item>\r
-                        <item> digits </item>\r
-                        <item> do </item>\r
-                        <item> else </item>\r
-                        <item> elsif </item>\r
-                        <item> end </item>\r
-                        <item> entry </item>\r
-                        <item> exception </item>\r
-                        <item> exit </item>\r
-                        <item> for </item>\r
-                        <item> function </item>\r
-                        <item> generic </item>\r
-                        <item> goto </item>\r
-                        <item> in </item>\r
-                        <item> is </item>\r
-                        <item> limited </item>\r
-                        <item> mod </item>\r
-                        <item> new </item>\r
-                        <item> not </item>\r
-                        <item> null </item>\r
-                        <item> of </item>\r
-                        <item> or </item>\r
-                        <item> others </item>\r
-                        <item> out </item>\r
-                        <item> package </item>\r
-                        <item> pragma </item>\r
-                        <item> private </item>\r
-                        <item> procedure </item>\r
-                        <item> protected </item>\r
-                        <item> raise </item>\r
-                        <item> range </item>\r
-                        <item> rem </item>\r
-                        <item> record </item>\r
-                        <item> renames </item>\r
-                        <item> requeue </item>\r
-                        <item> return </item>\r
-                        <item> reverse </item>\r
-                        <item> separate </item>\r
-                        <item> subtype </item>\r
-                        <item> tagged </item>\r
-                        <item> task </item>\r
-                        <item> terminate </item>\r
-                        <item> then </item>\r
-                        <item> type </item>\r
-                        <item> until </item>\r
-                        <item> use </item>\r
-                        <item> when </item>\r
-                        <item> while </item>\r
-                        <item> with </item>\r
-                        <item> xor </item>\r
-                </list>\r
-                <contexts>\r
-                        <context attribute="Normal Text" lineEndContext="#stay" name="Default">\r
-                                <RegExpr attribute="Keyword" context="#stay" String="^\s*if " insensitive="TRUE" beginRegion="Region1"/>\r
-                                <StringDetect attribute="Keyword" context="#stay" String="end if" insensitive="TRUE" endRegion="Region1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="^\s*case " insensitive="TRUE" beginRegion="Region2"/>\r
-                                <StringDetect attribute="Keyword" context="#stay" String="end case" insensitive="TRUE" endRegion="Region2"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\sloop\s+" insensitive="TRUE" beginRegion="Region3"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\sloop$" insensitive="TRUE" beginRegion="Region3"/>\r
-                                <StringDetect attribute="Keyword" context="#stay" String="end loop;" insensitive="TRUE" endRegion="Region3"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\sselect\s+" insensitive="TRUE" beginRegion="Region4"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\sselect$" insensitive="TRUE" beginRegion="Region4"/>\r
-                                <StringDetect attribute="Keyword" context="#stay" String="end select;" insensitive="TRUE" endRegion="Region4"/>\r
-                                <keyword attribute="Keyword" context="#stay" String="keywords"/>\r
-                                <Float attribute="Float" context="#stay"/>\r
-                                <Int attribute="Decimal" context="#stay"/>\r
-                                <RegExpr attribute="Char" context="#stay" String="'.'"/>\r
-                                <DetectChar attribute="String" context="String" char="&quot;"/>\r
-                                <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>\r
-                        </context>\r
-                        <context attribute="String" lineEndContext="#pop" name="String">\r
-                                <DetectChar attribute="String" context="#pop" char="&quot;"/>\r
-                        </context>\r
-                        <context attribute="Comment" lineEndContext="#pop" name="Comment"/>\r
-                </contexts>\r
-                <itemDatas>\r
-                        <itemData name="Normal Text" defStyleNum="dsNormal" />\r
-                        <itemData name="Keyword"     defStyleNum="dsKeyword" />\r
-                        <itemData name="Decimal"     defStyleNum="dsDecVal" />\r
-                        <itemData name="Base-N"      defStyleNum="dsBaseN" />\r
-                        <itemData name="Float"       defStyleNum="dsFloat" />\r
-                        <itemData name="Char"        defStyleNum="dsChar" />\r
-                        <itemData name="String"      defStyleNum="dsString" />\r
-                        <itemData name="Comment"     defStyleNum="dsComment" />\r
-                </itemDatas>\r
-  </highlighting>\r
-  <general>\r
-    <comments>\r
-      <comment name="singleLine" start="--" />\r
-    </comments>\r
-    <keywords casesensitive="0" />\r
-  </general>\r
-</language>\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="Asm6502" version="1.03" kateversion="2.1" section="Sources" extensions="*.asm" mimetype="text/x-asm6502">\r
-        <highlighting>\r
-                <list name = "opcodes6502">\r
-\r
-\r
-                </list>\r
-\r
-\r
-\r
-\r
-\r
-                <contexts>\r
-                        <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">\r
-\r
-\r
-                               <RegExpr String= "#define.*$" attribute = "Preprocessor" context="#stay"/>\r
-                               <RegExpr String= "#include .*$" attribute = "Preprocessor" context="#stay"/>\r
-                               <RegExpr String= ";.*$" attribute = "Comment" context="#stay"/>\r
-                               <RegExpr String= "\.byte" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.byt" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.word" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.asc" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.dsb" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.fopt" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.text" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.data" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.bss" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.zero" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\.align" attribute = "Data Type" context="#stay"/>\r
-                               <RegExpr String= "\$[A-Za-z0-9]*" attribute = "Hex" context="#stay"/>\r
-                               <RegExpr String= ",x$" attribute = "Keyword" context="#stay"  insensitive="TRUE"/>\r
-                               <RegExpr String= ",y$" attribute = "Keyword" context="#stay"  insensitive="TRUE"/>\r
-                               <RegExpr String= "#" attribute = "Keyword" context="#stay"  insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="TAX" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="ADC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="AND" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="ASL" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BCC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BCS" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BEQ" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BIT" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BMI" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BNE" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BPL" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BRK" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BVC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="BVS" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="CLC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="CLD" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="CLI" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="CLV" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="CMP" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="CPX" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="CPY" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="DEC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="DEX" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="DEY" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="EOR" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="INC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="INX" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="INY" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="JMP" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="JSR" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="LDA" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="LDX" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="LDY" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="LSR" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="NOP" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="ORA" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="PHA" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="PHP" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="PLA" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="PLP" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="ROL" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="ROR" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="RTI" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="RTS" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="SBC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="SEC" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="SED" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="SEI" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="STA" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="STX" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="STY" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="TAY" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="TSX" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="TXA" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="TXS" insensitive="TRUE"/>\r
-                               <StringDetect attribute="Keyword" context="#stay" String="TYA" insensitive="TRUE"/>\r
-\r
-                               <keyword String = "opcodes6502" attribute = "Keyword" context = "#stay" />\r
-                               <RegExpr String= "\*=" attribute = "Decimal" context="#stay"/>\r
-                               <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>\r
-                               <AnyChar String = "-+&lt;&gt;=;" attribute = "Operator" context = "#stay"/>\r
-                               <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>\r
-\r
-\r
-                       </context>\r
-                       <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">\r
-                               <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>\r
-                       </context>\r
-                </contexts>\r
-\r
-               <itemDatas>\r
-                        <itemData name = "Normal Text" defStyleNum = "dsNormal"/>\r
-                        <itemData name = "Keyword" defStyleNum = "dsKeyword"/>\r
-                       <itemData name="Decimal" defStyleNum="dsDecVal"/>\r
-                       <itemData name="Data Type"  defStyleNum="dsDataType"/>\r
-                       <itemData name="Hex"  defStyleNum="dsBaseN"/>\r
-                        <itemData name = "String" defStyleNum = "dsString"/>\r
-                        <itemData name = "Comment" defStyleNum = "dsComment"/>\r
-                        <itemData name = "Substitution" defStyleNum = "dsOthers"/>\r
-                       <itemData name="Preprocessor"  defStyleNum="dsOthers"/>\r
-                       <itemData name = "Parameter" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Operator" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Command" defStyleNum = "dsNormal"/>\r
-                </itemDatas>\r
-        </highlighting>\r
-        <general>\r
-                <comments>\r
-                        <comment name="singleLine" start=";"/>\r
-                       <comment name="multiLine" start="/*" end="*/"/>\r
-               </comments>\r
-                <keywords casesensitive="1"/>\r
-        </general>\r
-</language>\r
-\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="AWK" version="0.1" kateversion="2.1" section="Scripts" extensions="*.awk" mimetype="text/x-awk">\r
-  <highlighting>\r
-    <list name="keywords">\r
-      <item>BEGIN</item>\r
-      <item>END</item>\r
-      <item>if</item>\r
-      <item>else</item>\r
-      <item>while</item>\r
-      <item>do</item>\r
-      <item>for</item>\r
-      <item>in</item>\r
-      <item>continue</item>\r
-      <item>break</item>\r
-      <item>print</item>\r
-      <item>printf</item>\r
-      <item>getline</item>\r
-      <item>function</item>\r
-      <item>return</item>\r
-      <item>next</item>\r
-      <item>exit</item>\r
-    </list>\r
-    <list name="builtins">\r
-      <item>ARGC</item>\r
-      <item>ARGV</item>\r
-      <item>CONVFMT</item>\r
-      <item>ENVIRON</item>\r
-      <item>FILENAME</item>\r
-      <item>FNR</item>\r
-      <item>FS</item>\r
-      <item>NF</item>\r
-      <item>NR</item>\r
-      <item>OFMT</item>\r
-      <item>OFS</item>\r
-      <item>ORS</item>\r
-      <item>RS</item>\r
-      <item>RSTART</item>\r
-      <item>RLENGTH</item>\r
-      <item>SUBSEP</item>\r
-    </list>\r
-    <list name="functions">\r
-      <item>gsub</item>\r
-      <item>index</item>\r
-      <item>length</item>\r
-      <item>match</item>\r
-      <item>split</item>\r
-      <item>sprintf</item>\r
-      <item>sub</item>\r
-      <item>substr</item>\r
-      <item>tolower</item>\r
-      <item>toupper</item>\r
-      <item>atan2</item>\r
-      <item>cos</item>\r
-      <item>exp</item>\r
-      <item>int</item>\r
-      <item>log</item>\r
-      <item>rand</item>\r
-      <item>sin</item>\r
-      <item>sqrt</item>\r
-      <item>srand</item>\r
-      <item>close</item>\r
-      <item>fflush</item>\r
-      <item>system</item>\r
-    </list>\r
-    <contexts>\r
-      <context name="Base" attribute="Normal" lineEndContext="#stay">\r
-        <keyword String="keywords" attribute="Keyword" context="#stay"/>\r
-        <keyword String="builtins" attribute="Builtin" context="#stay"/>\r
-        <keyword String="functions" attribute="Function" context="#stay"/>\r
-        <Int   attribute="Decimal" context="#stay"/>\r
-        <Float attribute="Float"   context="#stay"/>\r
-        <RegExpr String="\$[A-Za-z0-9_]+" attribute="Field" context="#stay"/>\r
-        <DetectChar char="&quot;" attribute="String"  context="String"/>\r
-        <DetectChar char="/"      attribute="Pattern" context="Pattern"/>\r
-        <RegExpr String="#.*$" attribute="Comment" context="#stay"/>\r
-      </context>\r
-      <context name="String" attribute="String" lineEndContext="#stay">\r
-        <DetectChar char="&quot;" attribute="String" context="#pop"/>\r
-        <HlCStringChar attribute="String" context="#stay"/>\r
-      </context>\r
-      <context name="Pattern" attribute="Pattern" lineEndContext="#stay">\r
-        <DetectChar char="/" attribute="Pattern" context="#pop"/>\r
-        <RegExpr String="\\." attribute="Pattern" context="#stay"/>\r
-      </context>\r
-      <context name="Field" attribute="Field" lineEndContext="#stay">\r
-        <RegExpr String="\$[A-Za-z0-9_]+" attribute="Field" context="#pop"/>\r
-      </context>\r
-    </contexts>\r
-    <itemDatas>\r
-      <itemData name="Normal"   defStyleNum="dsNormal"/>\r
-      <itemData name="Keyword"  defStyleNum="dsKeyword"/>\r
-      <itemData name="Builtin"  defStyleNum="dsDataType"/>\r
-      <itemData name="Function" defStyleNum="dsKeyword"/>\r
-      <itemData name="Decimal"  defStyleNum="dsDecVal"/>\r
-      <itemData name="Float"    defStyleNum="dsFloat"/>\r
-      <itemData name="String"   defStyleNum="dsString"/>\r
-      <itemData name="Comment"  defStyleNum="dsComment"/>\r
-      <itemData name="Pattern"  defStyleNum="dsString"/>\r
-      <itemData name="Field"    defStyleNum="dsOthers"/>\r
-    </itemDatas>\r
-  </highlighting>\r
-  <general>\r
-    <comments>\r
-      <comment name="singleLine" start="#"/>\r
-    </comments>\r
-    <keywords casesensitive="1" />\r
-  </general>\r
-</language>\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="Bash" version="1.08" kateversion="2.2" section="Scripts" extensions="*.sh" mimetype="application/x-shellscript">\r
-        <highlighting>\r
-                <list name = "keywords">\r
-                        <item> break </item>\r
-                        <item> case </item>\r
-                        <item> else </item>\r
-                        <item> esac </item>\r
-                        <item> exit </item>\r
-                        <item> export </item>\r
-                        <item> for </item>\r
-                        <item> function </item>\r
-                        <item> in </item>\r
-                        <item> return </item>\r
-                        <item> select </item>\r
-                        <item> then </item>\r
-                        <item> until </item>\r
-                        <item> while </item>\r
-                        <item> . </item>\r
-                        <item> done </item>\r
-                        <item> do </item>\r
-                        <item> elif </item>\r
-                        <item> fi </item>\r
-                        <item> if </item>\r
-\r
-                </list>\r
-                <list name = "commands">\r
-                        <item> cp </item>\r
-                        <item> date </item>\r
-                        <item> echo </item>\r
-                        <item> eval </item>\r
-                       <item> dcop </item>\r
-                       <item> dcopstart </item>\r
-                       <item> dcopfind </item>\r
-                </list>\r
-                <contexts>\r
-                        <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bdone\b" insensitive="TRUE" endRegion="dodone1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="dodone1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\belif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bfi\b" insensitive="TRUE" endRegion="iffi1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="TRUE" beginRegion="case1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\besac\b" insensitive="TRUE" endRegion="case1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="^[^()]+\)" insensitive="TRUE" beginRegion="subcase1"/>\r
-                                <StringDetect attribute="Keyword" context="#stay" String=";;" insensitive="TRUE" endRegion="subcase1"/>\r
-                                <DetectChar attribute="Keyword" context="#stay" char="{" beginRegion="func1"/>\r
-                                <DetectChar attribute="Keyword" context="#stay" char="}" endRegion="func1"/>\r
-\r
-                                <keyword String = "keywords" attribute = "Keyword" context = "#stay"/>\r
-                                <keyword String = "commands" attribute = "Command" context = "#stay"/>\r
-                                <Int attribute = "Decimal" context = "#stay"/>\r
-                                <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>\r
-                                <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>\r
-                                <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>\r
-                                <DetectChar char="'" attribute = "String" context = "Single Quote"/>\r
-                                <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>\r
-                                <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>\r
-                                <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>\r
-\r
-                        </context>\r
-                        <context name = "String" attribute = "String" lineEndContext="#stay">\r
-                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
-                               <StringDetect String = "\&quot;" attribute = "String" context = "#stay"/>\r
-                                <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>\r
-                        </context>\r
-                       <context name = "Single Quote" attribute = "String" lineEndContext="#stay">\r
-                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
-                               <StringDetect String = "\'" attribute = "String" context = "#stay"/>\r
-                               <DetectChar char = "'" attribute = "String" context = "#pop"/>\r
-                        </context>\r
-                        <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">\r
-                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
-                               <StringDetect String = "\`" attribute = "String" context = "#stay"/>\r
-                                <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>\r
-                        </context>\r
-                        <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">\r
-                                <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>\r
-                        </context>\r
-                </contexts>\r
-                <itemDatas>\r
-                        <itemData name = "Normal Text" defStyleNum = "dsNormal"/>\r
-                        <itemData name = "Keyword" defStyleNum = "dsKeyword"/>\r
-                        <itemData name = "Decimal" defStyleNum = "dsDecVal"/>\r
-                        <itemData name = "Float" defStyleNum = "dsFloat"/>\r
-                        <itemData name = "Char" defStyleNum = "dsChar"/>\r
-                        <itemData name = "String" defStyleNum = "dsString"/>\r
-                        <itemData name = "Comment" defStyleNum = "dsComment"/>\r
-                        <itemData name = "Substitution" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Parameter" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Operator" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Command" defStyleNum = "dsNormal"/>\r
-                </itemDatas>\r
-        </highlighting>\r
-        <general>\r
-                <comments>\r
-                        <comment name="singleLine" start="#"/>\r
-                </comments>\r
-                <keywords casesensitive="1"/>\r
-        </general>\r
-</language>\r
-\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language>\r
-<language name="BibTeX" version="0.1" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1">\r
-       <highlighting>\r
-               <contexts>\r
-                       <context name="Normal" attribute="Normal Text" lineEndContext="#stay">\r
-                               <DetectChar char="@" attribute="Bib Item" context="Bib Item" />\r
-                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
-                       </context>\r
-\r
-                       <context name="Bib Item" attribute="Bib Item" lineEndContext="#stay">\r
-                               <DetectChar char="{" attribute="Normal Text" context="Ref Key" />\r
-                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
-                       </context>\r
-\r
-                       <context name="Ref Key" attribute="Ref Key" lineEndContext="#stay">\r
-                               <DetectChar char="," attribute="Normal Text" context="Keyword" />\r
-                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
-                       </context>\r
-\r
-                       <context name="Keyword" attribute="Keyword" lineEndContext="#stay">\r
-                               <RegExpr String="\\." attribute="Keyword" context="#stay"/>\r
-                               <DetectChar char="@" attribute="Bib Item" context="Bib Item"/>\r
-                               <DetectChar char="=" attribute="Normal Text" context="#stay"/>\r
-                               <DetectChar char="," attribute="Normal Text" context="#stay"/>\r
-                               <DetectChar char='"' attribute="Value" context="Value"/>\r
-                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
-                       </context>\r
-\r
-                       <context name="Value" attribute="Value" lineEndContext="#stay">\r
-                               <Detect2Chars char="\" char1='"' attribute="Value" context="#stay"/>\r
-                               <DetectChar char='"' attribute="Value" context="Keyword"/>\r
-                       </context>\r
-                       \r
-                       <context name="Comment" attribute="5" lineEndContext="#pop">\r
-                       </context>\r
-               </contexts>\r
-               <itemDatas>\r
-                       <itemData name="Normal Text" defStyleNum="dsNormal"/>\r
-                       <itemData name="Bib Item" defStyleNum="dsNormal" color="#0000ff" selColor="#ffff00" bold="1" italic="0"/>\r
-                       <itemData name="Keyword" defStyleNum="dsNormal" color="#000000" selColor="#dddddd" bold="0" italic="0"/>\r
-                       <itemData name="Value" defStyleNum="dsNormal" color="#aa5500" selColor="#22aaff" bold="0" italic="0"/>\r
-                       <itemData name="Ref Key" defStyleNum="dsNormal" color="#007700" selColor="#00aa00" bold="1" italic="0"/>\r
-                       <itemData name="Comment" defStyleNum="dsNormal" color="#aaaaaa" selColor="#222222" bold="0" italic="0"/>\r
-               </itemDatas>\r
-       </highlighting><general>\r
-       <comments>\r
-               <comment name="singleLine" start="%" />\r
-               </comments>\r
-       </general>\r
-</language>\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="C" version="1.09" kateversion="2.1" section="Sources" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="5">\r
-  <highlighting>\r
-    <list name="keywords">\r
-      <item> break </item>\r
-      <item> case </item>\r
-      <item> continue </item>\r
-      <item> default </item>\r
-      <item> do </item>\r
-      <item> else </item>\r
-      <item> enum </item>\r
-      <item> extern </item>\r
-      <item> for </item>\r
-      <item> goto </item>\r
-      <item> if </item>\r
-      <item> inline </item>\r
-      <item> return </item>\r
-      <item> sizeof </item>\r
-      <item> struct </item>\r
-      <item> switch </item>\r
-      <item> typedef </item>\r
-      <item> union </item>\r
-      <item> while </item>\r
-    </list>\r
-    <list name="types">\r
-      <item> auto </item>\r
-      <item> char </item>\r
-      <item> const </item>\r
-      <item> double </item>\r
-      <item> float </item>\r
-      <item> int </item>\r
-      <item> long </item>\r
-      <item> register </item>\r
-      <item> restrict </item>\r
-      <item> short </item>\r
-      <item> signed </item>\r
-      <item> static </item>\r
-      <item> unsigned </item>\r
-      <item> void </item>\r
-      <item> volatile </item>\r
-      <item> _Imaginary </item>\r
-      <item> _Complex </item>\r
-      <item> _Bool </item>\r
-    </list>\r
-    <list name="attention">\r
-      <item> FIXME </item>\r
-      <item> TODO </item>\r
-      <item> ### </item>\r
-    </list>\r
-    <contexts>\r
-      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">\r
-        <keyword attribute="Keyword" context="#stay" String="keywords"/>\r
-        <keyword attribute="Data Type" context="#stay" String="types"/>\r
-        <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />\r
-        <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />\r
-        <Float attribute="Float" context="#stay">\r
-          <AnyChar String="fF" attribute="Float" context="#stay"/>\r
-        </Float>\r
-        <HlCOct attribute="Octal" context="#stay"/>\r
-        <HlCHex attribute="Hex" context="#stay"/>\r
-        <Int attribute="Decimal" context="#stay" >\r
-          <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>\r
-          <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>\r
-          <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>\r
-          <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>\r
-          <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>\r
-          <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>\r
-          <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>\r
-          <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>\r
-        </Int>\r
-        <HlCChar attribute="Char" context="#stay"/>\r
-        <DetectChar attribute="String" context="String" char="&quot;"/>\r
-        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>\r
-        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>\r
-        <StringDetect attribute="Preprocessor" context="Outscoped" String="#if 0" insensitive="FALSE"/>\r
-        <DetectChar attribute="Preprocessor" context="Preprocessor" char="#"/>\r
-        <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(])" />\r
-        <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />\r
-        <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>\r
-      </context>\r
-      <context attribute="String" lineEndContext="#pop" name="String">\r
-        <LineContinue attribute="String" context="#stay"/>\r
-        <HlCStringChar attribute="String Char" context="#stay"/>\r
-        <DetectChar attribute="String" context="#pop" char="&quot;"/>\r
-      </context>\r
-      <context attribute="Normal Text" lineEndContext="#pop" name="Member">\r
-        <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />\r
-      </context>\r
-      <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">\r
-        <keyword attribute="Decimal" context="#stay" String="attention" />\r
-      </context>\r
-      <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">\r
-        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>\r
-        <keyword attribute="Decimal" context="#stay" String="attention" />\r
-      </context>\r
-      <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">\r
-        <LineContinue attribute="Preprocessor" context="#stay"/>\r
-        <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>\r
-        <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>\r
-        <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>\r
-        <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>\r
-        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2"/>\r
-      </context>\r
-      <context attribute="Preprocessor" lineEndContext="#pop" name="Define">\r
-        <LineContinue attribute="Preprocessor" context="#stay"/>\r
-      </context>\r
-      <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">\r
-        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />\r
-      </context>\r
-      <context attribute="Normal Text" lineEndContext="#pop" name="Some Context"/>\r
-      <context attribute="Normal Text" lineEndContext="#pop" name="Some Context2"/>\r
-      <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >\r
-        <keyword attribute="Decimal" context="#stay" String="attention" />\r
-        <RegExpr attribute="Comment" context="Outscoped intern" String="^#if" />\r
-        <RegExpr attribute="Preprocessor" context="#pop" String="#endif" />\r
-        <RegExpr attribute="Preprocessor" context="#pop" String="#else" />\r
-      </context>\r
-      <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">\r
-        <RegExpr attribute="Comment" context="Outscoped intern" String="#if" />\r
-        <RegExpr attribute="Comment" context="#pop" String="#endif" />\r
-      </context>\r
-    </contexts>\r
-    <itemDatas>\r
-      <itemData name="Normal Text"  defStyleNum="dsNormal"/>\r
-      <itemData name="Keyword"      defStyleNum="dsKeyword"/>\r
-      <itemData name="Function"     defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>\r
-      <itemData name="Data Type"    defStyleNum="dsDataType"/>\r
-      <itemData name="Decimal"      defStyleNum="dsDecVal"/>\r
-      <itemData name="Octal"        defStyleNum="dsBaseN"/>\r
-      <itemData name="Hex"          defStyleNum="dsBaseN"/>\r
-      <itemData name="Float"        defStyleNum="dsFloat"/>\r
-      <itemData name="Char"         defStyleNum="dsChar"/>\r
-      <itemData name="String"       defStyleNum="dsString"/>\r
-      <itemData name="String Char"  defStyleNum="dsChar"/>\r
-      <itemData name="Comment"      defStyleNum="dsComment"/>\r
-      <itemData name="Symbol"       defStyleNum="dsNormal"/>\r
-      <itemData name="Preprocessor" defStyleNum="dsOthers"/>\r
-      <itemData name="Prep. Lib"    defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->\r
-    </itemDatas>\r
-  </highlighting>\r
-  <general>\r
-    <comments>\r
-      <comment name="singleLine" start="//" />\r
-      <comment name="multiLine" start="/*" end="*/" />\r
-    </comments>\r
-    <keywords casesensitive="1" />\r
-  </general>\r
-</language>\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="ChangeLog" version="1.01" kateversion="2.1" section="Other" extensions="ChangeLog" mimetype="">\r
-        <highlighting>\r
-          <contexts>\r
-                <context attribute="Normal Text" lineEndContext="#stay" name="Normal">\r
-                <RegExpr attribute="Keyword" context="#stay" String="^\d\d\d\d\s*-\s*\d\d\s*-\s*\d\d.*$"/>\r
-                </context>\r
-          </contexts>\r
-          <itemDatas>\r
-                <itemData name="Normal Text" defStyleNum="dsNormal"/>\r
-                <itemData name="Keyword" defStyleNum="dsKeyword"/>\r
-                <itemData name="Identifier" defStyleNum="dsOthers"/>\r
-                <itemData name="Types" defStyleNum="dsDataType"/>\r
-                <itemData name="String" defStyleNum="dsString"/>\r
-                <itemData name="Comment" defStyleNum="dsComment"/>\r
-          </itemDatas>\r
-        </highlighting>\r
-  <general>\r
-    <keywords casesensitive="1" />\r
-  </general>\r
-</language>\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="Cisco" version="1.09" kateversion="2.2" section="Scripts"\r
-          extensions="*.cis" mimetype="text/cisco"\r
-          author="Raphaël GRAPINET" license="LGPL">\r
-       <highlighting>\r
-               <list name = "commands">\r
-                       <item> aaa </item>\r
-                       <item> access-list </item>\r
-                       <item> address </item>\r
-                       <item> alias </item>\r
-                       <item> arp </item>\r
-                       <item> async-bootp </item>\r
-                       <item> banner </item>\r
-                       <item> boot </item>\r
-                       <item> bridge </item>\r
-                       <item> buffers </item>\r
-                       <item> busy-message </item>\r
-                       <item> call-history-mib </item>\r
-                       <item> cdp </item>\r
-                       <item> chat-script </item>\r
-                       <item> class-map </item>\r
-                       <item> clock </item>\r
-                       <item> cns </item>\r
-                       <item> config-register </item>\r
-                       <item> controller </item>\r
-                       <item> crypto </item>\r
-                       <item> default </item>\r
-                       <item> default-value </item>\r
-                       <item> dialer </item>\r
-                       <item> dialer-list </item>\r
-                       <item> dnsix-dmdp </item>\r
-                       <item> dnsix-nat </item>\r
-                       <item> downward-compatible-config </item>\r
-                       <item> enable </item>\r
-                       <item> end </item>\r
-                       <item> exception </item>\r
-                       <item> exit </item>\r
-                       <item> file </item>\r
-                       <item> frame-relay </item>\r
-                       <item> help </item>\r
-                       <item> hostname </item>\r
-                       <item> interface </item>\r
-                       <item> ip </item>\r
-                       <item> isdn </item>\r
-                       <item> isdn-mib </item>\r
-                       <item> kerberos </item>\r
-                       <item> key </item>\r
-                       <item> line </item>\r
-                       <item> logging </item>\r
-                       <item> login-string </item>\r
-                       <item> map-class </item>\r
-                       <item> map-list </item>\r
-                       <item> memory-size </item>\r
-                       <item> menu </item>\r
-                       <item> modemcap </item>\r
-                       <item> multilink </item>\r
-                       <item> netbios </item>\r
-                       <item> no </item>\r
-                       <item> ntp </item>\r
-                       <item> partition </item>\r
-                       <item> policy-map </item>\r
-                       <item> priority-list </item>\r
-                       <item> privilege </item>\r
-                       <item> process-max-time </item>\r
-                       <item> prompt </item>\r
-                       <item> queue-list </item>\r
-                       <item> resume-string </item>\r
-                       <item> rlogin </item>\r
-                       <item> rmon </item>\r
-                       <item> route-map </item>\r
-                       <item> router </item>\r
-                       <item> rtr </item>\r
-                       <item> scheduler </item>\r
-                       <item> service </item>\r
-                       <item> snmp-server </item>\r
-                       <item> sntp </item>\r
-                       <item> stackmaker </item>\r
-                       <item> state-machine </item>\r
-                       <item> subscriber-policy </item>\r
-                       <item> tacacs-server </item>\r
-                       <item> template </item>\r
-                       <item> terminal-queue </item>\r
-                       <item> tftp-server </item>\r
-                       <item> time-range </item>\r
-                       <item> username </item>\r
-                       <item> virtual-profile </item>\r
-                       <item> virtual-template </item>\r
-                       <item> vpdn </item>\r
-                       <item> vpdn-group </item>\r
-                       <item> x25 </item>\r
-                       <item> x29 </item>\r
-               </list>\r
-               <list name = "parameters">\r
-                       <item> accounting </item>\r
-                       <item> accounting-list </item>\r
-                       <item> accounting-threshold </item>\r
-                       <item> accounting-transits </item>\r
-                       <item> address-pool </item>\r
-                       <item> as-path </item>\r
-                       <item> audit </item>\r
-                       <item> auth-proxy </item>\r
-                       <item> authentication </item>\r
-                       <item> authorization </item>\r
-                       <item> bgp-community </item>\r
-                       <item> bootp </item>\r
-                       <item> cef </item>\r
-                       <item> classless </item>\r
-                       <item> community-list </item>\r
-                       <item> default-gateway </item>\r
-                       <item> default-network </item>\r
-                       <item> dhcp </item>\r
-                       <item> dhcp-server </item>\r
-                       <item> domain-list </item>\r
-                       <item> domain-lookup </item>\r
-                       <item> domain-name </item>\r
-                       <item> dvmrp </item>\r
-                       <item> exec-callback </item>\r
-                       <item> extcommunity-list </item>\r
-                       <item> finger </item>\r
-                       <item> flow-aggregation </item>\r
-                       <item> flow-cache </item>\r
-                       <item> flow-export </item>\r
-                       <item> forward-protocol </item>\r
-                       <item> ftp </item>\r
-                       <item> gratuitous-arps </item>\r
-                       <item> host </item>\r
-                       <item> host-routing </item>\r
-                       <item> hp-host </item>\r
-                       <item> http </item>\r
-                       <item> icmp </item>\r
-                       <item> inspect </item>\r
-                       <item> local </item>\r
-                       <item> mrm </item>\r
-                       <item> mroute </item>\r
-                       <item> msdp </item>\r
-                       <item> multicast </item>\r
-                       <item> multicast-routing </item>\r
-                       <item> name-server </item>\r
-                       <item> nat </item>\r
-                       <item> new-model </item>\r
-                       <item> ospf </item>\r
-                       <item> password </item>\r
-                       <item> password-encryption </item>\r
-                       <item> pgm </item>\r
-                       <item> pim </item>\r
-                       <item> port-map </item>\r
-                       <item> prefix-list </item>\r
-                       <item> radius </item>\r
-                       <item> rcmd </item>\r
-                       <item> reflexive-list </item>\r
-                       <item> route </item>\r
-                       <item> routing </item>\r
-                       <item> rsvp </item>\r
-                       <item> rtcp </item>\r
-                       <item> sap </item>\r
-                       <item> sdr </item>\r
-                       <item> security </item>\r
-                       <item> source-route </item>\r
-                       <item> subnet-zero </item>\r
-                       <item> tacacs </item>\r
-                       <item> tcp </item>\r
-                       <item> tcp-small-servers </item>\r
-                       <item> telnet </item>\r
-                       <item> tftp </item>\r
-                       <item> timestamps </item>\r
-                       <item> udp-small-servers </item>\r
-                       <item> vrf </item>\r
-                       <item> wccp </item>\r
-               </list>\r
-               <list name = "options">\r
-                       <item> accounting </item>\r
-                       <item> accounting-list </item>\r
-                       <item> accounting-threshold </item>\r
-                       <item> accounting-transits </item>\r
-                       <item> address-pool </item>\r
-                       <item> as-path </item>\r
-                       <item> audit </item>\r
-                       <item> auth-proxy </item>\r
-                       <item> authentication </item>\r
-                       <item> authorization </item>\r
-                       <item> bgp-community </item>\r
-                       <item> bootp </item>\r
-                       <item> cef </item>\r
-                       <item> classless </item>\r
-                       <item> community-list </item>\r
-                       <item> default-gateway </item>\r
-                       <item> default-network </item>\r
-                       <item> dhcp </item>\r
-                       <item> dhcp-server </item>\r
-                       <item> domain-list </item>\r
-                       <item> domain-lookup </item>\r
-                       <item> domain-name </item>\r
-                       <item> dvmrp </item>\r
-                       <item> exec-callback </item>\r
-                       <item> extcommunity-list </item>\r
-                       <item> finger </item>\r
-                       <item> flow-aggregation </item>\r
-                       <item> flow-cache </item>\r
-                       <item> flow-export </item>\r
-                       <item> forward-protocol </item>\r
-                       <item> ftp </item>\r
-                       <item> gratuitous-arps </item>\r
-                       <item> host </item>\r
-                       <item> host-routing </item>\r
-                       <item> hp-host </item>\r
-                       <item> http </item>\r
-                       <item> icmp </item>\r
-                       <item> inspect </item>\r
-                       <item> local </item>\r
-                       <item> mrm </item>\r
-                       <item> mroute </item>\r
-                       <item> msdp </item>\r
-                       <item> multicast </item>\r
-                       <item> multicast-routing </item>\r
-                       <item> name-server </item>\r
-                       <item> nat </item>\r
-                       <item> new-model </item>\r
-                       <item> ospf </item>\r
-                       <item> password </item>\r
-                       <item> password-encryption </item>\r
-                       <item> pgm </item>\r
-                       <item> pim </item>\r
-                       <item> port-map </item>\r
-                       <item> prefix-list </item>\r
-                       <item> radius </item>\r
-                       <item> rcmd </item>\r
-                       <item> reflexive-list </item>\r
-                       <item> route </item>\r
-                       <item> routing </item>\r
-                       <item> rsvp </item>\r
-                       <item> rtcp </item>\r
-                       <item> sap </item>\r
-                       <item> sdr </item>\r
-                       <item> security </item>\r
-                       <item> source-route </item>\r
-                       <item> subnet-zero </item>\r
-                       <item> tacacs </item>\r
-                       <item> tcp </item>\r
-                       <item> tcp-small-servers </item>\r
-                       <item> telnet </item>\r
-                       <item> tftp </item>\r
-                       <item> timestamps </item>\r
-                       <item> udp-small-servers </item>\r
-                       <item> vrf </item>\r
-                       <item> wccp </item>\r
-               </list>\r
-               <contexts>\r
-                        <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bdone\b" insensitive="TRUE" endRegion="dodone1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="dodone1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\belif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bfi\b" insensitive="TRUE" endRegion="iffi1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="TRUE" beginRegion="case1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="\besac\b" insensitive="TRUE" endRegion="case1"/>\r
-                                <RegExpr attribute="Keyword" context="#stay" String="^[^()]+\)" insensitive="TRUE" beginRegion="subcase1"/>\r
-                                <StringDetect attribute="Keyword" context="#stay" String=";;" insensitive="TRUE" endRegion="subcase1"/>\r
-                                <DetectChar attribute="Keyword" context="#stay" char="{" beginRegion="func1"/>\r
-                                <DetectChar attribute="Keyword" context="#stay" char="}" endRegion="func1"/>\r
-\r
-                                <keyword String = "commands" attribute = "Command" context = "#stay"/>\r
-                                <keyword String = "parameters" attribute = "Parameter" context = "#stay"/>\r
-                                <keyword String = "options" attribute = "Keyword" context = "#stay"/>\r
-                                <Int attribute = "Decimal" context = "#stay"/>\r
-                                <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>\r
-                                <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>\r
-                                <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>\r
-                                <DetectChar char="'" attribute = "String" context = "Single Quote"/>\r
-                                <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>\r
-                                <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>\r
-                                <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>\r
-\r
-                        </context>\r
-                        <context name = "String" attribute = "String" lineEndContext="#stay">\r
-                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
-                               <StringDetect String = "\&quot;" attribute = "String" context = "#stay"/>\r
-                                <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>\r
-                        </context>\r
-                       <context name = "Single Quote" attribute = "String" lineEndContext="#stay">\r
-                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
-                               <StringDetect String = "\'" attribute = "String" context = "#stay"/>\r
-                               <DetectChar char = "'" attribute = "String" context = "#pop"/>\r
-                        </context>\r
-                        <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">\r
-                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
-                               <StringDetect String = "\`" attribute = "String" context = "#stay"/>\r
-                                <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>\r
-                        </context>\r
-                        <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">\r
-                                <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>\r
-                        </context>\r
-                </contexts>\r
-                <itemDatas>\r
-                        <itemData name = "Normal Text" defStyleNum = "dsNormal"/>\r
-                        <itemData name = "Keyword" defStyleNum = "dsKeyword"/>\r
-                        <itemData name = "Decimal" defStyleNum = "dsDecVal"/>\r
-                        <itemData name = "Float" defStyleNum = "dsFloat"/>\r
-                        <itemData name = "Char" defStyleNum = "dsChar"/>\r
-                        <itemData name = "String" defStyleNum = "dsString"/>\r
-                        <itemData name = "Comment" defStyleNum = "dsComment"/>\r
-                        <itemData name = "Substitution" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Parameter" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Operator" defStyleNum = "dsOthers"/>\r
-                        <itemData name = "Command" defStyleNum = "dsNormal"/>\r
-                </itemDatas>\r
-       </highlighting>\r
-       <general>\r
-               <comments>\r
-                       <comment name="singleLine" start="!"/>\r
-               </comments>\r
-               <keywords casesensitive="0"/>\r
-               </general>\r
-</language>\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<language name="ColdFusion" version="1.03" kateversion="2.1" section="Markup" extensions="*.cfm;*.cfc;*.cfml;*.dbm" mimetype="text/x-coldfusion">\r
-\r
-       <highlighting>\r
-\r
-               <list name="Script Keywords">\r
-\r
-                       <item> if </item>\r
-                       <item> else </item>\r
-                       <item> for </item>\r
-                       <item> in </item>\r
-                       <item> while </item>\r
-                       <item> do </item>\r
-                       <item> continue </item>\r
-                       <item> break </item>\r
-                       <item> with </item>\r
-                       <item> try </item>\r
-                       <item> catch </item>\r
-                       <item> switch </item>\r
-                       <item> case </item>\r
-                       <item> new </item>\r
-                       <item> var </item>\r
-                       <item> function </item>\r
-                       <item> return </item>\r
-                       <item> this </item>\r
-                       <item> delete </item>\r
-                       <item> true </item>\r
-                       <item> false </item>\r
-                       <item> void </item>\r
-                       <item> throw </item>\r
-                       <item> typeof </item>\r
-                       <item> const </item>\r
-                       <item> default </item>\r
-\r
-               </list>\r
-\r
-               <list name="Script Objects">\r
-\r
-                       <item> Anchor </item>\r
-                       <item> Applet </item>\r
-                       <item> Area </item>\r
-                       <item> Array </item>\r
-                       <item> Boolean </item>\r
-                       <item> Button </item>\r
-                       <item> Checkbox </item>\r
-                       <item> Date </item>\r
-                       <item> Document </item>\r
-                       <item> Event </item>\r
-                       <item> FileUpload </item>\r
-                       <item> Form </item>\r
-                       <item> Frame </item>\r
-                       <item> Function </item>\r
-                       <item> Hidden </item>\r
-                       <item> History </item>\r
-                       <item> Image </item>\r
-                       <item> Layer </item>\r
-                       <item> Linke </item>\r
-                       <item> Location </item>\r
-                       <item> Math </item>\r
-                       <item> Navigator </item>\r
-                       <item> Number </item>\r
-                       <item> Object </item>\r
-                       <item> Option </item>\r
-                       <item> Password </item>\r
-                       <item> Radio </item>\r
-                       <item> RegExp </item>\r
-                       <item> Reset </item>\r
-                       <item> Screen </item>\r
-                       <item> Select </item>\r
-                       <item> String </item>\r
-                       <item> Submit </item>\r
-                       <item> Text </item>\r
-                       <item> Textarea </item>\r
-                       <item> Window </item>\r
-\r
-               </list>\r
-\r
-               <list name="Script Methods">\r
-\r
-                       <item> abs </item>\r
-                       <item> acos </item>\r
-                       <item> alert </item>\r
-                       <item> anchor </item>\r
-                       <item> apply </item>\r
-                       <item> asin </item>\r
-                       <item> atan </item>\r
-                       <item> atan2 </item>\r
-                       <item> back </item>\r
-                       <item> blur </item>\r
-                       <item> call </item>\r
-                       <item> captureEvents </item>\r
-                       <item> ceil </item>\r
-                       <item> charAt </item>\r
-                       <item> charCodeAt </item>\r
-                       <item> clearInterval </item>\r
-                       <item> clearTimeout </item>\r
-                       <item> click </item>\r
-                       <item> close </item>\r
-                       <item> compile </item>\r
-                       <item> concat </item>\r
-                       <item> confirm </item>\r
-                       <item> cos </item>\r
-                       <item> disableExternalCapture </item>\r
-                       <item> enableExternalCapture </item>\r
-                       <item> eval </item>\r
-                       <item> exec </item>\r
-                       <item> exp </item>\r
-                       <item> find </item>\r
-                       <item> floor </item>\r
-                       <item> focus </item>\r
-                       <item> forward </item>\r
-                       <item> fromCharCode </item>\r
-                       <item> getDate </item>\r
-                       <item> getDay </item>\r
-                       <item> getFullYear </item>\r
-                       <item> getHours </item>\r
-                       <item> getMilliseconds </item>\r
-                       <item> getMinutes </item>\r
-                       <item> getMonth </item>\r
-                       <item> getSeconds </item>\r
-                       <item> getSelection </item>\r
-                       <item> getTime </item>\r
-                       <item> getTimezoneOffset </item>\r
-                       <item> getUTCDate </item>\r
-                       <item> getUTCDay </item>\r
-                       <item> getUTCFullYear </item>\r
-                       <item> getUTCHours </item>\r
-                       <item> getUTCMilliseconds </item>\r
-                       <item> getUTCMinutes </item>\r
-                       <item> getUTCMonth </item>\r
-                       <item> getUTCSeconds </item>\r
-                       <item> go </item>\r
-                       <item> handleEvent </item>\r
-                       <item> home </item>\r
-                       <item> indexOf </item>\r
-                       <item> javaEnabled </item>\r
-                       <item> join </item>\r
-                       <item> lastIndexOf </item>\r
-                       <item> link </item>\r
-                       <item> load </item>\r
-                       <item> log </item>\r
-                       <item> match </item>\r
-                       <item> max </item>\r
-                       <item> min </item>\r
-                       <item> moveAbove </item>\r
-                       <item> moveBelow </item>\r
-                       <item> moveBy </item>\r
-                       <item> moveTo </item>\r
-                       <item> moveToAbsolute </item>\r
-                       <item> open </item>\r
-                       <item> parse </item>\r
-                       <item> plugins.refresh </item>\r
-                       <item> pop </item>\r
-                       <item> pow </item>\r
-                       <item> preference </item>\r
-                       <item> print </item>\r
-                       <item> prompt </item>\r
-                       <item> push </item>\r
-                       <item> random </item>\r
-                       <item> releaseEvents </item>\r
-                       <item> reload </item>\r
-                       <item> replace </item>\r
-                       <item> reset </item>\r
-                       <item> resizeBy </item>\r
-                       <item> resizeTo </item>\r
-                       <item> reverse </item>\r
-                       <item> round </item>\r
-                       <item> routeEvent </item>\r
-                       <item> scrollBy </item>\r
-                       <item> scrollTo </item>\r
-                       <item> search </item>\r
-                       <item> select </item>\r
-                       <item> setDate </item>\r
-                       <item> setFullYear </item>\r
-                       <item> setHours </item>\r
-                       <item> setInterval </item>\r
-                       <item> setMilliseconds </item>\r
-                       <item> setMinutes </item>\r
-                       <item> setMonth </item>\r
-                       <item> setSeconds </item>\r
-                       <item> setTime </item>\r
-                       <item> setTimeout </item>\r
-                       <item> setUTCDate </item>\r
-                       <item> setUTCFullYear </item>\r
-                       <item> setUTCHours </item>\r
-                       <item> setUTCMilliseconds </item>\r
-                       <item> setUTCMinutes </item>\r
-                       <item> setUTCMonth </item>\r
-                       <item> setUTCSeconds </item>\r
-                       <item> shift </item>\r
-                       <item> sin </item>\r
-                       <item> slice </item>\r
-                       <item> sort </item>\r
-                       <item> splice </item>\r
-                       <item> split </item>\r
-                       <item> sqrt </item>\r
-                       <item> stop </item>\r
-                       <item> String formatting </item>\r
-                       <item> submit </item>\r
-                       <item> substr </item>\r
-                       <item> substring </item>\r
-                       <item> taintEnabled </item>\r
-                       <item> tan </item>\r
-                       <item> test </item>\r
-                       <item> toLocaleString </item>\r
-                       <item> toLowerCase </item>\r
-                       <item> toSource </item>\r
-                       <item> toString </item>\r
-                       <item> toUpperCase </item>\r
-                       <item> toUTCString </item>\r
-                       <item> unshift </item>\r
-                       <item> unwatch </item>\r
-                       <item> UTC </item>\r
-                       <item> valueOf </item>\r
-                       <item> watch </item>\r
-                       <item> write </item>\r
-                       <item> writeln  </item>\r
-\r
-               </list>\r
-\r
-               <list name="CFSCRIPT Keywords">\r
-\r
-                       <item> break </item>\r
-                       <item> case </item>\r
-                       <item> catch </item>\r
-                       <item> continue </item>\r
-                       <item> default </item>\r
-                       <item> do </item>\r
-                       <item> else </item>\r
-                       <item> for </item>\r
-                       <item> function </item>\r
-                       <item> if </item>\r
-                       <item> in </item>\r
-                       <item> return </item>\r
-                       <item> switch </item>\r
-                       <item> try </item>\r
-                       <item> var </item>\r
-                       <item> while </item>\r
-\r
-               </list>\r
-\r
-               <list name="CFSCRIPT Functions">\r
-\r
-                       <item> Abs </item>\r
-                       <item> ACos </item>\r
-                       <item> ArrayAppend </item>\r
-                       <item> ArrayAvg </item>\r
-                       <item> ArrayClear </item>\r
-                       <item> ArrayDeleteAt </item>\r
-                       <item> ArrayInsertAt </item>\r
-                       <item> ArrayIsEmpty </item>\r
-                       <item> ArrayLen </item>\r
-                       <item> ArrayMax </item>\r
-                       <item> ArrayMin </item>\r
-                       <item> ArrayNew </item>\r
-                       <item> ArrayPrepend </item>\r
-                       <item> ArrayResize </item>\r
-                       <item> ArraySet </item>\r
-                       <item> ArraySort </item>\r
-                       <item> ArraySum </item>\r
-                       <item> ArraySwap </item>\r
-                       <item> ArrayToList </item>\r
-                       <item> Asc </item>\r
-                       <item> ASin </item>\r
-                       <item> Atn </item>\r
-                       <item> BitAnd </item>\r
-                       <item> BitMaskClear </item>\r
-                       <item> BitMaskRead </item>\r
-                       <item> BitMaskSet </item>\r
-                       <item> BitNot </item>\r
-                       <item> BitOr </item>\r
-                       <item> BitSHLN </item>\r
-                       <item> BitSHRN </item>\r
-                       <item> BitXor </item>\r
-                       <item> Ceiling </item>\r
-                       <item> Chr </item>\r
-                       <item> CJustify </item>\r
-                       <item> Compare </item>\r
-                       <item> CompareNoCase </item>\r
-                       <item> Cos </item>\r
-                       <item> CreateDate </item>\r
-                       <item> CreateDateTime </item>\r
-                       <item> CreateObject </item>\r
-                       <item> CreateODBCDate </item>\r
-                       <item> CreateODBCDateTime </item>\r
-                       <item> CreateODBCTime </item>\r
-                       <item> CreateTime </item>\r
-                       <item> CreateTimeSpan </item>\r
-                       <item> CreateUUID </item>\r
-                       <item> DateAdd </item>\r
-                       <item> DateCompare </item>\r
-                       <item> DateConvert </item>\r
-                       <item> DateDiff </item>\r
-                       <item> DateFormat </item>\r
-                       <item> DatePart </item>\r
-                       <item> Day </item>\r
-                       <item> DayOfWeek </item>\r
-                       <item> DayOfWeekAsString </item>\r
-                       <item> DayOfYear </item>\r
-                       <item> DaysInMonth </item>\r
-                       <item> DaysInYear </item>\r
-                       <item> DE </item>\r
-                       <item> DecimalFormat </item>\r
-                       <item> DecrementValue </item>\r
-                       <item> Decrypt </item>\r
-                       <item> DeleteClientVariable </item>\r
-                       <item> DirectoryExists </item>\r
-                       <item> DollarFormat </item>\r
-                       <item> Duplicate </item>\r
-                       <item> Encrypt </item>\r
-                       <item> Evaluate </item>\r
-                       <item> Exp </item>\r
-                       <item> ExpandPath </item>\r
-                       <item> FileExists </item>\r
-                       <item> Find </item>\r
-                       <item> FindNoCase </item>\r
-                       <item> FindOneOf </item>\r
-                       <item> FirstDayOfMonth </item>\r
-                       <item> Fix </item>\r
-                       <item> FormatBaseN </item>\r
-                       <item> GetAuthUser </item>\r
-                       <item> GetBaseTagData </item>\r
-                       <item> GetBaseTagList </item>\r
-                       <item> GetBaseTemplatePath </item>\r
-                       <item> GetClientVariablesList </item>\r
-                       <item> GetCurrentTemplatePath </item>\r
-                       <item> GetDirectoryFromPath </item>\r
-                       <item> GetException </item>\r
-                       <item> GetFileFromPath </item>\r
-                       <item> GetFunctionList </item>\r
-                       <item> GetHttpRequestData </item>\r
-                       <item> GetHttpTimeString </item>\r
-                       <item> GetK2ServerDocCount </item>\r
-                       <item> GetK2ServerDocCountLimit </item>\r
-                       <item> GetLocale </item>\r
-                       <item> GetMetaData </item>\r
-                       <item> GetMetricData </item>\r
-                       <item> GetPageContext </item>\r
-                       <item> GetProfileSections </item>\r
-                       <item> GetProfileString </item>\r
-                       <item> GetServiceSettings </item>\r
-                       <item> GetTempDirectory </item>\r
-                       <item> GetTempFile </item>\r
-                       <item> GetTemplatePath </item>\r
-                       <item> GetTickCount </item>\r
-                       <item> GetTimeZoneInfo </item>\r
-                       <item> GetToken </item>\r
-                       <item> Hash </item>\r
-                       <item> Hour </item>\r
-                       <item> HTMLCodeFormat </item>\r
-                       <item> HTMLEditFormat </item>\r
-                       <item> IIf </item>\r
-                       <item> IncrementValue </item>\r
-                       <item> InputBaseN </item>\r
-                       <item> Insert </item>\r
-                       <item> Int </item>\r
-                       <item> IsArray </item>\r
-                       <item> IsBinary </item>\r
-                       <item> IsBoolean </item>\r
-                       <item> IsCustomFunction </item>\r
-                       <item> IsDate </item>\r
-                       <item> IsDebugMode </item>\r
-                       <item> IsDefined </item>\r
-                       <item> IsK2ServerABroker </item>\r
-                       <item> IsK2ServerDocCountExceeded </item>\r
-                       <item> IsK2ServerOnline </item>\r
-                       <item> IsLeapYear </item>\r
-                       <item> IsNumeric </item>\r
-                       <item> IsNumericDate </item>\r
-                       <item> IsObject </item>\r
-                       <item> IsQuery </item>\r
-                       <item> IsSimpleValue </item>\r
-                       <item> IsStruct </item>\r
-                       <item> IsUserInRole </item>\r
-                       <item> IsWDDX </item>\r
-                       <item> IsXmlDoc </item>\r
-                       <item> IsXmlElement </item>\r
-                       <item> IsXmlRoot </item>\r
-                       <item> JavaCast </item>\r
-                       <item> JSStringFormat </item>\r
-                       <item> LCase </item>\r
-                       <item> Left </item>\r
-                       <item> Len </item>\r
-                       <item> ListAppend </item>\r
-                       <item> ListChangeDelims </item>\r
-                       <item> ListContains </item>\r
-                       <item> ListContainsNoCase </item>\r
-                       <item> ListDeleteAt </item>\r
-                       <item> ListFind </item>\r
-                       <item> ListFindNoCase </item>\r
-                       <item> ListFirst </item>\r
-                       <item> ListGetAt </item>\r
-                       <item> ListInsertAt </item>\r
-                       <item> ListLast </item>\r
-                       <item> ListLen </item>\r
-                       <item> ListPrepend </item>\r
-                       <item> ListQualify </item>\r
-                       <item> ListRest </item>\r
-                       <item> ListSetAt </item>\r
-                       <item> ListSort </item>\r
-                       <item> ListToArray </item>\r
-                       <item> ListValueCount </item>\r
-                       <item> ListValueCountNoCase </item>\r
-                       <item> LJustify </item>\r
-                       <item> Log </item>\r
-                       <item> Log10 </item>\r
-                       <item> LSCurrencyFormat </item>\r
-                       <item> LSDateFormat </item>\r
-                       <item> LSEuroCurrencyFormat </item>\r
-                       <item> LSIsCurrency </item>\r
-                       <item> LSIsDate </item>\r
-                       <item> LSIsNumeric </item>\r
-                       <item> LSNumberFormat </item>\r
-                       <item> LSParseCurrency </item>\r
-                       <item> LSParseDateTime </item>\r
-                       <item> LSParseEuroCurrency </item>\r
-                       <item> LSParseNumber </item>\r
-                       <item> LSTimeFormat </item>\r
-                       <item> LTrim </item>\r
-                       <item> Max </item>\r
-                       <item> Mid </item>\r
-                       <item> Min </item>\r
-                       <item> Minute </item>\r
-                       <item> Month </item>\r
-                       <item> MonthAsString </item>\r
-                       <item> Now </item>\r
-                       <item> NumberFormat </item>\r
-                       <item> ParagraphFormat </item>\r
-                       <item> ParameterExists </item>\r
-                       <item> ParseDateTime </item>\r
-                       <item> Pi </item>\r
-                       <item> PreserveSingleQuotes </item>\r
-                       <item> Quarter </item>\r
-                       <item> QueryAddColumn </item>\r
-                       <item> QueryAddRow </item>\r
-                       <item> QueryNew </item>\r
-                       <item> QuerySetCell </item>\r
-                       <item> QuotedValueList </item>\r
-                       <item> Rand </item>\r
-                       <item> Randomize </item>\r
-                       <item> RandRange </item>\r
-                       <item> REFind </item>\r
-                       <item> REFindNoCase </item>\r
-                       <item> RemoveChars </item>\r
-                       <item> RepeatString </item>\r
-                       <item> Replace </item>\r
-                       <item> ReplaceList </item>\r
-                       <item> ReplaceNoCase </item>\r
-                       <item> REReplace </item>\r
-                       <item> REReplaceNoCase </item>\r
-                       <item> Reverse </item>\r
-                       <item> Right </item>\r
-                       <item> RJustify </item>\r
-                       <item> Round </item>\r
-                       <item> RTrim </item>\r
-                       <item> Second </item>\r
-                       <item> SetEncoding </item>\r
-                       <item> SetLocale </item>\r
-                       <item> SetProfileString </item>\r
-                       <item> SetVariable </item>\r
-                       <item> Sgn </item>\r
-                       <item> Sin </item>\r
-                       <item> SpanExcluding </item>\r
-                       <item> SpanIncluding </item>\r
-                       <item> Sqr </item>\r
-                       <item> StripCR </item>\r
-                       <item> StructAppend </item>\r
-                       <item> StructClear </item>\r
-                       <item> StructCopy </item>\r
-                       <item> StructCount </item>\r
-                       <item> StructDelete </item>\r
-                       <item> StructFind </item>\r
-                       <item> StructFindKey </item>\r
-                       <item> StructFindValue </item>\r
-                       <item> StructGet </item>\r
-                       <item> StructInsert </item>\r
-                       <item> StructIsEmpty </item>\r
-                       <item> StructKeyArray </item>\r
-                       <item> StructKeyExists </item>\r
-                       <item> StructKeyList </item>\r
-                       <item> StructNew </item>\r
-                       <item> StructSort </item>\r
-                       <item> StructUpdate </item>\r
-                       <item> Tan </item>\r
-                       <item> TimeFormat </item>\r
-                       <item> ToBase64 </item>\r
-                       <item> ToBinary </item>\r
-                       <item> ToString </item>\r
-                       <item> Trim </item>\r
-                       <item> UCase </item>\r
-                       <item> URLDecode </item>\r
-                       <item> URLEncodedFormat </item>\r
-                       <item> URLSessionFormat </item>\r
-                       <item> Val </item>\r
-                       <item> ValueList </item>\r
-                       <item> Week </item>\r
-                       <item> WriteOutput </item>\r
-                       <item> XmlChildPos </item>\r
-                       <item> XmlElemNew </item>\r
-                       <item> XmlFormat </item>\r
-                       <item> XmlNew </item>\r
-                       <item> XmlParse </item>\r
-                       <item> XmlSearch </item>\r
-                       <item> XmlTransform </item>\r
-                       <item> Year </item>\r
-                       <item> YesNoFormat </item>\r
-\r
-               </list>\r
-\r
-               <contexts>\r
-\r
-                       <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">\r
-                               <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />\r
-                               <StringDetect attribute="HTML Comment" context="ctxHTML Comment" String="&lt;!--" />\r
-                               <RegExpr attribute="Script Tags" context="ctxCFSCRIPT Tag" String="&lt;[cC][fF][sS][cC][rR][iI][pP][tT]" />\r
-                               <RegExpr attribute="Script Tags" context="ctxSCRIPT Tag" String="&lt;[sS][cC][rR][iI][pP][tT]" />\r
-                               <RegExpr attribute="Style Tags" context="ctxSTYLE Tag" String="&lt;[sS][tT][yY][lL][eE]" />\r
-                               <DetectChar attribute="HTML Entities" context="ctxHTML Entities" char="&amp;" />\r
-                               <RegExpr attribute="Custom Tags" context="ctxCustom Tag" String="&lt;\/?[cC][fF]_" />\r
-                               <RegExpr attribute="CFX Tags" context="ctxCFX Tag" String="&lt;\/?[cC][fF][xX]_" />\r
-                               <RegExpr attribute="CF Tags" context="ctxCF Tag" String="&lt;\/?[cC][fF]" />\r
-                               <RegExpr attribute="Table Tags" context="ctxTable Tag" String="&lt;\/?([tT][aAhHbBfFrRdD])|([cC][aA][pP][tT])" />\r
-                               <RegExpr attribute="Anchor Tags" context="ctxAnchor Tag" String="&lt;\/?[aA] " />\r
-                               <RegExpr attribute="Image Tags" context="ctxImage Tag" String="&lt;\/?[iI][mM][gG] " />\r
-                               <RegExpr attribute="Tags" context="ctxTag" String="&lt;!?\/?[a-zA-Z0-9_]+" />\r
-                       </context>\r
-\r
-\r
-\r
-                       <context name="ctxCFSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Script Tags" context="ctxCFSCRIPT Block" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Script Tags" context="ctxSCRIPT Block" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxSTYLE Tag" attribute="Style Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Style Tags" context="ctxSTYLE Block" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-\r
-\r
-                       <context name="ctxTag" attribute="Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Tags" context="#pop" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxTable Tag" attribute="Table Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Table Tags" context="#pop" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxAnchor Tag" attribute="Anchor Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Anchor Tags" context="#pop" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxImage Tag" attribute="Image Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Image Tags" context="#pop" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxCF Tag" attribute="CF Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="CF Tags" context="#pop" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxCustom Tag" attribute="Custom Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="Custom Tags" context="#pop" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-                       <context name="ctxCFX Tag" attribute="CFX Tags" lineEndContext="#stay">\r
-                               <DetectChar attribute="CFX Tags" context="#pop" char="&gt;" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-\r
-\r
-                       <context name="ctxHTML Comment" attribute="HTML Comment" lineEndContext="#stay">\r
-                               <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />\r
-                               <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />\r
-                       </context>\r
-\r
-                       <context name="ctxCF Comment" attribute="CF Comment" lineEndContext="#stay">\r
-                               <StringDetect attribute="CF Comment" context="#pop" String="---&gt;" />\r
-                       </context>\r
-\r
-                       <context name="ctxC Style Comment" attribute="Script Comment" lineEndContext="#stay">\r
-                       <Detect2Chars attribute="Script Comment" context="#pop" char="*" char1="/" />\r
-                       </context>\r
-\r
-                       <context name="ctxOne Line Comment" attribute="Script Comment" lineEndContext="#pop" />\r
-\r
-                       <context name="ctxHTML Entities" attribute="HTML Entities" lineEndContext="#pop">\r
-                               <DetectChar attribute="HTML Entities" context="#pop" char=";" />\r
-                       </context>\r
-\r
-\r
-\r
-                       <context name="ctxCFSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">\r
-                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
-                               <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />\r
-                               <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />\r
-                               <Int attribute="Script Numbers" context="#stay" />\r
-                               <Float attribute="Script Numbers" context="#stay" />\r
-                               <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />\r
-                               <AnyChar attribute="Brackets" context="#stay" String="{}" />\r
-\r
-                               <keyword attribute="Script Keywords" context="#stay" String="CFSCRIPT Keywords" />\r
-                               <keyword attribute="Script Functions" context="#stay" String="CFSCRIPT Functions" />\r
-                               <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[cC][fF][sS][cC][rR][iI][pP][tT]&gt;" />\r
-                       </context>\r
-\r
-\r
-\r
-                       <context name="ctxSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">\r
-                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
-                               <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />\r
-                               <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />\r
-                               <Int attribute="Script Numbers" context="#stay" />\r
-                               <Float attribute="Script Numbers" context="#stay" />\r
-                               <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />\r
-                               <AnyChar attribute="Brackets" context="#stay" String="{}" />\r
-\r
-                               <keyword attribute="Script Keywords" context="#stay" String="Script Keywords" />\r
-                               <keyword attribute="Script Objects" context="#stay" String="Script Objects" />\r
-                               <keyword attribute="Script Functions" context="#stay" String="Script Methods" />\r
-                               <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[sS][cC][rR][iI][pP][tT]&gt;" />\r
-                       </context>\r
-\r
-\r
-\r
-                       <context name="ctxSTYLE Block" attribute="Style Selectors" lineEndContext="#stay">\r
-                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
-                               <DetectChar attribute="Brackets" context="ctxStyle Properties" char="{" />\r
-                               <RegExpr attribute="Style Tags" context="#pop#pop" String="&lt;/[sS][tT][yY][lL][eE]&gt;" />\r
-                       </context>\r
-\r
-                       <context name="ctxStyle Properties" attribute="Style Properties" lineEndContext="#stay">\r
-                               <DetectChar attribute="Brackets" context="#pop" char="}" />\r
-                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
-                               <DetectChar attribute="Normal Text" context="ctxStyle Values" char=":" />\r
-                       </context>\r
-\r
-                       <context name="ctxStyle Values" attribute="Style Values" lineEndContext="#pop">\r
-                               <DetectChar attribute="Normal Text" context="#pop" char=";" />\r
-                               <DetectChar attribute="Normal Text" context="#stay" char="," />\r
-                               <Int attribute="Numbers" context="#stay" />\r
-                               <Float attribute="Numbers" context="#stay" />\r
-                               <RegExpr attribute="Numbers" context="#stay" String="#([0-9a-fA-F]{3})|([0-9a-fA-F]{6})" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
-                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
-                       </context>\r
-\r
-               </contexts>\r
-\r
-               <itemDatas>\r
-\r
-                       <itemData name="Normal Text" defStyleNum="dsNormal"                     color="#000000" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Tags" defStyleNum="dsNormal"                            color="#000080" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Table Tags" defStyleNum="dsNormal"                      color="#008080" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Script Tags" defStyleNum="dsNormal"                     color="#800000" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Image Tags" defStyleNum="dsNormal"                      color="#800080" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Style Tags" defStyleNum="dsNormal"                      color="#800080" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Anchor Tags" defStyleNum="dsNormal"                     color="#008000" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Attribute Values" defStyleNum="dsNormal"        color="#0000ff" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="HTML Comment" defStyleNum="dsComment"           color="#008000" selColor="#999999" bold="0" italic="0" />\r
-                       <itemData name="CF Comment" defStyleNum="dsComment"                     color="#ff9900" selColor="#999999" bold="0" italic="0" />\r
-                       <itemData name="Script Comment" defStyleNum="dsComment"         color="#ff9900" selColor="#999999" bold="0" italic="0" />\r
-                       <itemData name="CF Tags" defStyleNum="dsNormal"                         color="#800000" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Custom Tags" defStyleNum="dsNormal"                     color="#cc6666" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="CFX Tags" defStyleNum="dsNormal"                        color="#008000" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Numbers" defStyleNum="dsNormal"                         color="#0000ff" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="HTML Entities" defStyleNum="dsNormal"           color="#000000" selColor="#ffffff" bold="1" italic="0" />\r
-                       <itemData name="Style Selectors" defStyleNum="dsNormal"         color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Style Properties" defStyleNum="dsNormal"        color="#000080" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Style Values" defStyleNum="dsNormal"            color="#ff0000" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Brackets" defStyleNum="dsNormal"                        color="#000080" selColor="#ffffff" bold="1" italic="0" />\r
-                       <itemData name="Script Numbers" defStyleNum="dsNormal"          color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Script Strings" defStyleNum="dsNormal"          color="#008080" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Script Operators" defStyleNum="dsNormal"        color="#0000ff" selColor="#ffffff" bold="0" italic="0" />\r
-                       <itemData name="Script Keywords" defStyleNum="dsNormal"         color="#0000cc" selColor="#ffffff" bold="1" italic="0" />\r
-                       <itemData name="Script Functions" defStyleNum="dsNormal"        color="#000080" selColor="#ffffff" bold="1" italic="0" />\r
-                       <itemData name="Script Objects" defStyleNum="dsNormal"          color="#0000cc" selColor="#ffffff" bold="1" italic="0" />\r
-\r
-               </itemDatas>\r
-\r
-       </highlighting>\r
-\r
-       <general>\r
-\r
-               <comments>\r
-\r
-                       <comment name="multiLine" start="&lt;!--" end="--&gt;" />\r
-                       <comment name="multiLine" start="/*" end="*/" />\r
-                       <comment name="singleLine" start="//" />\r
-\r
-               </comments>\r
-\r
-               <keywords casesensitive="0" weakDeliminator="-" />\r
-\r
-       </general>\r
-\r
-</language>\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE language SYSTEM "language.dtd">\r
-<!-- Author: Werner Braun <wb@o3-software.de> -->\r
-<!-- 29.05.2003 wb mailed to the kate-team (cullmann) -->\r
-<!-- 23.05.2003 wb added *.bro File-Type for GPCP Browser output-->\r
-<!-- 09.05.2003 wb nested comments allowed (maximum two level nesting) -->\r
-<!-- 07.04.2003 wb IN Problem solved -->\r
-<!-- 06.05.2003 wb NEW without ( -->\r
-<!-- 22.04.2003 wb Minor bugfixes -->\r
-<!-- 19.04.2003 wb Some more Enhancements -->\r
-<!-- 18.04.2003 wb Enhancenment for Maior / Minor Comments and Full / ReadOnly Exports, Folds for Procedures, Records, Comments -->\r
-<!-- 17.04.2003 wb Enhancements for Relation and Operators -->\r
-<language name="Component-Pascal" version="1.05" kateversion="2.1" section="Sources"\r
-          extensions="*.cp;*.bro" mimetype="text/x-component-pascal"\r
-          author="Werner Braun (wb@o3-software.de)" license="">\r
-       <highlighting>\r
-               <list name="keywords">\r
-                       <item> BEGIN </item>\r
-                       <item> BY </item>\r
-                       <item> CASE </item>\r
-                       <item> CLOSE </item>\r
-                       <item> CONST </item>\r
-                       <item> DO </item>\r
-                       <item> ELSE </item>\r
-                       <item> ELSIF </item>\r
-                       <item> END </item>\r
-                       <item> FOR </item>\r
-                       <item> IF </item>\r
-                       <item> IMPORT </item>\r
-                       <item> LOOP </item>\r
-                       <item> MODULE </item>\r
-                       <item> NEW </item>\r
-                       <item> OF </item>\r
-                       <item> OUT </item>\r
-                       <item> PROCEDURE </item>\r
-                       <item> REPEAT </item>\r
-                       <item> THEN </item>\r
-                       <item> TO </item>\r
-                       <item> TYPE </item>\r
-                       <item> UNTIL </item>\r
-                       <item> VAR </item>\r
-                       <item> WHILE </item>\r
-                       <item> WITH </item>\r
-               </list>\r
-               <list name="exits">\r
-                       <item> ASSERT </item>\r
-                       <item> EXIT </item>\r
-                       <item> HALT </item>\r
-                       <item> RETURN </item>\r
-               </list>\r
-               <list name="types">\r
-                       <item> ANYPTR </item>\r
-                       <item> ANYREC </item>\r
-                       <item> ARRAY </item>\r
-                       <item> BOOLEAN </item>\r
-                       <item> SHORTCHAR </item>\r
-                       <item> CHAR </item>\r
-                       <item> BYTE </item>\r
-                       <item> SHORTINT </item>\r
-                       <item> INTEGER </item>\r
-                       <item> LONGINT </item>\r
-                       <item> POINTER </item>\r
-                       <item> RECORD </item>\r
-                       <item> SHORTREAL </item>\r
-                       <item> REAL </item>\r
-                       <item> SET </item>\r
-               </list>\r
-               <list name="attributes">\r
-                       <item> ABSTRACT </item>\r
-                       <item> EMPTY </item>\r
-                       <item> EXTENSIBLE </item>\r
-                       <item> LIMITED </item>\r
-               </list>\r
-               <list name="builtins">\r
-                       <item> ABS </item>\r
-                       <item> ASH </item>\r
-                       <item> BITS </item>\r
-                       <item> CAP </item>\r
-                       <item> CHR </item>\r
-                       <item> DEC </item>\r
-                       <item> ENTIER </item>\r
-                       <item> EXCL </item>\r
-                       <item> INC </item>\r
-                       <item> INCL </item>\r
-                       <item> LEN </item>\r
-                       <item> LONG </item>\r
-                       <item> MAX </item>\r
-                       <item> MIN </item>\r
-                       <item> ODD </item>\r
-                       <item> ORD </item>\r
-                       <item> SHORT </item>\r
-                       <item> SIZE </item>\r
-               </list>\r
-               <list name="specials">\r
-                       <item> FALSE </item>\r
-                       <item> INF </item>\r
-                       <item> NIL </item>\r
-                       <item> TRUE </item>\r
-               </list>\r
-               <contexts>\r
-                       <context attribute="Normal Text" lineEndContext="#stay" name="Normal">\r
-                               <StringDetect attribute="CommentMaior" context="Comment1" String="(**" beginRegion="Comment"/>\r
-                               <Detect2Chars attribute="CommentMinor" context="Comment2" char="(" char1="*" beginRegion="Comment"/>\r
-                               <DetectChar attribute="String" context="String1" char="&quot;" />\r
-                               <DetectChar attribute="String" context="String2" char="'" />\r
-                               <RegExpr attribute="Keyword" context="#stay" String="PROCEDURE\s" beginRegion="Proc"/>\r
-                               <RegExpr attribute="Normal Text" context="#stay" String="ABSTRACT;|EMPTY;|END\s*[A-Za-z][A-Za-z0-9_]*\;" endRegion="Proc"/>\r
-                               <RegExpr attribute="Type" context="#stay" String="RECORD" beginRegion="Rec"/>\r
-                               <RegExpr attribute="Keyword" context="#stay" String="END" endRegion="Rec"/>\r
-                               <StringDetect attribute="MemAlloc" context="#stay" String="NEW"/>\r
-                               <keyword attribute="Keyword" context="#stay" String="keywords"/>\r
-                               <keyword attribute="Exit" context="#stay" String="exits"/>\r
-                               <keyword attribute="Type" context="#stay" String="types"/>\r
-                               <keyword attribute="Attribute" context="#stay" String="attributes"/>\r
-                               <keyword attribute="Builtin" context="#stay" String="builtins"/>\r
-                               <keyword attribute="SpecialValues" context="#stay" String="specials"/>\r
-                               <RegExpr attribute="Integer" context="#stay" String="\s[\+|\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))"/>\r
-                               <Float attribute="Float" context="#stay"/>\r
-                               <RegExpr attribute="Char" context="#stay" String="\s[0-9][0-9A-F]*X"/>\r
-                               <RegExpr attribute="ExportFull" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\*"/>\r
-                               <RegExpr attribute="ExportReadOnly" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\-"/>\r
-                               <RegExpr attribute="Relation" context="#stay" String="\s(=|#|&lt;|&lt;=|&gt;|&gt;=|IN\s|IS)"/>\r
-                               <RegExpr attribute="Operator" context="#stay" String="\s(\+|\-|OR|\*|/|DIV|MOD|\&amp;)"/>\r
-                       </context>\r
-                       <context attribute="CommentMaior" lineEndContext="#stay" name="Comment1">\r
-                               <Detect2Chars attribute="CommentMaior" context="#pop" char="*" char1=")" endRegion="Comment"/>\r
-                               <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>\r
-                       </context>\r
-                       <context attribute="CommentMinor" lineEndContext="#stay" name="Comment2">\r
-                               <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")" endRegion="Comment"/>\r
-                               <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>\r
-                       </context>\r
-                       <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN">\r
-                               <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>\r
-                               <Detect2Chars attribute="CommentMinor" context="CommentN2" char="(" char1="*"/>\r
-                       </context>\r
-                       <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN2">\r
-                               <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>\r
-                       </context>\r
-                       <context attribute="String" lineEndContext="#stay" name="String1">\r
-                               <DetectChar attribute="String" context="#pop" char="&quot;"/>\r
-                       </context>\r
-                       <context attribute="String" lineEndContext="#stay" name="String2">\r
-                               <DetectChar attribute="String" context="#pop" char="'"/>\r
-                       </context>\r
-               </contexts>\r
-               <itemDatas>\r
-                       <itemData name="Normal Text" defStyleNum="dsNormal" />\r
-                       <itemData name="CommentMaior" defStyleNum="dsComment" />\r
-                       <itemData name="CommentMinor" defStyleNum="dsComment" />\r
-                       <itemData name="String" defStyleNum="dsString" />\r
-                       <itemData name="Keyword" defStyleNum="dsKeyword" />\r
-                       <itemData name="MemAlloc" defStyleNum="dsKeyword" />\r
-                       <itemData name="Exit" defStyleNum="dsKeyword"/>\r
-                       <itemData name="Type" defStyleNum="dsDataType"/>\r
-                       <itemData name="Attribute" defStyleNum="dsOthers"/>\r
-                       <itemData name="Builtin" defStyleNum="dsNormal"/>\r
-                       <itemData name="Integer" defStyleNum="dsBaseN"/>\r
-                       <itemData name="Float" defStyleNum="dsFloat" />\r
-                       <itemData name="Char" defStyleNum="dsChar" />\r
-                       <itemData name="SpecialValues" defStyleNum="dsDecVal"/>\r
-                       <itemData name="ExportFull" defStyleNum="dsOthers"/>\r
-                       <itemData name="ExportReadOnly" defStyleNum="dsOthers"/>\r
-                       <itemData name="Relation" defStyleNum="dsNormal"/>\r
-                       <itemData name="Operator" defStyleNum="dsNormal"/>\r
-               </itemDatas>\r
-       </highlighting>\r
-       <general>\r
-               <keywords casesensitive="1" />\r
-               <comments>\r
-                       <comment name="multiLine" start="(*" end="*)" />\r
-               </comments>\r
-       </general>\r
-</language>\r
-\r
diff --git a/tests/examplefiles/r-console-transcript.Rout b/tests/examplefiles/r-console-transcript.Rout
new file mode 100644 (file)
index 0000000..d0cf34b
--- /dev/null
@@ -0,0 +1,38 @@
+
+R version 2.9.2 (2009-08-24)
+Copyright (C) 2009 The R Foundation for Statistical Computing
+ISBN 3-900051-07-0
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+  Natural language support but running in an English locale
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+[R.app GUI 1.29 (5464) i386-apple-darwin8.11.1]
+
+> x <- function {}
+Error: syntax error
+> x <- function() {}
+> x <- function() {
++ cat("hello")
++ cat("world")
++ }
+> x
+function() {
+cat("hello")
+cat("world")
+}
+> x()
+helloworld
+> 2 + 2
+[1] 4
+> 
\ No newline at end of file
diff --git a/tests/examplefiles/test.adb b/tests/examplefiles/test.adb
new file mode 100644 (file)
index 0000000..b79f3a5
--- /dev/null
@@ -0,0 +1,211 @@
+--  Model IED Simulator
+--  COL Gene Ressler, 1 December 2007
+with Ada.Text_IO;
+
+with Ada.Characters.Latin_1;
+use  Ada.Characters.Latin_1;
+
+with Ada.Strings.Fixed;
+use  Ada.Strings.Fixed;
+
+with Ada.Strings;
+with Ada.Strings.Bounded;
+
+with Binary_Search;
+
+with Ada.Containers.Generic_Array_Sort;
+
+package body Scanner is
+   
+   Constant_123   : constant Character := Character'Val (16#00#);
+   MAX_KEYWORD_LENGTH_C : constant Natural := 24;
+   
+   New_Constant : constant New_Type
+     := 2;
+   
+   KEYWORDS_C : constant Keyword_Array_T :=
+     (To_BS("description"),
+      To_BS("with"));
+   
+   procedure Blah;
+   
+   procedure blah is
+   begin
+      
+      Declaration:
+      declare
+         Joe : Type_Type := Random;
+      begin
+         Do_Something;
+      end Declaration;
+      Loop_ID:
+         loop
+            Loop_Do;
+            exit when 1=2;
+         end loop Loop_ID;
+      if True or else False then
+         Do_This();
+      elsif not False and then True then
+         Do_That;
+      else
+         Panic;
+      end if;
+   end blah;
+   
+   function "*" (Left, Right : in Integer) return Integer is
+   begin
+      <<Goto_Label>>
+      goto Goto_Label;
+      return Left + Right;
+   end "*";
+   
+   function Function_Specification
+     (Param_1        : in Blah; 
+      Param2, param3 : in access Blah_Type := 0)
+     return It_Type;
+   
+   package Rename_Check renames Ada.Text_IO;
+
+   type New_Float is delta 0.001 digits 12;
+   
+   package Package_Inst is new Ada.Strings.Bounded.Generic_Bounded_Length
+     (Max => MAX_KEYWORD_LENGTH_C);
+
+   type Array_Decl12 is array (Positive range <>) of SB.Bounded_String;
+   type Array_Decl3 is array (New_Type range Thing_1 .. Thing_2) of SB.Bounded_String;
+
+   type Boring_Type is
+     (Start,
+      End_Error);
+
+   subtype Sub_Type_check is Character range '0' .. '9';
+   
+   Initialized_Array : constant Transistion_Array_T :=
+     (Start =>
+        (Letter_Lower | Letter_Upper => Saw_Alpha,
+         ' ' | HT | CR | LF          => Start,
+         others => Begin_Error),
+
+      End_Error => (others => Start)
+
+     );
+
+   type Recorder is record
+      Advance      : Boolean;
+      Return_Token : Token_T;
+   end record;
+   
+   for Recorder use 8;
+   
+   type Null_Record is null record;
+   
+   type Discriminated_Record (Size : Natural) is 
+      record
+         A : String (1 .. Size);
+      end record;
+   
+   pragma Unchecked_Union (Union);
+   pragma Convention (C, Union);
+   
+   type Person is tagged 
+      record
+         Name   : String (1 .. 10);
+         Gender : Gender_Type;
+      end record;
+   
+   type Programmer is new Person with
+      record
+         Skilled_In : Language_List;
+         Favorite_Langauge : Python_Type;
+      end record;
+   
+   type Programmer is new Person 
+     and Printable 
+     with 
+      record
+         Skilled_In : Language_List;
+         Blah : aliased Integer;
+      end record;
+   
+   ---------------------
+   -- Scan_Next_Token --
+   ---------------------
+   
+   task Cyclic_Buffer_Task_Type is
+      entry Insert (An_Item : in  Item);
+      entry Remove (An_Item : out Item);
+   end Cyclic_Buffer_Task_Type;
+   
+   task body Cyclic_Buffer_Task_Type is
+      Q_Size : constant := 100;
+      subtype Q_Range is Positive range 1 .. Q_Size;
+      Length : Natural range 0 .. Q_Size := 0;
+      Head, Tail : Q_Range := 1;
+      Data : array (Q_Range) of Item;
+   begin
+      loop
+         select
+            when Length < Q_Size =>
+               accept Insert (An_Item : in  Item) do
+                  Data(Tail) := An_Item;
+               end Insert;
+               Tail := Tail mod Q_Size + 1;
+               Length := Length + 1;
+         or
+            when Length > 0 =>
+               accept Remove (An_Item : out Item) do
+                  An_Item := Data(Head);
+               end Remove;
+               Head := Head mod Q_Size + 1;
+               Length := Length - 1;
+         end select;
+      end loop;
+   end Cyclic_Buffer_Task_Type;
+     
+     
+   
+   procedure Scan_Next_Token
+     (S           : in     String;
+      Start_Index :    out Positive;
+      End_Index   : in out Natural;     --  Tricky comment
+      Line_Number : in out Positive;
+      Token       :    out Token_T);
+   
+   procedure Scan_Next_Token
+     (S           : in     String;
+      Start_Index :    out Positive;
+      End_Index   : in out Natural;     --  Another comment
+      Line_Number : in out Positive;
+      Token       :    out Token_T)
+   is
+   begin
+      Scanner_Loop:
+      loop
+         if New_State = End_Error then
+            exit Scanner_Loop;
+         end if;
+
+         if State = Start and New_State /= Start then
+            Start_Index := Peek_Index;
+         end if;
+      end loop Scanner_Loop;
+   end Scan_Next_Token;
+   
+   procedure Advance is
+   begin
+      Peek_Index := Peek_Index + 1;
+   end Advance;
+      
+
+   -- Eliminate the leading space that Ada puts in front of positive
+   -- integer images.
+   function Image(N : in Integer) return String is
+      S : String := Integer'Image(N);
+   begin
+      if S(1) = ' ' then
+         return S(2 .. S'Last);
+      end if;
+      return S;
+   end Image;
+
+end Scanner;
diff --git a/tests/examplefiles/test.flx b/tests/examplefiles/test.flx
new file mode 100644 (file)
index 0000000..4c8a667
--- /dev/null
@@ -0,0 +1,57 @@
+type tiny = "%i8";
+type int = "%i32";
+typedef bool = 2;
+fun add : int*int -> int = "%add";
+fun sub : int*int -> int = "%sub";
+fun eq : int*int -> bool = "%eq";
+fun lnot : bool -> bool = "%lnot";
+proc exit : int = "exit";
+
+// comment 1
+/*
+  /*
+  foo bar
+  */
+asdas
+*/
+
+noinline fun foo (x:int) = {
+  val y = 6;
+  return x + y;
+}
+
+noinline proc fake_exit (x:int) {
+  exit x;
+  return;
+}
+
+noinline fun bar (x:int) = {
+  var y = 10;
+  noinline proc baz () {
+    y = 20;
+    return;
+  }
+  baz ();
+  return x + y;
+}
+
+noinline fun x (a:int, b:int, c:tiny) = {
+  val x1 = a;
+  val x2 = b;
+  val x3 = c;
+  noinline fun y (d:int, e:int, f:tiny) = {
+    val y1 = x1;
+    val y2 = x2;
+    val y3 = f;
+    noinline fun z (g:int, h:int, i:tiny) = {
+      val z1 = x1;
+      val z2 = x2;
+      val z3 = i;
+      return z1;
+    }
+    return z (y1,y2,y3);
+  }
+  return y (x1,x2,x3);
+}
+
+fake_exit $ (foo 2) + (bar 3) + (x (1,2,3t));
diff --git a/tests/examplefiles/test.mod b/tests/examplefiles/test.mod
new file mode 100644 (file)
index 0000000..ba972e3
--- /dev/null
@@ -0,0 +1,374 @@
+(* LIFO Storage Library
+ *
+ *  @file LIFO.mod
+ *  LIFO implementation
+ *
+ *  Universal Dynamic Stack
+ *
+ *  Author: Benjamin Kowarsch
+ *
+ *  Copyright (C) 2009 Benjamin Kowarsch. All rights reserved.
+ *
+ *  License:
+ *
+ *  Redistribution  and  use  in source  and  binary forms,  with  or  without
+ *  modification, are permitted provided that the following conditions are met
+ *
+ *  1) NO FEES may be charged for the provision of the software.  The software
+ *     may  NOT  be published  on websites  that contain  advertising,  unless
+ *     specific  prior  written  permission has been obtained.
+ *
+ *  2) Redistributions  of source code must retain the above copyright notice,
+ *     this list of conditions and the following disclaimer.
+ *
+ *  3) Redistributions  in binary form  must  reproduce  the  above  copyright
+ *     notice,  this list of conditions  and  the following disclaimer  in the
+ *     documentation and other materials provided with the distribution.
+ *
+ *  4) Neither the author's name nor the names of any contributors may be used
+ *     to endorse  or  promote  products  derived  from this software  without
+ *     specific prior written permission.
+ *
+ *  5) Where this list of conditions  or  the following disclaimer, in part or
+ *     as a whole is overruled  or  nullified by applicable law, no permission
+ *     is granted to use the software.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT NOT LIMITED TO,  THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY  AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE  FOR  ANY  DIRECT,  INDIRECT,  INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR
+ * CONSEQUENTIAL  DAMAGES  (INCLUDING,  BUT  NOT  LIMITED  TO,  PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE,  DATA,  OR PROFITS; OR BUSINESS
+ * INTERRUPTION)  HOWEVER  CAUSED  AND ON ANY THEORY OF LIABILITY,  WHETHER IN
+ * CONTRACT,  STRICT LIABILITY,  OR TORT  (INCLUDING NEGLIGENCE  OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,  EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *  
+ *)
+
+
+IMPLEMENTATION (* OF *) MODULE LIFO;
+
+FROM SYSTEM IMPORT ADDRESS, ADR, TSIZE;
+FROM Storage IMPORT ALLOCATE, DEALLOCATE;
+
+
+(* ---------------------------------------------------------------------------
+// Private type : ListEntry
+// ---------------------------------------------------------------------------
+*)
+TYPE ListPtr = POINTER TO ListEntry;
+
+TYPE ListEntry = RECORD
+    value : DataPtr;
+    next  : ListPtr
+END; (* ListEntry *)
+
+
+(* ---------------------------------------------------------------------------
+// Opaque type : LIFO.Stack
+// ---------------------------------------------------------------------------
+// CAUTION:  Modula-2 does not support the use of variable length array fields
+// in records.  VLAs can  only  be implemented  using pointer arithmetic which
+// means  there is  no type checking  and  no boundary checking  on the array.
+// It also means that  array notation cannot be used on the array  which makes
+// the code  difficult to read  and maintain.  As a result,  Modula-2  is less
+// safe and less readable than C when it comes to using VLAs.  Great care must
+// be taken to make sure that the code accessing VLA fields is safe.  Boundary
+// checks must be inserted manually.  Size checks must be inserted manually to
+// compensate for the absence of type checks. *)
+
+TYPE Stack = POINTER TO StackDescriptor;
+
+TYPE StackDescriptor = RECORD
+    overflow   : ListPtr;
+    entryCount : StackSize;
+    arraySize  : StackSize;
+    array      : ADDRESS (* ARRAY OF DataPtr *)
+END; (* StackDescriptor *)
+
+
+(* ---------------------------------------------------------------------------
+// function:  LIFO.new( initial_size, status )
+// ---------------------------------------------------------------------------
+//
+// Creates  and  returns  a new LIFO stack object  with an initial capacity of
+// <initialSize>.  If  zero  is passed in  for <initialSize>,  then  the stack
+// will be created  with an  initial capacity  of  LIFO.defaultStackSize.  The
+// function fails  if a value greater than   LIFO.maximumStackSize  is  passed
+// in  for <initialSize> or if memory could not be allocated.
+//
+// The initial capacity of a stack is the number of entries that can be stored
+// in the stack without enlargement.
+//
+// The status of the operation  is passed back in <status>. *)
+
+PROCEDURE new ( initialSize : StackSize; VAR status : Status ) : Stack;
+
+VAR
+    newStack : Stack;
+    
+BEGIN
+
+    (* zero size means default *)
+    IF initialSize = 0 THEN
+        initialSize := defaultStackSize;
+    END; (* IF *)
+    
+    (* bail out if initial size is too high *)
+    IF initialSize > maximumStackSize THEN
+        status := invalidSize;
+        RETURN NIL;
+    END; (* IF *)
+    
+    (* allocate new stack object *)
+    ALLOCATE(newStack, TSIZE(Stack) + TSIZE(DataPtr) * (initialSize - 1));
+    
+    (* bail out if allocation failed *)
+    IF newStack = NIL THEN
+        status := allocationFailed;
+        RETURN NIL;
+    END; (* IF *)
+        
+    (* initialise meta data *)
+    newStack^.arraySize := initialSize;
+    newStack^.entryCount := 0;
+    newStack^.overflow := NIL;
+    
+    (* pass status and new stack to caller *)
+    status := success;
+    RETURN newStack
+    
+END new;
+
+
+(* ---------------------------------------------------------------------------
+// function:  LIFO.push( stack, value, status )
+// ---------------------------------------------------------------------------
+//
+// Adds a  new entry <value>  to the top of stack <stack>.  The  new entry  is
+// added by reference,  no data is copied.  However,  no entry is added if the
+// the stack is full,  that is  when the number of entries stored in the stack
+// has reached LIFO.maximumStackSize.  The function fails  if NIL is passed in
+// for <stack> or <value>,  or if memory could not be allocated.
+//
+// New entries are allocated dynamically  if the number of entries exceeds the
+// initial capacity of the stack.
+//
+// The status of the operation is passed back in <status>. *)
+
+PROCEDURE push ( VAR stack : Stack; value : DataPtr; VAR status : Status );
+VAR
+    newEntry : ListPtr;
+    valuePtr : POINTER TO DataPtr;
+
+BEGIN
+
+    (* bail out if stack is NIL *)
+    IF stack = NIL THEN
+        status := invalidStack;
+        RETURN;
+    END; (* IF *)
+    
+    (* bail out if value is NIL *)
+    IF value = NIL THEN
+        status := invalidData;
+        RETURN;
+    END; (* IF *)
+
+    (* bail out if stack is full *)
+    IF stack^.entryCount >= maximumStackSize THEN
+        status := stackFull;
+        RETURN;
+    END; (* IF *)
+
+    (* check if index falls within array segment *)
+    IF stack^.entryCount < stack^.arraySize THEN
+    
+        (* store value in array segment *)
+        
+        (* stack^.array^[stack^.entryCount] := value; *)
+        valuePtr := ADR(stack^.array) + TSIZE(DataPtr) * stack^.entryCount;
+        valuePtr^ := value;
+        
+    ELSE (* index falls within overflow segment *)
+    
+        (* allocate new entry slot *)
+        NEW(newEntry);
+        
+        (* bail out if allocation failed *)
+        IF newEntry = NIL THEN
+            status := allocationFailed;
+            RETURN;
+        END; (* IF *)
+        
+        (* initialise new entry *)
+        newEntry^.value := value;
+        
+        (* link new entry into overflow list *)
+        newEntry^.next := stack^.overflow;
+        stack^.overflow := newEntry;
+    
+    END; (* IF *)
+    
+    (* update entry counter *)
+    INC(stack^.entryCount);
+    
+    (* pass status to caller *)
+    status := success;
+    RETURN
+
+END push;
+
+
+(* ---------------------------------------------------------------------------
+// function:  LIFO.pop( stack, status )
+// ---------------------------------------------------------------------------
+//
+// Removes the top most value from stack <stack> and returns it.  If the stack
+// is empty,  that  is  when the  number  of  entries  stored in the stack has
+// reached zero,  then NIL is returned.
+//
+// Entries which were allocated dynamically (above the initial capacity) are
+// deallocated when their values are popped.
+//
+// The status of the operation is passed back in <status>. *)
+
+PROCEDURE pop ( VAR stack : Stack; VAR status : Status ) : DataPtr;
+
+VAR
+    thisValue : DataPtr;
+    thisEntry : ListPtr;
+    valuePtr : POINTER TO DataPtr;
+
+BEGIN
+
+    (* bail out if stack is NIL *)
+    IF stack = NIL THEN
+        status := invalidStack;
+        RETURN NIL;
+    END; (* IF *)
+    
+    (* bail out if stack is empty *)
+    IF stack^.entryCount = 0 THEN
+        status := stackEmpty;
+        RETURN NIL;
+    END; (* IF *)
+
+    DEC(stack^.entryCount);
+    
+    (* check if index falls within array segment *)
+    IF stack^.entryCount < stack^.arraySize THEN
+        
+        (* obtain value at index entryCount in array segment *)
+        
+        (* thisValue := stack^.array^[stack^.entryCount]; *)
+        valuePtr := ADR(stack^.array) + TSIZE(DataPtr) * stack^.entryCount;
+        thisValue := valuePtr^;
+        
+    ELSE (* index falls within overflow segment *)
+        
+        (* obtain value of first entry in overflow list *)
+        thisValue := stack^.overflow^.value;
+        
+        (* isolate first entry in overflow list *)
+        thisEntry := stack^.overflow;
+        stack^.overflow := stack^.overflow^.next;
+        
+        (* remove the entry from overflow list *)
+        DISPOSE(thisEntry);
+                
+    END; (* IF *)
+
+    (* return value and status to caller *)
+    status := success;
+    RETURN thisValue
+
+END pop;
+
+
+(* ---------------------------------------------------------------------------
+// function:  LIFO.stackSize( stack )
+// ---------------------------------------------------------------------------
+//
+// Returns the current capacity of <stack>.  The current capacity is the total
+// number of allocated entries. Returns zero if NIL is passed in for <stack>.
+*)
+PROCEDURE stackSize( VAR stack : Stack ) : StackSize;
+
+BEGIN
+
+    (* bail out if stack is NIL *)
+    IF stack = NIL THEN
+        RETURN 0;
+    END; (* IF *)
+
+    IF stack^.entryCount < stack^.arraySize THEN
+        RETURN stack^.arraySize;
+    ELSE
+        RETURN stack^.entryCount;
+    END; (* IF *)
+    
+END stackSize;
+
+
+(* ---------------------------------------------------------------------------
+// function:  LIFO.stackEntries( stack )
+// ---------------------------------------------------------------------------
+//
+// Returns  the  number of entries  stored in stack <stack>,  returns  zero if
+// NIL is passed in for <stack>. *)
+
+PROCEDURE stackEntries( VAR stack : Stack ) : StackSize;
+
+BEGIN
+
+    (* bail out if stack is NIL *)
+    IF stack = NIL THEN
+        RETURN 0;
+    END; (* IF *)
+
+    RETURN stack^.entryCount
+    
+END stackEntries;
+
+
+(* ---------------------------------------------------------------------------
+// function:  LIFO.dispose( stack )
+// ---------------------------------------------------------------------------
+//
+// Disposes of LIFO stack object <stack>.  Returns NIL. *)
+
+PROCEDURE dispose ( VAR stack : Stack ) : Stack;
+
+VAR
+    thisEntry : ListPtr;
+
+BEGIN
+
+    (* bail out if stack is NIL *)
+    IF stack = NIL THEN
+        RETURN NIL;
+    END; (* IF *)
+    
+    (* deallocate any entries in stack's overflow list *)
+    WHILE stack^.overflow # NIL DO
+        
+        (* isolate first entry in overflow list *)
+        thisEntry := stack^.overflow;
+        stack^.overflow := stack^.overflow^.next;
+        
+        (* deallocate the entry *)
+        DISPOSE(thisEntry);
+        
+    END; (* WHILE *)
+    
+    (* deallocate stack object and pass NIL to caller *)
+    DEALLOCATE(stack, TSIZE(Stack) + TSIZE(DataPtr) * (stack^.arraySize - 1));
+    RETURN NIL
+
+END dispose;
+
+
+END LIFO.
index 90de747261d918ca541e25ee1a3b2b0d23bc629e..97e21f739514bbc015f3f2987f73659059828ebb 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+$test = function($a) { $lambda = 1; }
+
 /**
  *  Zip class file
  *
@@ -12,7 +15,11 @@ if(!defined('UNLOCK') || !UNLOCK)
   
 // Load the parent archive class
 require_once(ROOT_PATH.'/classes/archive.class.php');
-  
+
+class Zip\Zipp {
+
+}
+
 /**
  *  Zip class
  *
diff --git a/tests/examplefiles/underscore.coffee b/tests/examplefiles/underscore.coffee
new file mode 100644 (file)
index 0000000..a34a1ce
--- /dev/null
@@ -0,0 +1,603 @@
+
+  # Underscore.coffee
+  # (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
+  # Underscore is freely distributable under the terms of the MIT license.
+  # Portions of Underscore are inspired by or borrowed from Prototype.js,
+  # Oliver Steele's Functional, and John Resig's Micro-Templating.
+  # For all details and documentation:
+  # http://documentcloud.github.com/underscore/
+
+
+  # ------------------------- Baseline setup ---------------------------------
+
+  # Establish the root object, "window" in the browser, or "global" on the server.
+  root: this
+
+
+  # Save the previous value of the "_" variable.
+  previousUnderscore: root._
+
+
+  # If Underscore is called as a function, it returns a wrapped object that
+  # can be used OO-style. This wrapper holds altered versions of all the
+  # underscore functions. Wrapped objects may be chained.
+  wrapper: (obj) ->
+    this._wrapped: obj
+    this
+
+
+  # Establish the object that gets thrown to break out of a loop iteration.
+  breaker: if typeof(StopIteration) is 'undefined' then '__break__' else StopIteration
+
+
+  # Create a safe reference to the Underscore object forreference below.
+  _: root._: (obj) -> new wrapper(obj)
+
+
+  # Export the Underscore object for CommonJS.
+  if typeof(exports) != 'undefined' then exports._: _
+
+
+  # Create quick reference variables for speed access to core prototypes.
+  slice:                Array::slice
+  unshift:              Array::unshift
+  toString:             Object::toString
+  hasOwnProperty:       Object::hasOwnProperty
+  propertyIsEnumerable: Object::propertyIsEnumerable
+
+
+  # Current version.
+  _.VERSION: '0.5.7'
+
+
+  # ------------------------ Collection Functions: ---------------------------
+
+  # The cornerstone, an each implementation.
+  # Handles objects implementing forEach, arrays, and raw objects.
+  _.each: (obj, iterator, context) ->
+    index: 0
+    try
+      return obj.forEach(iterator, context) if obj.forEach
+      if _.isArray(obj) or _.isArguments(obj)
+        return iterator.call(context, obj[i], i, obj) for i in [0...obj.length]
+      iterator.call(context, val, key, obj) for key, val of obj
+    catch e
+      throw e if e isnt breaker
+    obj
+
+
+  # Return the results of applying the iterator to each element. Use JavaScript
+  # 1.6's version of map, if possible.
+  _.map: (obj, iterator, context) ->
+    return obj.map(iterator, context) if (obj and _.isFunction(obj.map))
+    results: []
+    _.each obj, (value, index, list) ->
+      results.push(iterator.call(context, value, index, list))
+    results
+
+
+  # Reduce builds up a single result from a list of values. Also known as
+  # inject, or foldl. Uses JavaScript 1.8's version of reduce, if possible.
+  _.reduce: (obj, memo, iterator, context) ->
+    return obj.reduce(_.bind(iterator, context), memo) if (obj and _.isFunction(obj.reduce))
+    _.each obj, (value, index, list) ->
+      memo: iterator.call(context, memo, value, index, list)
+    memo
+
+
+  # The right-associative version of reduce, also known as foldr. Uses
+  # JavaScript 1.8's version of reduceRight, if available.
+  _.reduceRight: (obj, memo, iterator, context) ->
+    return obj.reduceRight(_.bind(iterator, context), memo) if (obj and _.isFunction(obj.reduceRight))
+    _.each _.clone(_.toArray(obj)).reverse(), (value, index) ->
+      memo: iterator.call(context, memo, value, index, obj)
+    memo
+
+
+  # Return the first value which passes a truth test.
+  _.detect: (obj, iterator, context) ->
+    result: null
+    _.each obj, (value, index, list) ->
+      if iterator.call(context, value, index, list)
+        result: value
+        _.breakLoop()
+    result
+
+
+  # Return all the elements that pass a truth test. Use JavaScript 1.6's
+  # filter(), if it exists.
+  _.select: (obj, iterator, context) ->
+    if obj and _.isFunction(obj.filter) then return obj.filter(iterator, context)
+    results: []
+    _.each obj, (value, index, list) ->
+      results.push(value) if iterator.call(context, value, index, list)
+    results
+
+
+  # Return all the elements for which a truth test fails.
+  _.reject: (obj, iterator, context) ->
+    results: []
+    _.each obj, (value, index, list) ->
+      results.push(value) if not iterator.call(context, value, index, list)
+    results
+
+
+  # Determine whether all of the elements match a truth test. Delegate to
+  # JavaScript 1.6's every(), if it is present.
+  _.all: (obj, iterator, context) ->
+    iterator ||= _.identity
+    return obj.every(iterator, context) if obj and _.isFunction(obj.every)
+    result: true
+    _.each obj, (value, index, list) ->
+      _.breakLoop() unless (result: result and iterator.call(context, value, index, list))
+    result
+
+
+  # Determine if at least one element in the object matches a truth test. Use
+  # JavaScript 1.6's some(), if it exists.
+  _.any: (obj, iterator, context) ->
+    iterator ||= _.identity
+    return obj.some(iterator, context) if obj and _.isFunction(obj.some)
+    result: false
+    _.each obj, (value, index, list) ->
+      _.breakLoop() if (result: iterator.call(context, value, index, list))
+    result
+
+
+  # Determine if a given value is included in the array or object,
+  # based on '==='.
+  _.include: (obj, target) ->
+    return _.indexOf(obj, target) isnt -1 if _.isArray(obj)
+    for key, val of obj
+      return true if val is target
+    false
+
+
+  # Invoke a method with arguments on every item in a collection.
+  _.invoke: (obj, method) ->
+    args: _.rest(arguments, 2)
+    (if method then val[method] else val).apply(val, args) for val in obj
+
+
+  # Convenience version of a common use case of map: fetching a property.
+  _.pluck: (obj, key) ->
+    _.map(obj, ((val) -> val[key]))
+
+
+  # Return the maximum item or (item-based computation).
+  _.max: (obj, iterator, context) ->
+    return Math.max.apply(Math, obj) if not iterator and _.isArray(obj)
+    result: {computed: -Infinity}
+    _.each obj, (value, index, list) ->
+      computed: if iterator then iterator.call(context, value, index, list) else value
+      computed >= result.computed and (result: {value: value, computed: computed})
+    result.value
+
+
+  # Return the minimum element (or element-based computation).
+  _.min: (obj, iterator, context) ->
+    return Math.min.apply(Math, obj) if not iterator and _.isArray(obj)
+    result: {computed: Infinity}
+    _.each obj, (value, index, list) ->
+      computed: if iterator then iterator.call(context, value, index, list) else value
+      computed < result.computed and (result: {value: value, computed: computed})
+    result.value
+
+
+  # Sort the object's values by a criteria produced by an iterator.
+  _.sortBy: (obj, iterator, context) ->
+    _.pluck(((_.map obj, (value, index, list) ->
+      {value: value, criteria: iterator.call(context, value, index, list)}
+    ).sort((left, right) ->
+      a: left.criteria; b: right.criteria
+      if a < b then -1 else if a > b then 1 else 0
+    )), 'value')
+
+
+  # Use a comparator function to figure out at what index an object should
+  # be inserted so as to maintain order. Uses binary search.
+  _.sortedIndex: (array, obj, iterator) ->
+    iterator ||= _.identity
+    low: 0; high: array.length
+    while low < high
+      mid: (low + high) >> 1
+      if iterator(array[mid]) < iterator(obj) then low: mid + 1 else high: mid
+    low
+
+
+  # Convert anything iterable into a real, live array.
+  _.toArray: (iterable) ->
+    return []                   if (!iterable)
+    return iterable.toArray()   if (iterable.toArray)
+    return iterable             if (_.isArray(iterable))
+    return slice.call(iterable) if (_.isArguments(iterable))
+    _.values(iterable)
+
+
+  # Return the number of elements in an object.
+  _.size: (obj) -> _.toArray(obj).length
+
+
+  # -------------------------- Array Functions: ------------------------------
+
+  # Get the first element of an array. Passing "n" will return the first N
+  # values in the array. Aliased as "head". The "guard" check allows it to work
+  # with _.map.
+  _.first: (array, n, guard) ->
+    if n and not guard then slice.call(array, 0, n) else array[0]
+
+
+  # Returns everything but the first entry of the array. Aliased as "tail".
+  # Especially useful on the arguments object. Passing an "index" will return
+  # the rest of the values in the array from that index onward. The "guard"
+  # check allows it to work with _.map.
+  _.rest: (array, index, guard) ->
+    slice.call(array, if _.isUndefined(index) or guard then 1 else index)
+
+
+  # Get the last element of an array.
+  _.last: (array) -> array[array.length - 1]
+
+
+  # Trim out all falsy values from an array.
+  _.compact: (array) -> array[i] for i in [0...array.length] when array[i]
+
+
+  # Return a completely flattened version of an array.
+  _.flatten: (array) ->
+    _.reduce array, [], (memo, value) ->
+      return memo.concat(_.flatten(value)) if _.isArray(value)
+      memo.push(value)
+      memo
+
+
+  # Return a version of the array that does not contain the specified value(s).
+  _.without: (array) ->
+    values: _.rest(arguments)
+    val for val in _.toArray(array) when not _.include(values, val)
+
+
+  # Produce a duplicate-free version of the array. If the array has already
+  # been sorted, you have the option of using a faster algorithm.
+  _.uniq: (array, isSorted) ->
+    memo: []
+    for el, i in _.toArray(array)
+      memo.push(el) if i is 0 || (if isSorted is true then _.last(memo) isnt el else not _.include(memo, el))
+    memo
+
+
+  # Produce an array that contains every item shared between all the
+  # passed-in arrays.
+  _.intersect: (array) ->
+    rest: _.rest(arguments)
+    _.select _.uniq(array), (item) ->
+      _.all rest, (other) ->
+        _.indexOf(other, item) >= 0
+
+
+  # Zip together multiple lists into a single array -- elements that share
+  # an index go together.
+  _.zip: ->
+    length:     _.max(_.pluck(arguments, 'length'))
+    results:    new Array(length)
+    for i in [0...length]
+      results[i]: _.pluck(arguments, String(i))
+    results
+
+
+  # If the browser doesn't supply us with indexOf (I'm looking at you, MSIE),
+  # we need this function. Return the position of the first occurence of an
+  # item in an array, or -1 if the item is not included in the array.
+  _.indexOf: (array, item) ->
+    return array.indexOf(item) if array.indexOf
+    i: 0; l: array.length
+    while l - i
+      if array[i] is item then return i else i++
+    -1
+
+
+  # Provide JavaScript 1.6's lastIndexOf, delegating to the native function,
+  # if possible.
+  _.lastIndexOf: (array, item) ->
+    return array.lastIndexOf(item) if array.lastIndexOf
+    i: array.length
+    while i
+      if array[i] is item then return i else i--
+    -1
+
+
+  # Generate an integer Array containing an arithmetic progression. A port of
+  # the native Python range() function. See:
+  # http://docs.python.org/library/functions.html#range
+  _.range: (start, stop, step) ->
+    a:        arguments
+    solo:     a.length <= 1
+    i: start: if solo then 0 else a[0];
+    stop:     if solo then a[0] else a[1];
+    step:     a[2] or 1
+    len:      Math.ceil((stop - start) / step)
+    return [] if len <= 0
+    range:    new Array(len)
+    idx:      0
+    while true
+      return range if (if step > 0 then i - stop else stop - i) >= 0
+      range[idx]: i
+      idx++
+      i+= step
+
+
+  # ----------------------- Function Functions: -----------------------------
+
+  # Create a function bound to a given object (assigning 'this', and arguments,
+  # optionally). Binding with arguments is also known as 'curry'.
+  _.bind: (func, obj) ->
+    args: _.rest(arguments, 2)
+    -> func.apply(obj or root, args.concat(arguments))
+
+
+  # Bind all of an object's methods to that object. Useful for ensuring that
+  # all callbacks defined on an object belong to it.
+  _.bindAll: (obj) ->
+    funcs: if arguments.length > 1 then _.rest(arguments) else _.functions(obj)
+    _.each(funcs, (f) -> obj[f]: _.bind(obj[f], obj))
+    obj
+
+
+  # Delays a function for the given number of milliseconds, and then calls
+  # it with the arguments supplied.
+  _.delay: (func, wait) ->
+    args: _.rest(arguments, 2)
+    setTimeout((-> func.apply(func, args)), wait)
+
+
+  # Defers a function, scheduling it to run after the current call stack has
+  # cleared.
+  _.defer: (func) ->
+    _.delay.apply(_, [func, 1].concat(_.rest(arguments)))
+
+
+  # Returns the first function passed as an argument to the second,
+  # allowing you to adjust arguments, run code before and after, and
+  # conditionally execute the original function.
+  _.wrap: (func, wrapper) ->
+    -> wrapper.apply(wrapper, [func].concat(arguments))
+
+
+  # Returns a function that is the composition of a list of functions, each
+  # consuming the return value of the function that follows.
+  _.compose: ->
+    funcs: arguments
+    ->
+      args: arguments
+      for i in [(funcs.length - 1)..0]
+        args: [funcs[i].apply(this, args)]
+      args[0]
+
+
+  # ------------------------- Object Functions: ----------------------------
+
+  # Retrieve the names of an object's properties.
+  _.keys: (obj) ->
+    return _.range(0, obj.length) if _.isArray(obj)
+    key for key, val of obj
+
+
+  # Retrieve the values of an object's properties.
+  _.values: (obj) ->
+    _.map(obj, _.identity)
+
+
+  # Return a sorted list of the function names available in Underscore.
+  _.functions: (obj) ->
+    _.select(_.keys(obj), (key) -> _.isFunction(obj[key])).sort()
+
+
+  # Extend a given object with all of the properties in a source object.
+  _.extend: (destination, source) ->
+    for key, val of source
+      destination[key]: val
+    destination
+
+
+  # Create a (shallow-cloned) duplicate of an object.
+  _.clone: (obj) ->
+    return obj.slice(0) if _.isArray(obj)
+    _.extend({}, obj)
+
+
+  # Invokes interceptor with the obj, and then returns obj.
+  # The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
+  _.tap: (obj, interceptor) ->
+    interceptor(obj)
+    obj
+
+
+  # Perform a deep comparison to check if two objects are equal.
+  _.isEqual: (a, b) ->
+    # Check object identity.
+    return true if a is b
+    # Different types?
+    atype: typeof(a); btype: typeof(b)
+    return false if atype isnt btype
+    # Basic equality test (watch out for coercions).
+    return true if `a == b`
+    # One is falsy and the other truthy.
+    return false if (!a and b) or (a and !b)
+    # One of them implements an isEqual()?
+    return a.isEqual(b) if a.isEqual
+    # Check dates' integer values.
+    return a.getTime() is b.getTime() if _.isDate(a) and _.isDate(b)
+    # Both are NaN?
+    return true if _.isNaN(a) and _.isNaN(b)
+    # Compare regular expressions.
+    if _.isRegExp(a) and _.isRegExp(b)
+      return a.source     is b.source and
+             a.global     is b.global and
+             a.ignoreCase is b.ignoreCase and
+             a.multiline  is b.multiline
+    # If a is not an object by this point, we can't handle it.
+    return false if atype isnt 'object'
+    # Check for different array lengths before comparing contents.
+    return false if a.length and (a.length isnt b.length)
+    # Nothing else worked, deep compare the contents.
+    aKeys: _.keys(a); bKeys: _.keys(b)
+    # Different object sizes?
+    return false if aKeys.length isnt bKeys.length
+    # Recursive comparison of contents.
+    # for (var key in a) if (!_.isEqual(a[key], b[key])) return false;
+    return true
+
+
+  # Is a given array or object empty?
+  _.isEmpty:      (obj) -> _.keys(obj).length is 0
+
+
+  # Is a given value a DOM element?
+  _.isElement:    (obj) -> obj and obj.nodeType is 1
+
+
+  # Is a given value an array?
+  _.isArray:      (obj) -> !!(obj and obj.concat and obj.unshift)
+
+
+  # Is a given variable an arguments object?
+  _.isArguments:  (obj) -> obj and _.isNumber(obj.length) and not obj.concat and
+                           not obj.substr and not obj.apply and not propertyIsEnumerable.call(obj, 'length')
+
+
+  # Is the given value a function?
+  _.isFunction:   (obj) -> !!(obj and obj.constructor and obj.call and obj.apply)
+
+
+  # Is the given value a string?
+  _.isString:     (obj) -> !!(obj is '' or (obj and obj.charCodeAt and obj.substr))
+
+
+  # Is a given value a number?
+  _.isNumber:     (obj) -> (obj is +obj) or toString.call(obj) is '[object Number]'
+
+
+  # Is a given value a Date?
+  _.isDate:       (obj) -> !!(obj and obj.getTimezoneOffset and obj.setUTCFullYear)
+
+
+  # Is the given value a regular expression?
+  _.isRegExp:     (obj) -> !!(obj and obj.exec and (obj.ignoreCase or obj.ignoreCase is false))
+
+
+  # Is the given value NaN -- this one is interesting. NaN != NaN, and
+  # isNaN(undefined) == true, so we make sure it's a number first.
+  _.isNaN:        (obj) -> _.isNumber(obj) and window.isNaN(obj)
+
+
+  # Is a given value equal to null?
+  _.isNull:       (obj) -> obj is null
+
+
+  # Is a given variable undefined?
+  _.isUndefined:  (obj) -> typeof obj is 'undefined'
+
+
+  # -------------------------- Utility Functions: --------------------------
+
+  # Run Underscore.js in noConflict mode, returning the '_' variable to its
+  # previous owner. Returns a reference to the Underscore object.
+  _.noConflict: ->
+    root._: previousUnderscore
+    this
+
+
+  # Keep the identity function around for default iterators.
+  _.identity: (value) -> value
+
+
+  # Break out of the middle of an iteration.
+  _.breakLoop: -> throw breaker
+
+
+  # Generate a unique integer id (unique within the entire client session).
+  # Useful for temporary DOM ids.
+  idCounter: 0
+  _.uniqueId: (prefix) ->
+    (prefix or '') + idCounter++
+
+
+  # By default, Underscore uses ERB-style template delimiters, change the
+  # following template settings to use alternative delimiters.
+  _.templateSettings: {
+    start:        '<%'
+    end:          '%>'
+    interpolate:  /<%=(.+?)%>/g
+  }
+
+
+  # JavaScript templating a-la ERB, pilfered from John Resig's
+  # "Secrets of the JavaScript Ninja", page 83.
+  # Single-quotea fix from Rick Strahl's version.
+  _.template: (str, data) ->
+    c: _.templateSettings
+    fn: new Function 'obj',
+      'var p=[],print=function(){p.push.apply(p,arguments);};' +
+      'with(obj){p.push(\'' +
+      str.replace(/[\r\t\n]/g, " ")
+         .replace(new RegExp("'(?=[^"+c.end[0]+"]*"+c.end+")","g"),"\t")
+         .split("'").join("\\'")
+         .split("\t").join("'")
+         .replace(c.interpolate, "',$1,'")
+         .split(c.start).join("');")
+         .split(c.end).join("p.push('") +
+         "');}return p.join('');"
+    if data then fn(data) else fn
+
+
+  # ------------------------------- Aliases ----------------------------------
+
+  _.forEach: _.each
+  _.foldl:   _.inject:      _.reduce
+  _.foldr:   _.reduceRight
+  _.filter:  _.select
+  _.every:   _.all
+  _.some:    _.any
+  _.head:    _.first
+  _.tail:    _.rest
+  _.methods: _.functions
+
+
+  #   /*------------------------ Setup the OOP Wrapper: --------------------------*/
+
+  # Helper function to continue chaining intermediate results.
+  result: (obj, chain) ->
+    if chain then _(obj).chain() else obj
+
+
+  # Add all of the Underscore functions to the wrapper object.
+  _.each _.functions(_), (name) ->
+    method: _[name]
+    wrapper.prototype[name]: ->
+      unshift.call(arguments, this._wrapped)
+      result(method.apply(_, arguments), this._chain)
+
+
+  # Add all mutator Array functions to the wrapper.
+  _.each ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], (name) ->
+    method: Array.prototype[name]
+    wrapper.prototype[name]: ->
+      method.apply(this._wrapped, arguments)
+      result(this._wrapped, this._chain)
+
+
+  # Add all accessor Array functions to the wrapper.
+  _.each ['concat', 'join', 'slice'], (name) ->
+    method: Array.prototype[name]
+    wrapper.prototype[name]: ->
+      result(method.apply(this._wrapped, arguments), this._chain)
+
+
+  # Start chaining a wrapped Underscore object.
+  wrapper::chain: ->
+    this._chain: true
+    this
+
+
+  # Extracts the result from a wrapped and chained object.
+  wrapper::value: -> this._wrapped
diff --git a/tests/examplefiles/xml_example b/tests/examplefiles/xml_example
new file mode 100644 (file)
index 0000000..e657e56
--- /dev/null
@@ -0,0 +1,1897 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="Ada" version="1.04" kateversion="2.1" section="Sources" extensions="*.adb;*.ads;*.ada;*.a" mimetype="text/x-adasrc">\r
+        <highlighting>\r
+                <list name="keywords">\r
+                        <item> abort </item>\r
+                        <item> abs </item>\r
+                        <item> abstract </item>\r
+                        <item> accept </item>\r
+                        <item> access </item>\r
+                        <item> aliased </item>\r
+                        <item> all </item>\r
+                        <item> and </item>\r
+                        <item> array </item>\r
+                        <item> at </item>\r
+                        <item> begin </item>\r
+                        <item> body </item>\r
+                        <item> constant </item>\r
+                        <item> declare </item>\r
+                        <item> delay </item>\r
+                        <item> delta </item>\r
+                        <item> digits </item>\r
+                        <item> do </item>\r
+                        <item> else </item>\r
+                        <item> elsif </item>\r
+                        <item> end </item>\r
+                        <item> entry </item>\r
+                        <item> exception </item>\r
+                        <item> exit </item>\r
+                        <item> for </item>\r
+                        <item> function </item>\r
+                        <item> generic </item>\r
+                        <item> goto </item>\r
+                        <item> in </item>\r
+                        <item> is </item>\r
+                        <item> limited </item>\r
+                        <item> mod </item>\r
+                        <item> new </item>\r
+                        <item> not </item>\r
+                        <item> null </item>\r
+                        <item> of </item>\r
+                        <item> or </item>\r
+                        <item> others </item>\r
+                        <item> out </item>\r
+                        <item> package </item>\r
+                        <item> pragma </item>\r
+                        <item> private </item>\r
+                        <item> procedure </item>\r
+                        <item> protected </item>\r
+                        <item> raise </item>\r
+                        <item> range </item>\r
+                        <item> rem </item>\r
+                        <item> record </item>\r
+                        <item> renames </item>\r
+                        <item> requeue </item>\r
+                        <item> return </item>\r
+                        <item> reverse </item>\r
+                        <item> separate </item>\r
+                        <item> subtype </item>\r
+                        <item> tagged </item>\r
+                        <item> task </item>\r
+                        <item> terminate </item>\r
+                        <item> then </item>\r
+                        <item> type </item>\r
+                        <item> until </item>\r
+                        <item> use </item>\r
+                        <item> when </item>\r
+                        <item> while </item>\r
+                        <item> with </item>\r
+                        <item> xor </item>\r
+                </list>\r
+                <contexts>\r
+                        <context attribute="Normal Text" lineEndContext="#stay" name="Default">\r
+                                <RegExpr attribute="Keyword" context="#stay" String="^\s*if " insensitive="TRUE" beginRegion="Region1"/>\r
+                                <StringDetect attribute="Keyword" context="#stay" String="end if" insensitive="TRUE" endRegion="Region1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="^\s*case " insensitive="TRUE" beginRegion="Region2"/>\r
+                                <StringDetect attribute="Keyword" context="#stay" String="end case" insensitive="TRUE" endRegion="Region2"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\sloop\s+" insensitive="TRUE" beginRegion="Region3"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\sloop$" insensitive="TRUE" beginRegion="Region3"/>\r
+                                <StringDetect attribute="Keyword" context="#stay" String="end loop;" insensitive="TRUE" endRegion="Region3"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\sselect\s+" insensitive="TRUE" beginRegion="Region4"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\sselect$" insensitive="TRUE" beginRegion="Region4"/>\r
+                                <StringDetect attribute="Keyword" context="#stay" String="end select;" insensitive="TRUE" endRegion="Region4"/>\r
+                                <keyword attribute="Keyword" context="#stay" String="keywords"/>\r
+                                <Float attribute="Float" context="#stay"/>\r
+                                <Int attribute="Decimal" context="#stay"/>\r
+                                <RegExpr attribute="Char" context="#stay" String="'.'"/>\r
+                                <DetectChar attribute="String" context="String" char="&quot;"/>\r
+                                <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>\r
+                        </context>\r
+                        <context attribute="String" lineEndContext="#pop" name="String">\r
+                                <DetectChar attribute="String" context="#pop" char="&quot;"/>\r
+                        </context>\r
+                        <context attribute="Comment" lineEndContext="#pop" name="Comment"/>\r
+                </contexts>\r
+                <itemDatas>\r
+                        <itemData name="Normal Text" defStyleNum="dsNormal" />\r
+                        <itemData name="Keyword"     defStyleNum="dsKeyword" />\r
+                        <itemData name="Decimal"     defStyleNum="dsDecVal" />\r
+                        <itemData name="Base-N"      defStyleNum="dsBaseN" />\r
+                        <itemData name="Float"       defStyleNum="dsFloat" />\r
+                        <itemData name="Char"        defStyleNum="dsChar" />\r
+                        <itemData name="String"      defStyleNum="dsString" />\r
+                        <itemData name="Comment"     defStyleNum="dsComment" />\r
+                </itemDatas>\r
+  </highlighting>\r
+  <general>\r
+    <comments>\r
+      <comment name="singleLine" start="--" />\r
+    </comments>\r
+    <keywords casesensitive="0" />\r
+  </general>\r
+</language>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="Asm6502" version="1.03" kateversion="2.1" section="Sources" extensions="*.asm" mimetype="text/x-asm6502">\r
+        <highlighting>\r
+                <list name = "opcodes6502">\r
+\r
+\r
+                </list>\r
+\r
+\r
+\r
+\r
+\r
+                <contexts>\r
+                        <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">\r
+\r
+\r
+                               <RegExpr String= "#define.*$" attribute = "Preprocessor" context="#stay"/>\r
+                               <RegExpr String= "#include .*$" attribute = "Preprocessor" context="#stay"/>\r
+                               <RegExpr String= ";.*$" attribute = "Comment" context="#stay"/>\r
+                               <RegExpr String= "\.byte" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.byt" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.word" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.asc" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.dsb" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.fopt" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.text" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.data" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.bss" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.zero" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\.align" attribute = "Data Type" context="#stay"/>\r
+                               <RegExpr String= "\$[A-Za-z0-9]*" attribute = "Hex" context="#stay"/>\r
+                               <RegExpr String= ",x$" attribute = "Keyword" context="#stay"  insensitive="TRUE"/>\r
+                               <RegExpr String= ",y$" attribute = "Keyword" context="#stay"  insensitive="TRUE"/>\r
+                               <RegExpr String= "#" attribute = "Keyword" context="#stay"  insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="TAX" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="ADC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="AND" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="ASL" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BCC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BCS" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BEQ" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BIT" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BMI" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BNE" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BPL" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BRK" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BVC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="BVS" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="CLC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="CLD" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="CLI" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="CLV" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="CMP" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="CPX" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="CPY" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="DEC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="DEX" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="DEY" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="EOR" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="INC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="INX" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="INY" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="JMP" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="JSR" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="LDA" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="LDX" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="LDY" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="LSR" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="NOP" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="ORA" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="PHA" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="PHP" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="PLA" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="PLP" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="ROL" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="ROR" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="RTI" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="RTS" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="SBC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="SEC" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="SED" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="SEI" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="STA" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="STX" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="STY" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="TAY" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="TSX" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="TXA" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="TXS" insensitive="TRUE"/>\r
+                               <StringDetect attribute="Keyword" context="#stay" String="TYA" insensitive="TRUE"/>\r
+\r
+                               <keyword String = "opcodes6502" attribute = "Keyword" context = "#stay" />\r
+                               <RegExpr String= "\*=" attribute = "Decimal" context="#stay"/>\r
+                               <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>\r
+                               <AnyChar String = "-+&lt;&gt;=;" attribute = "Operator" context = "#stay"/>\r
+                               <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>\r
+\r
+\r
+                       </context>\r
+                       <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">\r
+                               <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>\r
+                       </context>\r
+                </contexts>\r
+\r
+               <itemDatas>\r
+                        <itemData name = "Normal Text" defStyleNum = "dsNormal"/>\r
+                        <itemData name = "Keyword" defStyleNum = "dsKeyword"/>\r
+                       <itemData name="Decimal" defStyleNum="dsDecVal"/>\r
+                       <itemData name="Data Type"  defStyleNum="dsDataType"/>\r
+                       <itemData name="Hex"  defStyleNum="dsBaseN"/>\r
+                        <itemData name = "String" defStyleNum = "dsString"/>\r
+                        <itemData name = "Comment" defStyleNum = "dsComment"/>\r
+                        <itemData name = "Substitution" defStyleNum = "dsOthers"/>\r
+                       <itemData name="Preprocessor"  defStyleNum="dsOthers"/>\r
+                       <itemData name = "Parameter" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Operator" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Command" defStyleNum = "dsNormal"/>\r
+                </itemDatas>\r
+        </highlighting>\r
+        <general>\r
+                <comments>\r
+                        <comment name="singleLine" start=";"/>\r
+                       <comment name="multiLine" start="/*" end="*/"/>\r
+               </comments>\r
+                <keywords casesensitive="1"/>\r
+        </general>\r
+</language>\r
+\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="AWK" version="0.1" kateversion="2.1" section="Scripts" extensions="*.awk" mimetype="text/x-awk">\r
+  <highlighting>\r
+    <list name="keywords">\r
+      <item>BEGIN</item>\r
+      <item>END</item>\r
+      <item>if</item>\r
+      <item>else</item>\r
+      <item>while</item>\r
+      <item>do</item>\r
+      <item>for</item>\r
+      <item>in</item>\r
+      <item>continue</item>\r
+      <item>break</item>\r
+      <item>print</item>\r
+      <item>printf</item>\r
+      <item>getline</item>\r
+      <item>function</item>\r
+      <item>return</item>\r
+      <item>next</item>\r
+      <item>exit</item>\r
+    </list>\r
+    <list name="builtins">\r
+      <item>ARGC</item>\r
+      <item>ARGV</item>\r
+      <item>CONVFMT</item>\r
+      <item>ENVIRON</item>\r
+      <item>FILENAME</item>\r
+      <item>FNR</item>\r
+      <item>FS</item>\r
+      <item>NF</item>\r
+      <item>NR</item>\r
+      <item>OFMT</item>\r
+      <item>OFS</item>\r
+      <item>ORS</item>\r
+      <item>RS</item>\r
+      <item>RSTART</item>\r
+      <item>RLENGTH</item>\r
+      <item>SUBSEP</item>\r
+    </list>\r
+    <list name="functions">\r
+      <item>gsub</item>\r
+      <item>index</item>\r
+      <item>length</item>\r
+      <item>match</item>\r
+      <item>split</item>\r
+      <item>sprintf</item>\r
+      <item>sub</item>\r
+      <item>substr</item>\r
+      <item>tolower</item>\r
+      <item>toupper</item>\r
+      <item>atan2</item>\r
+      <item>cos</item>\r
+      <item>exp</item>\r
+      <item>int</item>\r
+      <item>log</item>\r
+      <item>rand</item>\r
+      <item>sin</item>\r
+      <item>sqrt</item>\r
+      <item>srand</item>\r
+      <item>close</item>\r
+      <item>fflush</item>\r
+      <item>system</item>\r
+    </list>\r
+    <contexts>\r
+      <context name="Base" attribute="Normal" lineEndContext="#stay">\r
+        <keyword String="keywords" attribute="Keyword" context="#stay"/>\r
+        <keyword String="builtins" attribute="Builtin" context="#stay"/>\r
+        <keyword String="functions" attribute="Function" context="#stay"/>\r
+        <Int   attribute="Decimal" context="#stay"/>\r
+        <Float attribute="Float"   context="#stay"/>\r
+        <RegExpr String="\$[A-Za-z0-9_]+" attribute="Field" context="#stay"/>\r
+        <DetectChar char="&quot;" attribute="String"  context="String"/>\r
+        <DetectChar char="/"      attribute="Pattern" context="Pattern"/>\r
+        <RegExpr String="#.*$" attribute="Comment" context="#stay"/>\r
+      </context>\r
+      <context name="String" attribute="String" lineEndContext="#stay">\r
+        <DetectChar char="&quot;" attribute="String" context="#pop"/>\r
+        <HlCStringChar attribute="String" context="#stay"/>\r
+      </context>\r
+      <context name="Pattern" attribute="Pattern" lineEndContext="#stay">\r
+        <DetectChar char="/" attribute="Pattern" context="#pop"/>\r
+        <RegExpr String="\\." attribute="Pattern" context="#stay"/>\r
+      </context>\r
+      <context name="Field" attribute="Field" lineEndContext="#stay">\r
+        <RegExpr String="\$[A-Za-z0-9_]+" attribute="Field" context="#pop"/>\r
+      </context>\r
+    </contexts>\r
+    <itemDatas>\r
+      <itemData name="Normal"   defStyleNum="dsNormal"/>\r
+      <itemData name="Keyword"  defStyleNum="dsKeyword"/>\r
+      <itemData name="Builtin"  defStyleNum="dsDataType"/>\r
+      <itemData name="Function" defStyleNum="dsKeyword"/>\r
+      <itemData name="Decimal"  defStyleNum="dsDecVal"/>\r
+      <itemData name="Float"    defStyleNum="dsFloat"/>\r
+      <itemData name="String"   defStyleNum="dsString"/>\r
+      <itemData name="Comment"  defStyleNum="dsComment"/>\r
+      <itemData name="Pattern"  defStyleNum="dsString"/>\r
+      <itemData name="Field"    defStyleNum="dsOthers"/>\r
+    </itemDatas>\r
+  </highlighting>\r
+  <general>\r
+    <comments>\r
+      <comment name="singleLine" start="#"/>\r
+    </comments>\r
+    <keywords casesensitive="1" />\r
+  </general>\r
+</language>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="Bash" version="1.08" kateversion="2.2" section="Scripts" extensions="*.sh" mimetype="application/x-shellscript">\r
+        <highlighting>\r
+                <list name = "keywords">\r
+                        <item> break </item>\r
+                        <item> case </item>\r
+                        <item> else </item>\r
+                        <item> esac </item>\r
+                        <item> exit </item>\r
+                        <item> export </item>\r
+                        <item> for </item>\r
+                        <item> function </item>\r
+                        <item> in </item>\r
+                        <item> return </item>\r
+                        <item> select </item>\r
+                        <item> then </item>\r
+                        <item> until </item>\r
+                        <item> while </item>\r
+                        <item> . </item>\r
+                        <item> done </item>\r
+                        <item> do </item>\r
+                        <item> elif </item>\r
+                        <item> fi </item>\r
+                        <item> if </item>\r
+\r
+                </list>\r
+                <list name = "commands">\r
+                        <item> cp </item>\r
+                        <item> date </item>\r
+                        <item> echo </item>\r
+                        <item> eval </item>\r
+                       <item> dcop </item>\r
+                       <item> dcopstart </item>\r
+                       <item> dcopfind </item>\r
+                </list>\r
+                <contexts>\r
+                        <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bdone\b" insensitive="TRUE" endRegion="dodone1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="dodone1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\belif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bfi\b" insensitive="TRUE" endRegion="iffi1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="TRUE" beginRegion="case1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\besac\b" insensitive="TRUE" endRegion="case1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="^[^()]+\)" insensitive="TRUE" beginRegion="subcase1"/>\r
+                                <StringDetect attribute="Keyword" context="#stay" String=";;" insensitive="TRUE" endRegion="subcase1"/>\r
+                                <DetectChar attribute="Keyword" context="#stay" char="{" beginRegion="func1"/>\r
+                                <DetectChar attribute="Keyword" context="#stay" char="}" endRegion="func1"/>\r
+\r
+                                <keyword String = "keywords" attribute = "Keyword" context = "#stay"/>\r
+                                <keyword String = "commands" attribute = "Command" context = "#stay"/>\r
+                                <Int attribute = "Decimal" context = "#stay"/>\r
+                                <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>\r
+                                <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>\r
+                                <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>\r
+                                <DetectChar char="'" attribute = "String" context = "Single Quote"/>\r
+                                <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>\r
+                                <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>\r
+                                <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>\r
+\r
+                        </context>\r
+                        <context name = "String" attribute = "String" lineEndContext="#stay">\r
+                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
+                               <StringDetect String = "\&quot;" attribute = "String" context = "#stay"/>\r
+                                <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>\r
+                        </context>\r
+                       <context name = "Single Quote" attribute = "String" lineEndContext="#stay">\r
+                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
+                               <StringDetect String = "\'" attribute = "String" context = "#stay"/>\r
+                               <DetectChar char = "'" attribute = "String" context = "#pop"/>\r
+                        </context>\r
+                        <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">\r
+                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
+                               <StringDetect String = "\`" attribute = "String" context = "#stay"/>\r
+                                <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>\r
+                        </context>\r
+                        <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">\r
+                                <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>\r
+                        </context>\r
+                </contexts>\r
+                <itemDatas>\r
+                        <itemData name = "Normal Text" defStyleNum = "dsNormal"/>\r
+                        <itemData name = "Keyword" defStyleNum = "dsKeyword"/>\r
+                        <itemData name = "Decimal" defStyleNum = "dsDecVal"/>\r
+                        <itemData name = "Float" defStyleNum = "dsFloat"/>\r
+                        <itemData name = "Char" defStyleNum = "dsChar"/>\r
+                        <itemData name = "String" defStyleNum = "dsString"/>\r
+                        <itemData name = "Comment" defStyleNum = "dsComment"/>\r
+                        <itemData name = "Substitution" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Parameter" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Operator" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Command" defStyleNum = "dsNormal"/>\r
+                </itemDatas>\r
+        </highlighting>\r
+        <general>\r
+                <comments>\r
+                        <comment name="singleLine" start="#"/>\r
+                </comments>\r
+                <keywords casesensitive="1"/>\r
+        </general>\r
+</language>\r
+\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language>\r
+<language name="BibTeX" version="0.1" extensions="*.bib" section="Markup" mimetype="text/x-bib" casesensitive="1">\r
+       <highlighting>\r
+               <contexts>\r
+                       <context name="Normal" attribute="Normal Text" lineEndContext="#stay">\r
+                               <DetectChar char="@" attribute="Bib Item" context="Bib Item" />\r
+                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
+                       </context>\r
+\r
+                       <context name="Bib Item" attribute="Bib Item" lineEndContext="#stay">\r
+                               <DetectChar char="{" attribute="Normal Text" context="Ref Key" />\r
+                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
+                       </context>\r
+\r
+                       <context name="Ref Key" attribute="Ref Key" lineEndContext="#stay">\r
+                               <DetectChar char="," attribute="Normal Text" context="Keyword" />\r
+                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
+                       </context>\r
+\r
+                       <context name="Keyword" attribute="Keyword" lineEndContext="#stay">\r
+                               <RegExpr String="\\." attribute="Keyword" context="#stay"/>\r
+                               <DetectChar char="@" attribute="Bib Item" context="Bib Item"/>\r
+                               <DetectChar char="=" attribute="Normal Text" context="#stay"/>\r
+                               <DetectChar char="," attribute="Normal Text" context="#stay"/>\r
+                               <DetectChar char='"' attribute="Value" context="Value"/>\r
+                               <DetectChar char="%" attribute="Comment" context="Comment"/>\r
+                       </context>\r
+\r
+                       <context name="Value" attribute="Value" lineEndContext="#stay">\r
+                               <Detect2Chars char="\" char1='"' attribute="Value" context="#stay"/>\r
+                               <DetectChar char='"' attribute="Value" context="Keyword"/>\r
+                       </context>\r
+                       \r
+                       <context name="Comment" attribute="5" lineEndContext="#pop">\r
+                       </context>\r
+               </contexts>\r
+               <itemDatas>\r
+                       <itemData name="Normal Text" defStyleNum="dsNormal"/>\r
+                       <itemData name="Bib Item" defStyleNum="dsNormal" color="#0000ff" selColor="#ffff00" bold="1" italic="0"/>\r
+                       <itemData name="Keyword" defStyleNum="dsNormal" color="#000000" selColor="#dddddd" bold="0" italic="0"/>\r
+                       <itemData name="Value" defStyleNum="dsNormal" color="#aa5500" selColor="#22aaff" bold="0" italic="0"/>\r
+                       <itemData name="Ref Key" defStyleNum="dsNormal" color="#007700" selColor="#00aa00" bold="1" italic="0"/>\r
+                       <itemData name="Comment" defStyleNum="dsNormal" color="#aaaaaa" selColor="#222222" bold="0" italic="0"/>\r
+               </itemDatas>\r
+       </highlighting><general>\r
+       <comments>\r
+               <comment name="singleLine" start="%" />\r
+               </comments>\r
+       </general>\r
+</language>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="C" version="1.09" kateversion="2.1" section="Sources" extensions="*.c;*.C;*.h" mimetype="text/x-csrc;text/x-c++src;text/x-chdr" priority="5">\r
+  <highlighting>\r
+    <list name="keywords">\r
+      <item> break </item>\r
+      <item> case </item>\r
+      <item> continue </item>\r
+      <item> default </item>\r
+      <item> do </item>\r
+      <item> else </item>\r
+      <item> enum </item>\r
+      <item> extern </item>\r
+      <item> for </item>\r
+      <item> goto </item>\r
+      <item> if </item>\r
+      <item> inline </item>\r
+      <item> return </item>\r
+      <item> sizeof </item>\r
+      <item> struct </item>\r
+      <item> switch </item>\r
+      <item> typedef </item>\r
+      <item> union </item>\r
+      <item> while </item>\r
+    </list>\r
+    <list name="types">\r
+      <item> auto </item>\r
+      <item> char </item>\r
+      <item> const </item>\r
+      <item> double </item>\r
+      <item> float </item>\r
+      <item> int </item>\r
+      <item> long </item>\r
+      <item> register </item>\r
+      <item> restrict </item>\r
+      <item> short </item>\r
+      <item> signed </item>\r
+      <item> static </item>\r
+      <item> unsigned </item>\r
+      <item> void </item>\r
+      <item> volatile </item>\r
+      <item> _Imaginary </item>\r
+      <item> _Complex </item>\r
+      <item> _Bool </item>\r
+    </list>\r
+    <list name="attention">\r
+      <item> FIXME </item>\r
+      <item> TODO </item>\r
+      <item> ### </item>\r
+    </list>\r
+    <contexts>\r
+      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">\r
+        <keyword attribute="Keyword" context="#stay" String="keywords"/>\r
+        <keyword attribute="Data Type" context="#stay" String="types"/>\r
+        <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />\r
+        <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />\r
+        <Float attribute="Float" context="#stay">\r
+          <AnyChar String="fF" attribute="Float" context="#stay"/>\r
+        </Float>\r
+        <HlCOct attribute="Octal" context="#stay"/>\r
+        <HlCHex attribute="Hex" context="#stay"/>\r
+        <Int attribute="Decimal" context="#stay" >\r
+          <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>\r
+          <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>\r
+          <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>\r
+          <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>\r
+          <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>\r
+          <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>\r
+          <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>\r
+          <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>\r
+        </Int>\r
+        <HlCChar attribute="Char" context="#stay"/>\r
+        <DetectChar attribute="String" context="String" char="&quot;"/>\r
+        <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>\r
+        <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>\r
+        <StringDetect attribute="Preprocessor" context="Outscoped" String="#if 0" insensitive="FALSE"/>\r
+        <DetectChar attribute="Preprocessor" context="Preprocessor" char="#"/>\r
+        <RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*[(])" />\r
+        <RegExpr attribute="Symbol" context="Member" String="[.]{1,1}" />\r
+        <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/.*&lt;=&gt;?[]|~^&#59;"/>\r
+      </context>\r
+      <context attribute="String" lineEndContext="#pop" name="String">\r
+        <LineContinue attribute="String" context="#stay"/>\r
+        <HlCStringChar attribute="String Char" context="#stay"/>\r
+        <DetectChar attribute="String" context="#pop" char="&quot;"/>\r
+      </context>\r
+      <context attribute="Normal Text" lineEndContext="#pop" name="Member">\r
+        <RegExpr attribute="Function" context="#pop" String="\b[_\w][_\w\d]*(?=[\s]*)" />\r
+      </context>\r
+      <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">\r
+        <keyword attribute="Decimal" context="#stay" String="attention" />\r
+      </context>\r
+      <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">\r
+        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>\r
+        <keyword attribute="Decimal" context="#stay" String="attention" />\r
+      </context>\r
+      <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">\r
+        <LineContinue attribute="Preprocessor" context="#stay"/>\r
+        <RegExpr attribute="Preprocessor" context="Define" String="define.*((?=\\))"/>\r
+        <RegExpr attribute="Preprocessor" context="#stay" String="define.*"/>\r
+        <RangeDetect attribute="Prep. Lib" context="#stay" char="&quot;" char1="&quot;"/>\r
+        <RangeDetect attribute="Prep. Lib" context="#stay" char="&lt;" char1="&gt;"/>\r
+        <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2"/>\r
+      </context>\r
+      <context attribute="Preprocessor" lineEndContext="#pop" name="Define">\r
+        <LineContinue attribute="Preprocessor" context="#stay"/>\r
+      </context>\r
+      <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">\r
+        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />\r
+      </context>\r
+      <context attribute="Normal Text" lineEndContext="#pop" name="Some Context"/>\r
+      <context attribute="Normal Text" lineEndContext="#pop" name="Some Context2"/>\r
+      <context attribute="Comment" lineEndContext="#stay" name="Outscoped" >\r
+        <keyword attribute="Decimal" context="#stay" String="attention" />\r
+        <RegExpr attribute="Comment" context="Outscoped intern" String="^#if" />\r
+        <RegExpr attribute="Preprocessor" context="#pop" String="#endif" />\r
+        <RegExpr attribute="Preprocessor" context="#pop" String="#else" />\r
+      </context>\r
+      <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">\r
+        <RegExpr attribute="Comment" context="Outscoped intern" String="#if" />\r
+        <RegExpr attribute="Comment" context="#pop" String="#endif" />\r
+      </context>\r
+    </contexts>\r
+    <itemDatas>\r
+      <itemData name="Normal Text"  defStyleNum="dsNormal"/>\r
+      <itemData name="Keyword"      defStyleNum="dsKeyword"/>\r
+      <itemData name="Function"     defStyleNum="dsKeyword" color="#000080" selColor="#ffffff" bold="0" italic="0"/>\r
+      <itemData name="Data Type"    defStyleNum="dsDataType"/>\r
+      <itemData name="Decimal"      defStyleNum="dsDecVal"/>\r
+      <itemData name="Octal"        defStyleNum="dsBaseN"/>\r
+      <itemData name="Hex"          defStyleNum="dsBaseN"/>\r
+      <itemData name="Float"        defStyleNum="dsFloat"/>\r
+      <itemData name="Char"         defStyleNum="dsChar"/>\r
+      <itemData name="String"       defStyleNum="dsString"/>\r
+      <itemData name="String Char"  defStyleNum="dsChar"/>\r
+      <itemData name="Comment"      defStyleNum="dsComment"/>\r
+      <itemData name="Symbol"       defStyleNum="dsNormal"/>\r
+      <itemData name="Preprocessor" defStyleNum="dsOthers"/>\r
+      <itemData name="Prep. Lib"    defStyleNum="dsOthers"/> <!--,Qt::darkYellow,Qt::yellow,false,false)); -->\r
+    </itemDatas>\r
+  </highlighting>\r
+  <general>\r
+    <comments>\r
+      <comment name="singleLine" start="//" />\r
+      <comment name="multiLine" start="/*" end="*/" />\r
+    </comments>\r
+    <keywords casesensitive="1" />\r
+  </general>\r
+</language>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="ChangeLog" version="1.01" kateversion="2.1" section="Other" extensions="ChangeLog" mimetype="">\r
+        <highlighting>\r
+          <contexts>\r
+                <context attribute="Normal Text" lineEndContext="#stay" name="Normal">\r
+                <RegExpr attribute="Keyword" context="#stay" String="^\d\d\d\d\s*-\s*\d\d\s*-\s*\d\d.*$"/>\r
+                </context>\r
+          </contexts>\r
+          <itemDatas>\r
+                <itemData name="Normal Text" defStyleNum="dsNormal"/>\r
+                <itemData name="Keyword" defStyleNum="dsKeyword"/>\r
+                <itemData name="Identifier" defStyleNum="dsOthers"/>\r
+                <itemData name="Types" defStyleNum="dsDataType"/>\r
+                <itemData name="String" defStyleNum="dsString"/>\r
+                <itemData name="Comment" defStyleNum="dsComment"/>\r
+          </itemDatas>\r
+        </highlighting>\r
+  <general>\r
+    <keywords casesensitive="1" />\r
+  </general>\r
+</language>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="Cisco" version="1.09" kateversion="2.2" section="Scripts"\r
+          extensions="*.cis" mimetype="text/cisco"\r
+          author="Raphaël GRAPINET" license="LGPL">\r
+       <highlighting>\r
+               <list name = "commands">\r
+                       <item> aaa </item>\r
+                       <item> access-list </item>\r
+                       <item> address </item>\r
+                       <item> alias </item>\r
+                       <item> arp </item>\r
+                       <item> async-bootp </item>\r
+                       <item> banner </item>\r
+                       <item> boot </item>\r
+                       <item> bridge </item>\r
+                       <item> buffers </item>\r
+                       <item> busy-message </item>\r
+                       <item> call-history-mib </item>\r
+                       <item> cdp </item>\r
+                       <item> chat-script </item>\r
+                       <item> class-map </item>\r
+                       <item> clock </item>\r
+                       <item> cns </item>\r
+                       <item> config-register </item>\r
+                       <item> controller </item>\r
+                       <item> crypto </item>\r
+                       <item> default </item>\r
+                       <item> default-value </item>\r
+                       <item> dialer </item>\r
+                       <item> dialer-list </item>\r
+                       <item> dnsix-dmdp </item>\r
+                       <item> dnsix-nat </item>\r
+                       <item> downward-compatible-config </item>\r
+                       <item> enable </item>\r
+                       <item> end </item>\r
+                       <item> exception </item>\r
+                       <item> exit </item>\r
+                       <item> file </item>\r
+                       <item> frame-relay </item>\r
+                       <item> help </item>\r
+                       <item> hostname </item>\r
+                       <item> interface </item>\r
+                       <item> ip </item>\r
+                       <item> isdn </item>\r
+                       <item> isdn-mib </item>\r
+                       <item> kerberos </item>\r
+                       <item> key </item>\r
+                       <item> line </item>\r
+                       <item> logging </item>\r
+                       <item> login-string </item>\r
+                       <item> map-class </item>\r
+                       <item> map-list </item>\r
+                       <item> memory-size </item>\r
+                       <item> menu </item>\r
+                       <item> modemcap </item>\r
+                       <item> multilink </item>\r
+                       <item> netbios </item>\r
+                       <item> no </item>\r
+                       <item> ntp </item>\r
+                       <item> partition </item>\r
+                       <item> policy-map </item>\r
+                       <item> priority-list </item>\r
+                       <item> privilege </item>\r
+                       <item> process-max-time </item>\r
+                       <item> prompt </item>\r
+                       <item> queue-list </item>\r
+                       <item> resume-string </item>\r
+                       <item> rlogin </item>\r
+                       <item> rmon </item>\r
+                       <item> route-map </item>\r
+                       <item> router </item>\r
+                       <item> rtr </item>\r
+                       <item> scheduler </item>\r
+                       <item> service </item>\r
+                       <item> snmp-server </item>\r
+                       <item> sntp </item>\r
+                       <item> stackmaker </item>\r
+                       <item> state-machine </item>\r
+                       <item> subscriber-policy </item>\r
+                       <item> tacacs-server </item>\r
+                       <item> template </item>\r
+                       <item> terminal-queue </item>\r
+                       <item> tftp-server </item>\r
+                       <item> time-range </item>\r
+                       <item> username </item>\r
+                       <item> virtual-profile </item>\r
+                       <item> virtual-template </item>\r
+                       <item> vpdn </item>\r
+                       <item> vpdn-group </item>\r
+                       <item> x25 </item>\r
+                       <item> x29 </item>\r
+               </list>\r
+               <list name = "parameters">\r
+                       <item> accounting </item>\r
+                       <item> accounting-list </item>\r
+                       <item> accounting-threshold </item>\r
+                       <item> accounting-transits </item>\r
+                       <item> address-pool </item>\r
+                       <item> as-path </item>\r
+                       <item> audit </item>\r
+                       <item> auth-proxy </item>\r
+                       <item> authentication </item>\r
+                       <item> authorization </item>\r
+                       <item> bgp-community </item>\r
+                       <item> bootp </item>\r
+                       <item> cef </item>\r
+                       <item> classless </item>\r
+                       <item> community-list </item>\r
+                       <item> default-gateway </item>\r
+                       <item> default-network </item>\r
+                       <item> dhcp </item>\r
+                       <item> dhcp-server </item>\r
+                       <item> domain-list </item>\r
+                       <item> domain-lookup </item>\r
+                       <item> domain-name </item>\r
+                       <item> dvmrp </item>\r
+                       <item> exec-callback </item>\r
+                       <item> extcommunity-list </item>\r
+                       <item> finger </item>\r
+                       <item> flow-aggregation </item>\r
+                       <item> flow-cache </item>\r
+                       <item> flow-export </item>\r
+                       <item> forward-protocol </item>\r
+                       <item> ftp </item>\r
+                       <item> gratuitous-arps </item>\r
+                       <item> host </item>\r
+                       <item> host-routing </item>\r
+                       <item> hp-host </item>\r
+                       <item> http </item>\r
+                       <item> icmp </item>\r
+                       <item> inspect </item>\r
+                       <item> local </item>\r
+                       <item> mrm </item>\r
+                       <item> mroute </item>\r
+                       <item> msdp </item>\r
+                       <item> multicast </item>\r
+                       <item> multicast-routing </item>\r
+                       <item> name-server </item>\r
+                       <item> nat </item>\r
+                       <item> new-model </item>\r
+                       <item> ospf </item>\r
+                       <item> password </item>\r
+                       <item> password-encryption </item>\r
+                       <item> pgm </item>\r
+                       <item> pim </item>\r
+                       <item> port-map </item>\r
+                       <item> prefix-list </item>\r
+                       <item> radius </item>\r
+                       <item> rcmd </item>\r
+                       <item> reflexive-list </item>\r
+                       <item> route </item>\r
+                       <item> routing </item>\r
+                       <item> rsvp </item>\r
+                       <item> rtcp </item>\r
+                       <item> sap </item>\r
+                       <item> sdr </item>\r
+                       <item> security </item>\r
+                       <item> source-route </item>\r
+                       <item> subnet-zero </item>\r
+                       <item> tacacs </item>\r
+                       <item> tcp </item>\r
+                       <item> tcp-small-servers </item>\r
+                       <item> telnet </item>\r
+                       <item> tftp </item>\r
+                       <item> timestamps </item>\r
+                       <item> udp-small-servers </item>\r
+                       <item> vrf </item>\r
+                       <item> wccp </item>\r
+               </list>\r
+               <list name = "options">\r
+                       <item> accounting </item>\r
+                       <item> accounting-list </item>\r
+                       <item> accounting-threshold </item>\r
+                       <item> accounting-transits </item>\r
+                       <item> address-pool </item>\r
+                       <item> as-path </item>\r
+                       <item> audit </item>\r
+                       <item> auth-proxy </item>\r
+                       <item> authentication </item>\r
+                       <item> authorization </item>\r
+                       <item> bgp-community </item>\r
+                       <item> bootp </item>\r
+                       <item> cef </item>\r
+                       <item> classless </item>\r
+                       <item> community-list </item>\r
+                       <item> default-gateway </item>\r
+                       <item> default-network </item>\r
+                       <item> dhcp </item>\r
+                       <item> dhcp-server </item>\r
+                       <item> domain-list </item>\r
+                       <item> domain-lookup </item>\r
+                       <item> domain-name </item>\r
+                       <item> dvmrp </item>\r
+                       <item> exec-callback </item>\r
+                       <item> extcommunity-list </item>\r
+                       <item> finger </item>\r
+                       <item> flow-aggregation </item>\r
+                       <item> flow-cache </item>\r
+                       <item> flow-export </item>\r
+                       <item> forward-protocol </item>\r
+                       <item> ftp </item>\r
+                       <item> gratuitous-arps </item>\r
+                       <item> host </item>\r
+                       <item> host-routing </item>\r
+                       <item> hp-host </item>\r
+                       <item> http </item>\r
+                       <item> icmp </item>\r
+                       <item> inspect </item>\r
+                       <item> local </item>\r
+                       <item> mrm </item>\r
+                       <item> mroute </item>\r
+                       <item> msdp </item>\r
+                       <item> multicast </item>\r
+                       <item> multicast-routing </item>\r
+                       <item> name-server </item>\r
+                       <item> nat </item>\r
+                       <item> new-model </item>\r
+                       <item> ospf </item>\r
+                       <item> password </item>\r
+                       <item> password-encryption </item>\r
+                       <item> pgm </item>\r
+                       <item> pim </item>\r
+                       <item> port-map </item>\r
+                       <item> prefix-list </item>\r
+                       <item> radius </item>\r
+                       <item> rcmd </item>\r
+                       <item> reflexive-list </item>\r
+                       <item> route </item>\r
+                       <item> routing </item>\r
+                       <item> rsvp </item>\r
+                       <item> rtcp </item>\r
+                       <item> sap </item>\r
+                       <item> sdr </item>\r
+                       <item> security </item>\r
+                       <item> source-route </item>\r
+                       <item> subnet-zero </item>\r
+                       <item> tacacs </item>\r
+                       <item> tcp </item>\r
+                       <item> tcp-small-servers </item>\r
+                       <item> telnet </item>\r
+                       <item> tftp </item>\r
+                       <item> timestamps </item>\r
+                       <item> udp-small-servers </item>\r
+                       <item> vrf </item>\r
+                       <item> wccp </item>\r
+               </list>\r
+               <contexts>\r
+                        <context name = "Base" attribute = "Normal Text" lineEndContext = "#stay">\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bdone\b" insensitive="TRUE" endRegion="dodone1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bdo\b" insensitive="TRUE" beginRegion="dodone1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\belif\b" insensitive="TRUE" beginRegion="iffi1" endRegion="iffi1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bif\b" insensitive="TRUE" beginRegion="iffi1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bfi\b" insensitive="TRUE" endRegion="iffi1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\bcase\b" insensitive="TRUE" beginRegion="case1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="\besac\b" insensitive="TRUE" endRegion="case1"/>\r
+                                <RegExpr attribute="Keyword" context="#stay" String="^[^()]+\)" insensitive="TRUE" beginRegion="subcase1"/>\r
+                                <StringDetect attribute="Keyword" context="#stay" String=";;" insensitive="TRUE" endRegion="subcase1"/>\r
+                                <DetectChar attribute="Keyword" context="#stay" char="{" beginRegion="func1"/>\r
+                                <DetectChar attribute="Keyword" context="#stay" char="}" endRegion="func1"/>\r
+\r
+                                <keyword String = "commands" attribute = "Command" context = "#stay"/>\r
+                                <keyword String = "parameters" attribute = "Parameter" context = "#stay"/>\r
+                                <keyword String = "options" attribute = "Keyword" context = "#stay"/>\r
+                                <Int attribute = "Decimal" context = "#stay"/>\r
+                                <RegExpr String = "\$[A-Za-z0-9_?{}!]+" attribute = "Parameter" context = "#stay"/>\r
+                                <RangeDetect char = "&quot;" char1 = "&quot;" attribute = "String" context = "#stay"/>\r
+                                <AnyChar String = "|&lt;&gt;=;" attribute = "Operator" context = "#stay"/>\r
+                                <DetectChar char="'" attribute = "String" context = "Single Quote"/>\r
+                                <DetectChar char="`" attribute = "Substitution" context = "Substitution"/>\r
+                                <Detect2Chars attribute = "Normal Text" context = "#stay" char = "\" char1 = "#"/>\r
+                                <RegExpr String= "#.*$" attribute = "Comment" context="#stay"/>\r
+\r
+                        </context>\r
+                        <context name = "String" attribute = "String" lineEndContext="#stay">\r
+                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
+                               <StringDetect String = "\&quot;" attribute = "String" context = "#stay"/>\r
+                                <DetectChar char = "&quot;" attribute = "String" context = "#pop"/>\r
+                        </context>\r
+                       <context name = "Single Quote" attribute = "String" lineEndContext="#stay">\r
+                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
+                               <StringDetect String = "\'" attribute = "String" context = "#stay"/>\r
+                               <DetectChar char = "'" attribute = "String" context = "#pop"/>\r
+                        </context>\r
+                        <context name = "Substitution" attribute = "Substitution" lineEndContext="#stay">\r
+                               <StringDetect String = "\\" attribute = "String" context = "#stay"/>\r
+                               <StringDetect String = "\`" attribute = "String" context = "#stay"/>\r
+                                <DetectChar char = "`" attribute = "Substitution" context = "#pop"/>\r
+                        </context>\r
+                        <context name = "Parameter" attribute = "Parameter" lineEndContext="#stay">\r
+                                <RegExpr String = "\$[A-Za-z0-9_?]+" attribute = "Parameter" context="#pop"/>\r
+                        </context>\r
+                </contexts>\r
+                <itemDatas>\r
+                        <itemData name = "Normal Text" defStyleNum = "dsNormal"/>\r
+                        <itemData name = "Keyword" defStyleNum = "dsKeyword"/>\r
+                        <itemData name = "Decimal" defStyleNum = "dsDecVal"/>\r
+                        <itemData name = "Float" defStyleNum = "dsFloat"/>\r
+                        <itemData name = "Char" defStyleNum = "dsChar"/>\r
+                        <itemData name = "String" defStyleNum = "dsString"/>\r
+                        <itemData name = "Comment" defStyleNum = "dsComment"/>\r
+                        <itemData name = "Substitution" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Parameter" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Operator" defStyleNum = "dsOthers"/>\r
+                        <itemData name = "Command" defStyleNum = "dsNormal"/>\r
+                </itemDatas>\r
+       </highlighting>\r
+       <general>\r
+               <comments>\r
+                       <comment name="singleLine" start="!"/>\r
+               </comments>\r
+               <keywords casesensitive="0"/>\r
+               </general>\r
+</language>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<language name="ColdFusion" version="1.03" kateversion="2.1" section="Markup" extensions="*.cfm;*.cfc;*.cfml;*.dbm" mimetype="text/x-coldfusion">\r
+\r
+       <highlighting>\r
+\r
+               <list name="Script Keywords">\r
+\r
+                       <item> if </item>\r
+                       <item> else </item>\r
+                       <item> for </item>\r
+                       <item> in </item>\r
+                       <item> while </item>\r
+                       <item> do </item>\r
+                       <item> continue </item>\r
+                       <item> break </item>\r
+                       <item> with </item>\r
+                       <item> try </item>\r
+                       <item> catch </item>\r
+                       <item> switch </item>\r
+                       <item> case </item>\r
+                       <item> new </item>\r
+                       <item> var </item>\r
+                       <item> function </item>\r
+                       <item> return </item>\r
+                       <item> this </item>\r
+                       <item> delete </item>\r
+                       <item> true </item>\r
+                       <item> false </item>\r
+                       <item> void </item>\r
+                       <item> throw </item>\r
+                       <item> typeof </item>\r
+                       <item> const </item>\r
+                       <item> default </item>\r
+\r
+               </list>\r
+\r
+               <list name="Script Objects">\r
+\r
+                       <item> Anchor </item>\r
+                       <item> Applet </item>\r
+                       <item> Area </item>\r
+                       <item> Array </item>\r
+                       <item> Boolean </item>\r
+                       <item> Button </item>\r
+                       <item> Checkbox </item>\r
+                       <item> Date </item>\r
+                       <item> Document </item>\r
+                       <item> Event </item>\r
+                       <item> FileUpload </item>\r
+                       <item> Form </item>\r
+                       <item> Frame </item>\r
+                       <item> Function </item>\r
+                       <item> Hidden </item>\r
+                       <item> History </item>\r
+                       <item> Image </item>\r
+                       <item> Layer </item>\r
+                       <item> Linke </item>\r
+                       <item> Location </item>\r
+                       <item> Math </item>\r
+                       <item> Navigator </item>\r
+                       <item> Number </item>\r
+                       <item> Object </item>\r
+                       <item> Option </item>\r
+                       <item> Password </item>\r
+                       <item> Radio </item>\r
+                       <item> RegExp </item>\r
+                       <item> Reset </item>\r
+                       <item> Screen </item>\r
+                       <item> Select </item>\r
+                       <item> String </item>\r
+                       <item> Submit </item>\r
+                       <item> Text </item>\r
+                       <item> Textarea </item>\r
+                       <item> Window </item>\r
+\r
+               </list>\r
+\r
+               <list name="Script Methods">\r
+\r
+                       <item> abs </item>\r
+                       <item> acos </item>\r
+                       <item> alert </item>\r
+                       <item> anchor </item>\r
+                       <item> apply </item>\r
+                       <item> asin </item>\r
+                       <item> atan </item>\r
+                       <item> atan2 </item>\r
+                       <item> back </item>\r
+                       <item> blur </item>\r
+                       <item> call </item>\r
+                       <item> captureEvents </item>\r
+                       <item> ceil </item>\r
+                       <item> charAt </item>\r
+                       <item> charCodeAt </item>\r
+                       <item> clearInterval </item>\r
+                       <item> clearTimeout </item>\r
+                       <item> click </item>\r
+                       <item> close </item>\r
+                       <item> compile </item>\r
+                       <item> concat </item>\r
+                       <item> confirm </item>\r
+                       <item> cos </item>\r
+                       <item> disableExternalCapture </item>\r
+                       <item> enableExternalCapture </item>\r
+                       <item> eval </item>\r
+                       <item> exec </item>\r
+                       <item> exp </item>\r
+                       <item> find </item>\r
+                       <item> floor </item>\r
+                       <item> focus </item>\r
+                       <item> forward </item>\r
+                       <item> fromCharCode </item>\r
+                       <item> getDate </item>\r
+                       <item> getDay </item>\r
+                       <item> getFullYear </item>\r
+                       <item> getHours </item>\r
+                       <item> getMilliseconds </item>\r
+                       <item> getMinutes </item>\r
+                       <item> getMonth </item>\r
+                       <item> getSeconds </item>\r
+                       <item> getSelection </item>\r
+                       <item> getTime </item>\r
+                       <item> getTimezoneOffset </item>\r
+                       <item> getUTCDate </item>\r
+                       <item> getUTCDay </item>\r
+                       <item> getUTCFullYear </item>\r
+                       <item> getUTCHours </item>\r
+                       <item> getUTCMilliseconds </item>\r
+                       <item> getUTCMinutes </item>\r
+                       <item> getUTCMonth </item>\r
+                       <item> getUTCSeconds </item>\r
+                       <item> go </item>\r
+                       <item> handleEvent </item>\r
+                       <item> home </item>\r
+                       <item> indexOf </item>\r
+                       <item> javaEnabled </item>\r
+                       <item> join </item>\r
+                       <item> lastIndexOf </item>\r
+                       <item> link </item>\r
+                       <item> load </item>\r
+                       <item> log </item>\r
+                       <item> match </item>\r
+                       <item> max </item>\r
+                       <item> min </item>\r
+                       <item> moveAbove </item>\r
+                       <item> moveBelow </item>\r
+                       <item> moveBy </item>\r
+                       <item> moveTo </item>\r
+                       <item> moveToAbsolute </item>\r
+                       <item> open </item>\r
+                       <item> parse </item>\r
+                       <item> plugins.refresh </item>\r
+                       <item> pop </item>\r
+                       <item> pow </item>\r
+                       <item> preference </item>\r
+                       <item> print </item>\r
+                       <item> prompt </item>\r
+                       <item> push </item>\r
+                       <item> random </item>\r
+                       <item> releaseEvents </item>\r
+                       <item> reload </item>\r
+                       <item> replace </item>\r
+                       <item> reset </item>\r
+                       <item> resizeBy </item>\r
+                       <item> resizeTo </item>\r
+                       <item> reverse </item>\r
+                       <item> round </item>\r
+                       <item> routeEvent </item>\r
+                       <item> scrollBy </item>\r
+                       <item> scrollTo </item>\r
+                       <item> search </item>\r
+                       <item> select </item>\r
+                       <item> setDate </item>\r
+                       <item> setFullYear </item>\r
+                       <item> setHours </item>\r
+                       <item> setInterval </item>\r
+                       <item> setMilliseconds </item>\r
+                       <item> setMinutes </item>\r
+                       <item> setMonth </item>\r
+                       <item> setSeconds </item>\r
+                       <item> setTime </item>\r
+                       <item> setTimeout </item>\r
+                       <item> setUTCDate </item>\r
+                       <item> setUTCFullYear </item>\r
+                       <item> setUTCHours </item>\r
+                       <item> setUTCMilliseconds </item>\r
+                       <item> setUTCMinutes </item>\r
+                       <item> setUTCMonth </item>\r
+                       <item> setUTCSeconds </item>\r
+                       <item> shift </item>\r
+                       <item> sin </item>\r
+                       <item> slice </item>\r
+                       <item> sort </item>\r
+                       <item> splice </item>\r
+                       <item> split </item>\r
+                       <item> sqrt </item>\r
+                       <item> stop </item>\r
+                       <item> String formatting </item>\r
+                       <item> submit </item>\r
+                       <item> substr </item>\r
+                       <item> substring </item>\r
+                       <item> taintEnabled </item>\r
+                       <item> tan </item>\r
+                       <item> test </item>\r
+                       <item> toLocaleString </item>\r
+                       <item> toLowerCase </item>\r
+                       <item> toSource </item>\r
+                       <item> toString </item>\r
+                       <item> toUpperCase </item>\r
+                       <item> toUTCString </item>\r
+                       <item> unshift </item>\r
+                       <item> unwatch </item>\r
+                       <item> UTC </item>\r
+                       <item> valueOf </item>\r
+                       <item> watch </item>\r
+                       <item> write </item>\r
+                       <item> writeln  </item>\r
+\r
+               </list>\r
+\r
+               <list name="CFSCRIPT Keywords">\r
+\r
+                       <item> break </item>\r
+                       <item> case </item>\r
+                       <item> catch </item>\r
+                       <item> continue </item>\r
+                       <item> default </item>\r
+                       <item> do </item>\r
+                       <item> else </item>\r
+                       <item> for </item>\r
+                       <item> function </item>\r
+                       <item> if </item>\r
+                       <item> in </item>\r
+                       <item> return </item>\r
+                       <item> switch </item>\r
+                       <item> try </item>\r
+                       <item> var </item>\r
+                       <item> while </item>\r
+\r
+               </list>\r
+\r
+               <list name="CFSCRIPT Functions">\r
+\r
+                       <item> Abs </item>\r
+                       <item> ACos </item>\r
+                       <item> ArrayAppend </item>\r
+                       <item> ArrayAvg </item>\r
+                       <item> ArrayClear </item>\r
+                       <item> ArrayDeleteAt </item>\r
+                       <item> ArrayInsertAt </item>\r
+                       <item> ArrayIsEmpty </item>\r
+                       <item> ArrayLen </item>\r
+                       <item> ArrayMax </item>\r
+                       <item> ArrayMin </item>\r
+                       <item> ArrayNew </item>\r
+                       <item> ArrayPrepend </item>\r
+                       <item> ArrayResize </item>\r
+                       <item> ArraySet </item>\r
+                       <item> ArraySort </item>\r
+                       <item> ArraySum </item>\r
+                       <item> ArraySwap </item>\r
+                       <item> ArrayToList </item>\r
+                       <item> Asc </item>\r
+                       <item> ASin </item>\r
+                       <item> Atn </item>\r
+                       <item> BitAnd </item>\r
+                       <item> BitMaskClear </item>\r
+                       <item> BitMaskRead </item>\r
+                       <item> BitMaskSet </item>\r
+                       <item> BitNot </item>\r
+                       <item> BitOr </item>\r
+                       <item> BitSHLN </item>\r
+                       <item> BitSHRN </item>\r
+                       <item> BitXor </item>\r
+                       <item> Ceiling </item>\r
+                       <item> Chr </item>\r
+                       <item> CJustify </item>\r
+                       <item> Compare </item>\r
+                       <item> CompareNoCase </item>\r
+                       <item> Cos </item>\r
+                       <item> CreateDate </item>\r
+                       <item> CreateDateTime </item>\r
+                       <item> CreateObject </item>\r
+                       <item> CreateODBCDate </item>\r
+                       <item> CreateODBCDateTime </item>\r
+                       <item> CreateODBCTime </item>\r
+                       <item> CreateTime </item>\r
+                       <item> CreateTimeSpan </item>\r
+                       <item> CreateUUID </item>\r
+                       <item> DateAdd </item>\r
+                       <item> DateCompare </item>\r
+                       <item> DateConvert </item>\r
+                       <item> DateDiff </item>\r
+                       <item> DateFormat </item>\r
+                       <item> DatePart </item>\r
+                       <item> Day </item>\r
+                       <item> DayOfWeek </item>\r
+                       <item> DayOfWeekAsString </item>\r
+                       <item> DayOfYear </item>\r
+                       <item> DaysInMonth </item>\r
+                       <item> DaysInYear </item>\r
+                       <item> DE </item>\r
+                       <item> DecimalFormat </item>\r
+                       <item> DecrementValue </item>\r
+                       <item> Decrypt </item>\r
+                       <item> DeleteClientVariable </item>\r
+                       <item> DirectoryExists </item>\r
+                       <item> DollarFormat </item>\r
+                       <item> Duplicate </item>\r
+                       <item> Encrypt </item>\r
+                       <item> Evaluate </item>\r
+                       <item> Exp </item>\r
+                       <item> ExpandPath </item>\r
+                       <item> FileExists </item>\r
+                       <item> Find </item>\r
+                       <item> FindNoCase </item>\r
+                       <item> FindOneOf </item>\r
+                       <item> FirstDayOfMonth </item>\r
+                       <item> Fix </item>\r
+                       <item> FormatBaseN </item>\r
+                       <item> GetAuthUser </item>\r
+                       <item> GetBaseTagData </item>\r
+                       <item> GetBaseTagList </item>\r
+                       <item> GetBaseTemplatePath </item>\r
+                       <item> GetClientVariablesList </item>\r
+                       <item> GetCurrentTemplatePath </item>\r
+                       <item> GetDirectoryFromPath </item>\r
+                       <item> GetException </item>\r
+                       <item> GetFileFromPath </item>\r
+                       <item> GetFunctionList </item>\r
+                       <item> GetHttpRequestData </item>\r
+                       <item> GetHttpTimeString </item>\r
+                       <item> GetK2ServerDocCount </item>\r
+                       <item> GetK2ServerDocCountLimit </item>\r
+                       <item> GetLocale </item>\r
+                       <item> GetMetaData </item>\r
+                       <item> GetMetricData </item>\r
+                       <item> GetPageContext </item>\r
+                       <item> GetProfileSections </item>\r
+                       <item> GetProfileString </item>\r
+                       <item> GetServiceSettings </item>\r
+                       <item> GetTempDirectory </item>\r
+                       <item> GetTempFile </item>\r
+                       <item> GetTemplatePath </item>\r
+                       <item> GetTickCount </item>\r
+                       <item> GetTimeZoneInfo </item>\r
+                       <item> GetToken </item>\r
+                       <item> Hash </item>\r
+                       <item> Hour </item>\r
+                       <item> HTMLCodeFormat </item>\r
+                       <item> HTMLEditFormat </item>\r
+                       <item> IIf </item>\r
+                       <item> IncrementValue </item>\r
+                       <item> InputBaseN </item>\r
+                       <item> Insert </item>\r
+                       <item> Int </item>\r
+                       <item> IsArray </item>\r
+                       <item> IsBinary </item>\r
+                       <item> IsBoolean </item>\r
+                       <item> IsCustomFunction </item>\r
+                       <item> IsDate </item>\r
+                       <item> IsDebugMode </item>\r
+                       <item> IsDefined </item>\r
+                       <item> IsK2ServerABroker </item>\r
+                       <item> IsK2ServerDocCountExceeded </item>\r
+                       <item> IsK2ServerOnline </item>\r
+                       <item> IsLeapYear </item>\r
+                       <item> IsNumeric </item>\r
+                       <item> IsNumericDate </item>\r
+                       <item> IsObject </item>\r
+                       <item> IsQuery </item>\r
+                       <item> IsSimpleValue </item>\r
+                       <item> IsStruct </item>\r
+                       <item> IsUserInRole </item>\r
+                       <item> IsWDDX </item>\r
+                       <item> IsXmlDoc </item>\r
+                       <item> IsXmlElement </item>\r
+                       <item> IsXmlRoot </item>\r
+                       <item> JavaCast </item>\r
+                       <item> JSStringFormat </item>\r
+                       <item> LCase </item>\r
+                       <item> Left </item>\r
+                       <item> Len </item>\r
+                       <item> ListAppend </item>\r
+                       <item> ListChangeDelims </item>\r
+                       <item> ListContains </item>\r
+                       <item> ListContainsNoCase </item>\r
+                       <item> ListDeleteAt </item>\r
+                       <item> ListFind </item>\r
+                       <item> ListFindNoCase </item>\r
+                       <item> ListFirst </item>\r
+                       <item> ListGetAt </item>\r
+                       <item> ListInsertAt </item>\r
+                       <item> ListLast </item>\r
+                       <item> ListLen </item>\r
+                       <item> ListPrepend </item>\r
+                       <item> ListQualify </item>\r
+                       <item> ListRest </item>\r
+                       <item> ListSetAt </item>\r
+                       <item> ListSort </item>\r
+                       <item> ListToArray </item>\r
+                       <item> ListValueCount </item>\r
+                       <item> ListValueCountNoCase </item>\r
+                       <item> LJustify </item>\r
+                       <item> Log </item>\r
+                       <item> Log10 </item>\r
+                       <item> LSCurrencyFormat </item>\r
+                       <item> LSDateFormat </item>\r
+                       <item> LSEuroCurrencyFormat </item>\r
+                       <item> LSIsCurrency </item>\r
+                       <item> LSIsDate </item>\r
+                       <item> LSIsNumeric </item>\r
+                       <item> LSNumberFormat </item>\r
+                       <item> LSParseCurrency </item>\r
+                       <item> LSParseDateTime </item>\r
+                       <item> LSParseEuroCurrency </item>\r
+                       <item> LSParseNumber </item>\r
+                       <item> LSTimeFormat </item>\r
+                       <item> LTrim </item>\r
+                       <item> Max </item>\r
+                       <item> Mid </item>\r
+                       <item> Min </item>\r
+                       <item> Minute </item>\r
+                       <item> Month </item>\r
+                       <item> MonthAsString </item>\r
+                       <item> Now </item>\r
+                       <item> NumberFormat </item>\r
+                       <item> ParagraphFormat </item>\r
+                       <item> ParameterExists </item>\r
+                       <item> ParseDateTime </item>\r
+                       <item> Pi </item>\r
+                       <item> PreserveSingleQuotes </item>\r
+                       <item> Quarter </item>\r
+                       <item> QueryAddColumn </item>\r
+                       <item> QueryAddRow </item>\r
+                       <item> QueryNew </item>\r
+                       <item> QuerySetCell </item>\r
+                       <item> QuotedValueList </item>\r
+                       <item> Rand </item>\r
+                       <item> Randomize </item>\r
+                       <item> RandRange </item>\r
+                       <item> REFind </item>\r
+                       <item> REFindNoCase </item>\r
+                       <item> RemoveChars </item>\r
+                       <item> RepeatString </item>\r
+                       <item> Replace </item>\r
+                       <item> ReplaceList </item>\r
+                       <item> ReplaceNoCase </item>\r
+                       <item> REReplace </item>\r
+                       <item> REReplaceNoCase </item>\r
+                       <item> Reverse </item>\r
+                       <item> Right </item>\r
+                       <item> RJustify </item>\r
+                       <item> Round </item>\r
+                       <item> RTrim </item>\r
+                       <item> Second </item>\r
+                       <item> SetEncoding </item>\r
+                       <item> SetLocale </item>\r
+                       <item> SetProfileString </item>\r
+                       <item> SetVariable </item>\r
+                       <item> Sgn </item>\r
+                       <item> Sin </item>\r
+                       <item> SpanExcluding </item>\r
+                       <item> SpanIncluding </item>\r
+                       <item> Sqr </item>\r
+                       <item> StripCR </item>\r
+                       <item> StructAppend </item>\r
+                       <item> StructClear </item>\r
+                       <item> StructCopy </item>\r
+                       <item> StructCount </item>\r
+                       <item> StructDelete </item>\r
+                       <item> StructFind </item>\r
+                       <item> StructFindKey </item>\r
+                       <item> StructFindValue </item>\r
+                       <item> StructGet </item>\r
+                       <item> StructInsert </item>\r
+                       <item> StructIsEmpty </item>\r
+                       <item> StructKeyArray </item>\r
+                       <item> StructKeyExists </item>\r
+                       <item> StructKeyList </item>\r
+                       <item> StructNew </item>\r
+                       <item> StructSort </item>\r
+                       <item> StructUpdate </item>\r
+                       <item> Tan </item>\r
+                       <item> TimeFormat </item>\r
+                       <item> ToBase64 </item>\r
+                       <item> ToBinary </item>\r
+                       <item> ToString </item>\r
+                       <item> Trim </item>\r
+                       <item> UCase </item>\r
+                       <item> URLDecode </item>\r
+                       <item> URLEncodedFormat </item>\r
+                       <item> URLSessionFormat </item>\r
+                       <item> Val </item>\r
+                       <item> ValueList </item>\r
+                       <item> Week </item>\r
+                       <item> WriteOutput </item>\r
+                       <item> XmlChildPos </item>\r
+                       <item> XmlElemNew </item>\r
+                       <item> XmlFormat </item>\r
+                       <item> XmlNew </item>\r
+                       <item> XmlParse </item>\r
+                       <item> XmlSearch </item>\r
+                       <item> XmlTransform </item>\r
+                       <item> Year </item>\r
+                       <item> YesNoFormat </item>\r
+\r
+               </list>\r
+\r
+               <contexts>\r
+\r
+                       <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">\r
+                               <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />\r
+                               <StringDetect attribute="HTML Comment" context="ctxHTML Comment" String="&lt;!--" />\r
+                               <RegExpr attribute="Script Tags" context="ctxCFSCRIPT Tag" String="&lt;[cC][fF][sS][cC][rR][iI][pP][tT]" />\r
+                               <RegExpr attribute="Script Tags" context="ctxSCRIPT Tag" String="&lt;[sS][cC][rR][iI][pP][tT]" />\r
+                               <RegExpr attribute="Style Tags" context="ctxSTYLE Tag" String="&lt;[sS][tT][yY][lL][eE]" />\r
+                               <DetectChar attribute="HTML Entities" context="ctxHTML Entities" char="&amp;" />\r
+                               <RegExpr attribute="Custom Tags" context="ctxCustom Tag" String="&lt;\/?[cC][fF]_" />\r
+                               <RegExpr attribute="CFX Tags" context="ctxCFX Tag" String="&lt;\/?[cC][fF][xX]_" />\r
+                               <RegExpr attribute="CF Tags" context="ctxCF Tag" String="&lt;\/?[cC][fF]" />\r
+                               <RegExpr attribute="Table Tags" context="ctxTable Tag" String="&lt;\/?([tT][aAhHbBfFrRdD])|([cC][aA][pP][tT])" />\r
+                               <RegExpr attribute="Anchor Tags" context="ctxAnchor Tag" String="&lt;\/?[aA] " />\r
+                               <RegExpr attribute="Image Tags" context="ctxImage Tag" String="&lt;\/?[iI][mM][gG] " />\r
+                               <RegExpr attribute="Tags" context="ctxTag" String="&lt;!?\/?[a-zA-Z0-9_]+" />\r
+                       </context>\r
+\r
+\r
+\r
+                       <context name="ctxCFSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Script Tags" context="ctxCFSCRIPT Block" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxSCRIPT Tag" attribute="Script Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Script Tags" context="ctxSCRIPT Block" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxSTYLE Tag" attribute="Style Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Style Tags" context="ctxSTYLE Block" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+\r
+\r
+                       <context name="ctxTag" attribute="Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Tags" context="#pop" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxTable Tag" attribute="Table Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Table Tags" context="#pop" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxAnchor Tag" attribute="Anchor Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Anchor Tags" context="#pop" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxImage Tag" attribute="Image Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Image Tags" context="#pop" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxCF Tag" attribute="CF Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="CF Tags" context="#pop" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxCustom Tag" attribute="Custom Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="Custom Tags" context="#pop" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+                       <context name="ctxCFX Tag" attribute="CFX Tags" lineEndContext="#stay">\r
+                               <DetectChar attribute="CFX Tags" context="#pop" char="&gt;" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="=" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+\r
+\r
+                       <context name="ctxHTML Comment" attribute="HTML Comment" lineEndContext="#stay">\r
+                               <StringDetect attribute="CF Comment" context="ctxCF Comment" String="&lt;!---" />\r
+                               <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />\r
+                       </context>\r
+\r
+                       <context name="ctxCF Comment" attribute="CF Comment" lineEndContext="#stay">\r
+                               <StringDetect attribute="CF Comment" context="#pop" String="---&gt;" />\r
+                       </context>\r
+\r
+                       <context name="ctxC Style Comment" attribute="Script Comment" lineEndContext="#stay">\r
+                       <Detect2Chars attribute="Script Comment" context="#pop" char="*" char1="/" />\r
+                       </context>\r
+\r
+                       <context name="ctxOne Line Comment" attribute="Script Comment" lineEndContext="#pop" />\r
+\r
+                       <context name="ctxHTML Entities" attribute="HTML Entities" lineEndContext="#pop">\r
+                               <DetectChar attribute="HTML Entities" context="#pop" char=";" />\r
+                       </context>\r
+\r
+\r
+\r
+                       <context name="ctxCFSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">\r
+                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
+                               <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />\r
+                               <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />\r
+                               <Int attribute="Script Numbers" context="#stay" />\r
+                               <Float attribute="Script Numbers" context="#stay" />\r
+                               <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />\r
+                               <AnyChar attribute="Brackets" context="#stay" String="{}" />\r
+\r
+                               <keyword attribute="Script Keywords" context="#stay" String="CFSCRIPT Keywords" />\r
+                               <keyword attribute="Script Functions" context="#stay" String="CFSCRIPT Functions" />\r
+                               <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[cC][fF][sS][cC][rR][iI][pP][tT]&gt;" />\r
+                       </context>\r
+\r
+\r
+\r
+                       <context name="ctxSCRIPT Block" attribute="Normal Text" lineEndContext="#stay">\r
+                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
+                               <Detect2Chars attribute="Script Comment" context="ctxOne Line Comment" char="/" char1="/" />\r
+                               <RegExpr attribute="Script Strings" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Script Strings" context="#stay" String="'[^']*'" />\r
+                               <Int attribute="Script Numbers" context="#stay" />\r
+                               <Float attribute="Script Numbers" context="#stay" />\r
+                               <AnyChar attribute="Script Operators" context="#stay" String="[()[\]=+-*/]+" />\r
+                               <AnyChar attribute="Brackets" context="#stay" String="{}" />\r
+\r
+                               <keyword attribute="Script Keywords" context="#stay" String="Script Keywords" />\r
+                               <keyword attribute="Script Objects" context="#stay" String="Script Objects" />\r
+                               <keyword attribute="Script Functions" context="#stay" String="Script Methods" />\r
+                               <RegExpr attribute="Script Tags" context="#pop#pop" String="&lt;/[sS][cC][rR][iI][pP][tT]&gt;" />\r
+                       </context>\r
+\r
+\r
+\r
+                       <context name="ctxSTYLE Block" attribute="Style Selectors" lineEndContext="#stay">\r
+                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
+                               <DetectChar attribute="Brackets" context="ctxStyle Properties" char="{" />\r
+                               <RegExpr attribute="Style Tags" context="#pop#pop" String="&lt;/[sS][tT][yY][lL][eE]&gt;" />\r
+                       </context>\r
+\r
+                       <context name="ctxStyle Properties" attribute="Style Properties" lineEndContext="#stay">\r
+                               <DetectChar attribute="Brackets" context="#pop" char="}" />\r
+                               <Detect2Chars attribute="Script Comment" context="ctxC Style Comment" char="/" char1="*" />\r
+                               <DetectChar attribute="Normal Text" context="ctxStyle Values" char=":" />\r
+                       </context>\r
+\r
+                       <context name="ctxStyle Values" attribute="Style Values" lineEndContext="#pop">\r
+                               <DetectChar attribute="Normal Text" context="#pop" char=";" />\r
+                               <DetectChar attribute="Normal Text" context="#stay" char="," />\r
+                               <Int attribute="Numbers" context="#stay" />\r
+                               <Float attribute="Numbers" context="#stay" />\r
+                               <RegExpr attribute="Numbers" context="#stay" String="#([0-9a-fA-F]{3})|([0-9a-fA-F]{6})" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="&quot;[^&quot;]*&quot;" />\r
+                               <RegExpr attribute="Attribute Values" context="#stay" String="'[^']*'" />\r
+                       </context>\r
+\r
+               </contexts>\r
+\r
+               <itemDatas>\r
+\r
+                       <itemData name="Normal Text" defStyleNum="dsNormal"                     color="#000000" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Tags" defStyleNum="dsNormal"                            color="#000080" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Table Tags" defStyleNum="dsNormal"                      color="#008080" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Script Tags" defStyleNum="dsNormal"                     color="#800000" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Image Tags" defStyleNum="dsNormal"                      color="#800080" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Style Tags" defStyleNum="dsNormal"                      color="#800080" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Anchor Tags" defStyleNum="dsNormal"                     color="#008000" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Attribute Values" defStyleNum="dsNormal"        color="#0000ff" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="HTML Comment" defStyleNum="dsComment"           color="#008000" selColor="#999999" bold="0" italic="0" />\r
+                       <itemData name="CF Comment" defStyleNum="dsComment"                     color="#ff9900" selColor="#999999" bold="0" italic="0" />\r
+                       <itemData name="Script Comment" defStyleNum="dsComment"         color="#ff9900" selColor="#999999" bold="0" italic="0" />\r
+                       <itemData name="CF Tags" defStyleNum="dsNormal"                         color="#800000" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Custom Tags" defStyleNum="dsNormal"                     color="#cc6666" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="CFX Tags" defStyleNum="dsNormal"                        color="#008000" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Numbers" defStyleNum="dsNormal"                         color="#0000ff" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="HTML Entities" defStyleNum="dsNormal"           color="#000000" selColor="#ffffff" bold="1" italic="0" />\r
+                       <itemData name="Style Selectors" defStyleNum="dsNormal"         color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Style Properties" defStyleNum="dsNormal"        color="#000080" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Style Values" defStyleNum="dsNormal"            color="#ff0000" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Brackets" defStyleNum="dsNormal"                        color="#000080" selColor="#ffffff" bold="1" italic="0" />\r
+                       <itemData name="Script Numbers" defStyleNum="dsNormal"          color="#ff00ff" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Script Strings" defStyleNum="dsNormal"          color="#008080" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Script Operators" defStyleNum="dsNormal"        color="#0000ff" selColor="#ffffff" bold="0" italic="0" />\r
+                       <itemData name="Script Keywords" defStyleNum="dsNormal"         color="#0000cc" selColor="#ffffff" bold="1" italic="0" />\r
+                       <itemData name="Script Functions" defStyleNum="dsNormal"        color="#000080" selColor="#ffffff" bold="1" italic="0" />\r
+                       <itemData name="Script Objects" defStyleNum="dsNormal"          color="#0000cc" selColor="#ffffff" bold="1" italic="0" />\r
+\r
+               </itemDatas>\r
+\r
+       </highlighting>\r
+\r
+       <general>\r
+\r
+               <comments>\r
+\r
+                       <comment name="multiLine" start="&lt;!--" end="--&gt;" />\r
+                       <comment name="multiLine" start="/*" end="*/" />\r
+                       <comment name="singleLine" start="//" />\r
+\r
+               </comments>\r
+\r
+               <keywords casesensitive="0" weakDeliminator="-" />\r
+\r
+       </general>\r
+\r
+</language>\r
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE language SYSTEM "language.dtd">\r
+<!-- Author: Werner Braun <wb@o3-software.de> -->\r
+<!-- 29.05.2003 wb mailed to the kate-team (cullmann) -->\r
+<!-- 23.05.2003 wb added *.bro File-Type for GPCP Browser output-->\r
+<!-- 09.05.2003 wb nested comments allowed (maximum two level nesting) -->\r
+<!-- 07.04.2003 wb IN Problem solved -->\r
+<!-- 06.05.2003 wb NEW without ( -->\r
+<!-- 22.04.2003 wb Minor bugfixes -->\r
+<!-- 19.04.2003 wb Some more Enhancements -->\r
+<!-- 18.04.2003 wb Enhancenment for Maior / Minor Comments and Full / ReadOnly Exports, Folds for Procedures, Records, Comments -->\r
+<!-- 17.04.2003 wb Enhancements for Relation and Operators -->\r
+<language name="Component-Pascal" version="1.05" kateversion="2.1" section="Sources"\r
+          extensions="*.cp;*.bro" mimetype="text/x-component-pascal"\r
+          author="Werner Braun (wb@o3-software.de)" license="">\r
+       <highlighting>\r
+               <list name="keywords">\r
+                       <item> BEGIN </item>\r
+                       <item> BY </item>\r
+                       <item> CASE </item>\r
+                       <item> CLOSE </item>\r
+                       <item> CONST </item>\r
+                       <item> DO </item>\r
+                       <item> ELSE </item>\r
+                       <item> ELSIF </item>\r
+                       <item> END </item>\r
+                       <item> FOR </item>\r
+                       <item> IF </item>\r
+                       <item> IMPORT </item>\r
+                       <item> LOOP </item>\r
+                       <item> MODULE </item>\r
+                       <item> NEW </item>\r
+                       <item> OF </item>\r
+                       <item> OUT </item>\r
+                       <item> PROCEDURE </item>\r
+                       <item> REPEAT </item>\r
+                       <item> THEN </item>\r
+                       <item> TO </item>\r
+                       <item> TYPE </item>\r
+                       <item> UNTIL </item>\r
+                       <item> VAR </item>\r
+                       <item> WHILE </item>\r
+                       <item> WITH </item>\r
+               </list>\r
+               <list name="exits">\r
+                       <item> ASSERT </item>\r
+                       <item> EXIT </item>\r
+                       <item> HALT </item>\r
+                       <item> RETURN </item>\r
+               </list>\r
+               <list name="types">\r
+                       <item> ANYPTR </item>\r
+                       <item> ANYREC </item>\r
+                       <item> ARRAY </item>\r
+                       <item> BOOLEAN </item>\r
+                       <item> SHORTCHAR </item>\r
+                       <item> CHAR </item>\r
+                       <item> BYTE </item>\r
+                       <item> SHORTINT </item>\r
+                       <item> INTEGER </item>\r
+                       <item> LONGINT </item>\r
+                       <item> POINTER </item>\r
+                       <item> RECORD </item>\r
+                       <item> SHORTREAL </item>\r
+                       <item> REAL </item>\r
+                       <item> SET </item>\r
+               </list>\r
+               <list name="attributes">\r
+                       <item> ABSTRACT </item>\r
+                       <item> EMPTY </item>\r
+                       <item> EXTENSIBLE </item>\r
+                       <item> LIMITED </item>\r
+               </list>\r
+               <list name="builtins">\r
+                       <item> ABS </item>\r
+                       <item> ASH </item>\r
+                       <item> BITS </item>\r
+                       <item> CAP </item>\r
+                       <item> CHR </item>\r
+                       <item> DEC </item>\r
+                       <item> ENTIER </item>\r
+                       <item> EXCL </item>\r
+                       <item> INC </item>\r
+                       <item> INCL </item>\r
+                       <item> LEN </item>\r
+                       <item> LONG </item>\r
+                       <item> MAX </item>\r
+                       <item> MIN </item>\r
+                       <item> ODD </item>\r
+                       <item> ORD </item>\r
+                       <item> SHORT </item>\r
+                       <item> SIZE </item>\r
+               </list>\r
+               <list name="specials">\r
+                       <item> FALSE </item>\r
+                       <item> INF </item>\r
+                       <item> NIL </item>\r
+                       <item> TRUE </item>\r
+               </list>\r
+               <contexts>\r
+                       <context attribute="Normal Text" lineEndContext="#stay" name="Normal">\r
+                               <StringDetect attribute="CommentMaior" context="Comment1" String="(**" beginRegion="Comment"/>\r
+                               <Detect2Chars attribute="CommentMinor" context="Comment2" char="(" char1="*" beginRegion="Comment"/>\r
+                               <DetectChar attribute="String" context="String1" char="&quot;" />\r
+                               <DetectChar attribute="String" context="String2" char="'" />\r
+                               <RegExpr attribute="Keyword" context="#stay" String="PROCEDURE\s" beginRegion="Proc"/>\r
+                               <RegExpr attribute="Normal Text" context="#stay" String="ABSTRACT;|EMPTY;|END\s*[A-Za-z][A-Za-z0-9_]*\;" endRegion="Proc"/>\r
+                               <RegExpr attribute="Type" context="#stay" String="RECORD" beginRegion="Rec"/>\r
+                               <RegExpr attribute="Keyword" context="#stay" String="END" endRegion="Rec"/>\r
+                               <StringDetect attribute="MemAlloc" context="#stay" String="NEW"/>\r
+                               <keyword attribute="Keyword" context="#stay" String="keywords"/>\r
+                               <keyword attribute="Exit" context="#stay" String="exits"/>\r
+                               <keyword attribute="Type" context="#stay" String="types"/>\r
+                               <keyword attribute="Attribute" context="#stay" String="attributes"/>\r
+                               <keyword attribute="Builtin" context="#stay" String="builtins"/>\r
+                               <keyword attribute="SpecialValues" context="#stay" String="specials"/>\r
+                               <RegExpr attribute="Integer" context="#stay" String="\s[\+|\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))"/>\r
+                               <Float attribute="Float" context="#stay"/>\r
+                               <RegExpr attribute="Char" context="#stay" String="\s[0-9][0-9A-F]*X"/>\r
+                               <RegExpr attribute="ExportFull" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\*"/>\r
+                               <RegExpr attribute="ExportReadOnly" context="#stay" String="[A-Za-z][A-Za-z0-9_]*\-"/>\r
+                               <RegExpr attribute="Relation" context="#stay" String="\s(=|#|&lt;|&lt;=|&gt;|&gt;=|IN\s|IS)"/>\r
+                               <RegExpr attribute="Operator" context="#stay" String="\s(\+|\-|OR|\*|/|DIV|MOD|\&amp;)"/>\r
+                       </context>\r
+                       <context attribute="CommentMaior" lineEndContext="#stay" name="Comment1">\r
+                               <Detect2Chars attribute="CommentMaior" context="#pop" char="*" char1=")" endRegion="Comment"/>\r
+                               <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>\r
+                       </context>\r
+                       <context attribute="CommentMinor" lineEndContext="#stay" name="Comment2">\r
+                               <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")" endRegion="Comment"/>\r
+                               <Detect2Chars attribute="CommentMinor" context="CommentN" char="(" char1="*"/>\r
+                       </context>\r
+                       <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN">\r
+                               <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>\r
+                               <Detect2Chars attribute="CommentMinor" context="CommentN2" char="(" char1="*"/>\r
+                       </context>\r
+                       <context attribute="CommentMinor" lineEndContext="#stay" name="CommentN2">\r
+                               <Detect2Chars attribute="CommentMinor" context="#pop" char="*" char1=")"/>\r
+                       </context>\r
+                       <context attribute="String" lineEndContext="#stay" name="String1">\r
+                               <DetectChar attribute="String" context="#pop" char="&quot;"/>\r
+                       </context>\r
+                       <context attribute="String" lineEndContext="#stay" name="String2">\r
+                               <DetectChar attribute="String" context="#pop" char="'"/>\r
+                       </context>\r
+               </contexts>\r
+               <itemDatas>\r
+                       <itemData name="Normal Text" defStyleNum="dsNormal" />\r
+                       <itemData name="CommentMaior" defStyleNum="dsComment" />\r
+                       <itemData name="CommentMinor" defStyleNum="dsComment" />\r
+                       <itemData name="String" defStyleNum="dsString" />\r
+                       <itemData name="Keyword" defStyleNum="dsKeyword" />\r
+                       <itemData name="MemAlloc" defStyleNum="dsKeyword" />\r
+                       <itemData name="Exit" defStyleNum="dsKeyword"/>\r
+                       <itemData name="Type" defStyleNum="dsDataType"/>\r
+                       <itemData name="Attribute" defStyleNum="dsOthers"/>\r
+                       <itemData name="Builtin" defStyleNum="dsNormal"/>\r
+                       <itemData name="Integer" defStyleNum="dsBaseN"/>\r
+                       <itemData name="Float" defStyleNum="dsFloat" />\r
+                       <itemData name="Char" defStyleNum="dsChar" />\r
+                       <itemData name="SpecialValues" defStyleNum="dsDecVal"/>\r
+                       <itemData name="ExportFull" defStyleNum="dsOthers"/>\r
+                       <itemData name="ExportReadOnly" defStyleNum="dsOthers"/>\r
+                       <itemData name="Relation" defStyleNum="dsNormal"/>\r
+                       <itemData name="Operator" defStyleNum="dsNormal"/>\r
+               </itemDatas>\r
+       </highlighting>\r
+       <general>\r
+               <keywords casesensitive="1" />\r
+               <comments>\r
+                       <comment name="multiLine" start="(*" end="*)" />\r
+               </comments>\r
+       </general>\r
+</language>\r
+\r
diff --git a/tests/support.pyc b/tests/support.pyc
deleted file mode 100644 (file)
index 8aff198..0000000
Binary files a/tests/support.pyc and /dev/null differ
index 44a656b44fdce44a075fac39adcce17ea6a0bb1d..b51d9b555d245ad2443018d912941875d487f995 100644 (file)
@@ -8,8 +8,8 @@
 """
 
 import os
-import unittest
 import random
+import unittest
 
 from pygments import lexers, formatters, filters, format
 from pygments.token import _TokenType, Text
@@ -25,63 +25,192 @@ test_content = [chr(i) for i in xrange(33, 128)] * 5
 random.shuffle(test_content)
 test_content = ''.join(test_content) + '\n'
 
-class LexersTest(unittest.TestCase):
-
-    def test_import_all(self):
-        # instantiate every lexer, to see if the token type defs are correct
-        for x in lexers.LEXERS.keys():
-            c = getattr(lexers, x)()
-
-    def test_lexer_classes(self):
-        a = self.assert_
-        ae = self.assertEquals
-        # test that every lexer class has the correct public API
-        for lexer in lexers._iter_lexerclasses():
-            a(type(lexer.name) is str)
-            for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
-                a(hasattr(lexer, attr))
-                a(type(getattr(lexer, attr)) is list, "%s: %s attribute wrong" %
-                                                      (lexer, attr))
-            result = lexer.analyse_text("abc")
-            a(isinstance(result, float) and 0.0 <= result <= 1.0)
-
-            inst = lexer(opt1="val1", opt2="val2")
-            if issubclass(lexer, RegexLexer):
-                if not hasattr(lexer, '_tokens'):
-                    # if there's no "_tokens", the lexer has to be one with
-                    # multiple tokendef variants
-                    a(lexer.token_variants)
-                    for variant in lexer.tokens:
-                        a('root' in lexer.tokens[variant])
-                else:
-                    a('root' in lexer._tokens, '%s has no root state' % lexer)
-
-            tokens = list(inst.get_tokens(test_content))
-            txt = ""
-            for token in tokens:
-                a(isinstance(token, tuple))
-                a(isinstance(token[0], _TokenType))
-                if isinstance(token[1], str):
-                    print repr(token[1])
-                a(isinstance(token[1], unicode))
-                txt += token[1]
-            ae(txt, test_content, "%s lexer roundtrip failed: %r != %r" %
-                    (lexer.name, test_content, txt))
-
-    def test_get_lexers(self):
-        a = self.assert_
-        ae = self.assertEquals
-        # test that the lexers functions work
-
-        for func, args in [(lexers.get_lexer_by_name, ("python",)),
-                           (lexers.get_lexer_for_filename, ("test.py",)),
-                           (lexers.get_lexer_for_mimetype, ("text/x-python",)),
-                           (lexers.guess_lexer, ("#!/usr/bin/python -O\nprint",)),
-                           (lexers.guess_lexer_for_filename, ("a.py", "<%= @foo %>"))
-                           ]:
-            x = func(opt="val", *args)
-            a(isinstance(x, lexers.PythonLexer))
-            ae(x.options["opt"], "val")
+
+def test_lexer_import_all():
+    # instantiate every lexer, to see if the token type defs are correct
+    for x in lexers.LEXERS.keys():
+        c = getattr(lexers, x)()
+
+
+def test_lexer_classes():
+    # test that every lexer class has the correct public API
+    def verify(cls):
+        assert type(cls.name) is str
+        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
+            assert hasattr(cls, attr)
+            assert type(getattr(cls, attr)) is list, \
+                   "%s: %s attribute wrong" % (cls, attr)
+        result = cls.analyse_text("abc")
+        assert isinstance(result, float) and 0.0 <= result <= 1.0
+
+        inst = cls(opt1="val1", opt2="val2")
+        if issubclass(cls, RegexLexer):
+            if not hasattr(cls, '_tokens'):
+                # if there's no "_tokens", the lexer has to be one with
+                # multiple tokendef variants
+                assert cls.token_variants
+                for variant in cls.tokens:
+                    assert 'root' in cls.tokens[variant]
+            else:
+                assert 'root' in cls._tokens, \
+                       '%s has no root state' % cls
+
+        tokens = list(inst.get_tokens(test_content))
+        txt = ""
+        for token in tokens:
+            assert isinstance(token, tuple)
+            assert isinstance(token[0], _TokenType)
+            if isinstance(token[1], str):
+                print repr(token[1])
+            assert isinstance(token[1], unicode)
+            txt += token[1]
+        assert txt == test_content, "%s lexer roundtrip failed: %r != %r" % \
+               (cls.name, test_content, txt)
+
+    for lexer in lexers._iter_lexerclasses():
+        yield verify, lexer
+
+
+def test_lexer_options():
+    # test that the basic options work
+    def ensure(tokens, output):
+        concatenated = ''.join(token[1] for token in tokens)
+        assert concatenated == output, \
+               '%s: %r != %r' % (lexer, concatenated, output)
+    def verify(cls):
+        inst = cls(stripnl=False)
+        ensure(inst.get_tokens('a\nb'), 'a\nb\n')
+        ensure(inst.get_tokens('\n\n\n'), '\n\n\n')
+        inst = cls(stripall=True)
+        ensure(inst.get_tokens('   \n  b\n\n\n'), 'b\n')
+        # some lexers require full lines in input
+        if cls.__name__ not in (
+            'PythonConsoleLexer', 'RConsoleLexer', 'RubyConsoleLexer',
+            'SqliteConsoleLexer', 'MatlabSessionLexer', 'ErlangShellLexer',
+            'BashSessionLexer', 'LiterateHaskellLexer'):
+            inst = cls(ensurenl=False)
+            ensure(inst.get_tokens('a\nb'), 'a\nb')
+            inst = cls(ensurenl=False, stripall=True)
+            ensure(inst.get_tokens('a\nb\n\n'), 'a\nb')
+
+    for lexer in lexers._iter_lexerclasses():
+        if lexer.__name__ == 'RawTokenLexer':
+            # this one is special
+            continue
+        yield verify, lexer
+
+
+def test_get_lexers():
+    # test that the lexers functions work
+    def verify(func, args):
+        x = func(opt='val', *args)
+        assert isinstance(x, lexers.PythonLexer)
+        assert x.options["opt"] == "val"
+
+    for func, args in [(lexers.get_lexer_by_name, ("python",)),
+                       (lexers.get_lexer_for_filename, ("test.py",)),
+                       (lexers.get_lexer_for_mimetype, ("text/x-python",)),
+                       (lexers.guess_lexer, ("#!/usr/bin/python -O\nprint",)),
+                       (lexers.guess_lexer_for_filename, ("a.py", "<%= @foo %>"))
+                       ]:
+        yield verify, func, args
+
+
+def test_formatter_public_api():
+    ts = list(lexers.PythonLexer().get_tokens("def f(): pass"))
+    out = StringIO()
+    # test that every formatter class has the correct public API
+    def verify(formatter, info):
+        assert len(info) == 4
+        assert info[0], "missing formatter name"
+        assert info[1], "missing formatter aliases"
+        assert info[3], "missing formatter docstring"
+
+        if formatter.name == 'Raw tokens':
+            # will not work with Unicode output file
+            return
+
+        try:
+            inst = formatter(opt1="val1")
+        except (ImportError, FontNotFound):
+            return
+        try:
+            inst.get_style_defs()
+        except NotImplementedError:
+            # may be raised by formatters for which it doesn't make sense
+            pass
+        inst.format(ts, out)
+
+    for formatter, info in formatters.FORMATTERS.iteritems():
+        yield verify, formatter, info
+
+def test_formatter_encodings():
+    from pygments.formatters import HtmlFormatter
+
+    # unicode output
+    fmt = HtmlFormatter()
+    tokens = [(Text, u"ä")]
+    out = format(tokens, fmt)
+    assert type(out) is unicode
+    assert u"ä" in out
+
+    # encoding option
+    fmt = HtmlFormatter(encoding="latin1")
+    tokens = [(Text, u"ä")]
+    assert u"ä".encode("latin1") in format(tokens, fmt)
+
+    # encoding and outencoding option
+    fmt = HtmlFormatter(encoding="latin1", outencoding="utf8")
+    tokens = [(Text, u"ä")]
+    assert u"ä".encode("utf8") in format(tokens, fmt)
+
+
+def test_formatter_unicode_handling():
+    # test that the formatter supports encoding and Unicode
+    tokens = list(lexers.PythonLexer(encoding='utf-8').
+                  get_tokens("def f(): 'ä'"))
+
+    def verify(formatter):
+        try:
+            inst = formatter(encoding=None)
+        except (ImportError, FontNotFound):
+            # some dependency or font not installed
+            return
+
+        if formatter.name != 'Raw tokens':
+            out = format(tokens, inst)
+            if formatter.unicodeoutput:
+                assert type(out) is unicode
+
+            inst = formatter(encoding='utf-8')
+            out = format(tokens, inst)
+            assert type(out) is bytes, '%s: %r' % (formatter, out)
+            # Cannot test for encoding, since formatters may have to escape
+            # non-ASCII characters.
+        else:
+            inst = formatter()
+            out = format(tokens, inst)
+            assert type(out) is bytes, '%s: %r' % (formatter, out)
+    
+    for formatter, info in formatters.FORMATTERS.iteritems():
+        yield verify, formatter
+
+
+def test_get_formatters():
+    # test that the formatters functions work
+    x = formatters.get_formatter_by_name("html", opt="val")
+    assert isinstance(x, formatters.HtmlFormatter)
+    assert x.options["opt"] == "val"
+
+    x = formatters.get_formatter_for_filename("a.html", opt="val")
+    assert isinstance(x, formatters.HtmlFormatter)
+    assert x.options["opt"] == "val"
+
+
+def test_styles():
+    # minimal style test
+    from pygments.formatters import HtmlFormatter
+    fmt = HtmlFormatter(style="pastie")
 
 
 class FiltersTest(unittest.TestCase):
@@ -136,95 +265,3 @@ class FiltersTest(unittest.TestCase):
         text = u'# DEBUG: text'
         tokens = list(lx.get_tokens(text))
         self.assertEquals('# DEBUG: text', tokens[0][1])
-
-
-class FormattersTest(unittest.TestCase):
-
-    def test_public_api(self):
-        a = self.assert_
-        ae = self.assertEquals
-        ts = list(lexers.PythonLexer().get_tokens("def f(): pass"))
-        out = StringIO()
-        # test that every formatter class has the correct public API
-        for formatter, info in formatters.FORMATTERS.iteritems():
-            a(len(info) == 4)
-            a(info[0], "missing formatter name") # name
-            a(info[1], "missing formatter aliases") # aliases
-            a(info[3], "missing formatter docstring") # doc
-
-            if formatter.name == 'Raw tokens':
-                # will not work with Unicode output file
-                continue
-
-            try:
-                inst = formatter(opt1="val1")
-            except (ImportError, FontNotFound):
-                continue
-            try:
-                inst.get_style_defs()
-            except NotImplementedError:
-                # may be raised by formatters for which it doesn't make sense
-                pass
-            inst.format(ts, out)
-
-    def test_encodings(self):
-        from pygments.formatters import HtmlFormatter
-
-        # unicode output
-        fmt = HtmlFormatter()
-        tokens = [(Text, u"ä")]
-        out = format(tokens, fmt)
-        self.assert_(type(out) is unicode)
-        self.assert_(u"ä" in out)
-
-        # encoding option
-        fmt = HtmlFormatter(encoding="latin1")
-        tokens = [(Text, u"ä")]
-        self.assert_(u"ä".encode("latin1") in format(tokens, fmt))
-
-        # encoding and outencoding option
-        fmt = HtmlFormatter(encoding="latin1", outencoding="utf8")
-        tokens = [(Text, u"ä")]
-        self.assert_(u"ä".encode("utf8") in format(tokens, fmt))
-
-    def test_styles(self):
-        from pygments.formatters import HtmlFormatter
-        fmt = HtmlFormatter(style="pastie")
-
-    def test_unicode_handling(self):
-        # test that the formatter supports encoding and Unicode
-        tokens = list(lexers.PythonLexer(encoding='utf-8').
-                      get_tokens("def f(): 'ä'"))
-        for formatter, info in formatters.FORMATTERS.iteritems():
-            try:
-                inst = formatter(encoding=None)
-            except (ImportError, FontNotFound):
-                # some dependency or font not installed
-                continue
-
-            if formatter.name != 'Raw tokens':
-                out = format(tokens, inst)
-                if formatter.unicodeoutput:
-                    self.assert_(type(out) is unicode)
-
-                inst = formatter(encoding='utf-8')
-                out = format(tokens, inst)
-                self.assert_(type(out) is bytes, '%s: %r' % (formatter, out))
-                # Cannot test for encoding, since formatters may have to escape
-                # non-ASCII characters.
-            else:
-                inst = formatter()
-                out = format(tokens, inst)
-                self.assert_(type(out) is bytes, '%s: %r' % (formatter, out))
-
-    def test_get_formatters(self):
-        a = self.assert_
-        ae = self.assertEquals
-        # test that the formatters functions work
-        x = formatters.get_formatter_by_name("html", opt="val")
-        a(isinstance(x, formatters.HtmlFormatter))
-        ae(x.options["opt"], "val")
-
-        x = formatters.get_formatter_for_filename("a.html", opt="val")
-        a(isinstance(x, formatters.HtmlFormatter))
-        ae(x.options["opt"], "val")
diff --git a/tests/test_basic_api.pyc b/tests/test_basic_api.pyc
deleted file mode 100644 (file)
index 7369726..0000000
Binary files a/tests/test_basic_api.pyc and /dev/null differ
diff --git a/tests/test_clexer.pyc b/tests/test_clexer.pyc
deleted file mode 100644 (file)
index 57e6655..0000000
Binary files a/tests/test_clexer.pyc and /dev/null differ
diff --git a/tests/test_cmdline.pyc b/tests/test_cmdline.pyc
deleted file mode 100644 (file)
index e44c808..0000000
Binary files a/tests/test_cmdline.pyc and /dev/null differ
index d56eb7c30117a31e5f4355b7f10d155fb58d2567..691ae92a75edac6e2f2770f5e41080feb1ee7498 100644 (file)
@@ -8,9 +8,7 @@
 """
 
 import os
-import unittest
 
-from pygments import highlight
 from pygments.lexers import get_lexer_for_filename, get_lexer_by_name
 from pygments.token import Error
 from pygments.util import ClassNotFound, b
diff --git a/tests/test_examplefiles.pyc b/tests/test_examplefiles.pyc
deleted file mode 100644 (file)
index 9e7f25c..0000000
Binary files a/tests/test_examplefiles.pyc and /dev/null differ
index 9ff593f9c1fd6460e0751a703b3563e3d5c623ad..ae54b9190ecff7731f32ea1d944fd2cf6c19eb28 100644 (file)
@@ -12,17 +12,19 @@ import re
 import unittest
 import StringIO
 import tempfile
-from os.path import join, dirname, isfile, abspath
+from os.path import join, dirname, isfile
 
 from pygments.lexers import PythonLexer
 from pygments.formatters import HtmlFormatter, NullFormatter
 from pygments.formatters.html import escape_html
+from pygments.util import uni_open
 
 import support
 
 TESTFILE, TESTDIR = support.location(__file__)
 
-tokensource = list(PythonLexer(encoding='utf-8').get_tokens(open(TESTFILE).read()))
+tokensource = list(PythonLexer().get_tokens(
+    uni_open(TESTFILE, encoding='utf-8').read()))
 
 
 class HtmlFormatterTest(unittest.TestCase):
diff --git a/tests/test_html_formatter.pyc b/tests/test_html_formatter.pyc
deleted file mode 100644 (file)
index 4776a45..0000000
Binary files a/tests/test_html_formatter.pyc and /dev/null differ
diff --git a/tests/test_latex_formatter.pyc b/tests/test_latex_formatter.pyc
deleted file mode 100644 (file)
index de8f73d..0000000
Binary files a/tests/test_latex_formatter.pyc and /dev/null differ
diff --git a/tests/test_regexlexer.pyc b/tests/test_regexlexer.pyc
deleted file mode 100644 (file)
index 2bcf10d..0000000
Binary files a/tests/test_regexlexer.pyc and /dev/null differ
diff --git a/tests/test_token.pyc b/tests/test_token.pyc
deleted file mode 100644 (file)
index 30c8d69..0000000
Binary files a/tests/test_token.pyc and /dev/null differ
diff --git a/tests/test_using_api.pyc b/tests/test_using_api.pyc
deleted file mode 100644 (file)
index d070c23..0000000
Binary files a/tests/test_using_api.pyc and /dev/null differ
diff --git a/tests/test_util.pyc b/tests/test_util.pyc
deleted file mode 100644 (file)
index ea024d1..0000000
Binary files a/tests/test_util.pyc and /dev/null differ