Imported Upstream version 1.5 upstream/1.5
authorJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:14:55 +0000 (12:14 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:14:55 +0000 (12:14 +0900)
172 files changed:
AUTHORS
CHANGES
LICENSE
Makefile
PKG-INFO
Pygments.egg-info/PKG-INFO
Pygments.egg-info/SOURCES.txt
TODO
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/generate.py [changed mode: 0644->0755]
docs/src/lexerdevelopment.txt
docs/src/plugins.txt
docs/src/styles.txt
docs/src/tokens.txt
external/markdown-processor.py
external/moin-parser.py
external/rst-directive-old.py
external/rst-directive.py
pygments/__init__.py
pygments/cmdline.py
pygments/console.py
pygments/filter.py
pygments/filters/__init__.py
pygments/formatter.py
pygments/formatters/__init__.py
pygments/formatters/_mapping.py
pygments/formatters/bbcode.py
pygments/formatters/html.py
pygments/formatters/img.py
pygments/formatters/latex.py
pygments/formatters/other.py
pygments/formatters/rtf.py
pygments/formatters/svg.py
pygments/formatters/terminal.py
pygments/formatters/terminal256.py
pygments/lexer.py
pygments/lexers/__init__.py
pygments/lexers/_asybuiltins.py
pygments/lexers/_clbuiltins.py
pygments/lexers/_luabuiltins.py
pygments/lexers/_mapping.py
pygments/lexers/_phpbuiltins.py
pygments/lexers/_postgres_builtins.py [new file with mode: 0644]
pygments/lexers/_scilab_builtins.py [new file with mode: 0644]
pygments/lexers/_vimbuiltins.py
pygments/lexers/agile.py
pygments/lexers/asm.py
pygments/lexers/compiled.py
pygments/lexers/dotnet.py
pygments/lexers/functional.py
pygments/lexers/hdl.py
pygments/lexers/jvm.py [new file with mode: 0644]
pygments/lexers/math.py
pygments/lexers/other.py
pygments/lexers/parsers.py
pygments/lexers/shell.py [new file with mode: 0644]
pygments/lexers/special.py
pygments/lexers/sql.py [new file with mode: 0644]
pygments/lexers/templates.py
pygments/lexers/text.py
pygments/lexers/web.py
pygments/plugin.py
pygments/scanner.py
pygments/style.py
pygments/styles/__init__.py
pygments/styles/autumn.py
pygments/styles/borland.py
pygments/styles/bw.py
pygments/styles/colorful.py
pygments/styles/default.py
pygments/styles/emacs.py
pygments/styles/friendly.py
pygments/styles/fruity.py
pygments/styles/manni.py
pygments/styles/monokai.py
pygments/styles/murphy.py
pygments/styles/native.py
pygments/styles/pastie.py
pygments/styles/perldoc.py
pygments/styles/rrt.py [new file with mode: 0644]
pygments/styles/tango.py
pygments/styles/trac.py
pygments/styles/vim.py
pygments/styles/vs.py
pygments/token.py
pygments/unistring.py
pygments/util.py
scripts/check_sources.py
scripts/find_codetags.py
scripts/find_error.py
scripts/get_vimkw.py
setup.py
tests/examplefiles/antlr_throws [new file with mode: 0644]
tests/examplefiles/as3_test.as
tests/examplefiles/classes.dylan
tests/examplefiles/coq_RelationClasses [new file with mode: 0644]
tests/examplefiles/example.cls [new file with mode: 0644]
tests/examplefiles/example.gs [new file with mode: 0644]
tests/examplefiles/example.gst [new file with mode: 0644]
tests/examplefiles/example.kt [new file with mode: 0644]
tests/examplefiles/example.moon [new file with mode: 0644]
tests/examplefiles/example.nim [new file with mode: 0644]
tests/examplefiles/example.p [new file with mode: 0644]
tests/examplefiles/example.sh-session
tests/examplefiles/example.sml [new file with mode: 0644]
tests/examplefiles/example.snobol [new file with mode: 0644]
tests/examplefiles/example.tea [new file with mode: 0644]
tests/examplefiles/example.u [new file with mode: 0644]
tests/examplefiles/example_elixir.ex [new file with mode: 0644]
tests/examplefiles/example_file.fy [new file with mode: 0644]
tests/examplefiles/foo.sce [new file with mode: 0644]
tests/examplefiles/function.mu [new file with mode: 0644]
tests/examplefiles/http_request_example [new file with mode: 0644]
tests/examplefiles/http_response_example [new file with mode: 0644]
tests/examplefiles/intsyn.fun [new file with mode: 0644]
tests/examplefiles/intsyn.sig [new file with mode: 0644]
tests/examplefiles/irc.lsp [new file with mode: 0755]
tests/examplefiles/markdown.lsp [new file with mode: 0755]
tests/examplefiles/nemerle_sample.n [new file with mode: 0644]
tests/examplefiles/objc_example.m
tests/examplefiles/postgresql_test.txt [new file with mode: 0644]
tests/examplefiles/psql_session.txt [new file with mode: 0644]
tests/examplefiles/reversi.lsp [new file with mode: 0644]
tests/examplefiles/scilab.sci [new file with mode: 0644]
tests/examplefiles/squid.conf
tests/examplefiles/test.awk [new file with mode: 0644]
tests/examplefiles/test.bro [new file with mode: 0644]
tests/examplefiles/test.cs
tests/examplefiles/test.dart [new file with mode: 0644]
tests/examplefiles/test.dtd [new file with mode: 0644]
tests/examplefiles/test.ec [new file with mode: 0644]
tests/examplefiles/test.ecl [new file with mode: 0644]
tests/examplefiles/test.eh [new file with mode: 0644]
tests/examplefiles/test.fan [new file with mode: 0755]
tests/examplefiles/test.groovy [new file with mode: 0644]
tests/examplefiles/test.nim [new file with mode: 0644]
tests/examplefiles/test.ps1 [new file with mode: 0644]
tests/examplefiles/test.pypylog [new file with mode: 0644]
tests/examplefiles/test.rb
tests/examplefiles/test.vhdl [new file with mode: 0644]
tests/old_run.py
tests/run.py
tests/test_basic_api.py
tests/test_clexer.py
tests/test_cmdline.py
tests/test_examplefiles.py
tests/test_html_formatter.py
tests/test_latex_formatter.py
tests/test_perllexer.py [new file with mode: 0644]
tests/test_regexlexer.py
tests/test_token.py
tests/test_using_api.py
tests/test_util.py

diff --git a/AUTHORS b/AUTHORS
index 07235bdbdbca0955e9e14f6cb3067437352866ef..83bbee57b4ecaa672ef1d269343fa0256ad6fea5 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,42 +16,60 @@ Other contributors, listed alphabetically, are:
 * Paul Baumgart, 280 North, Inc. -- Objective-J lexer
 * Michael Bayer -- Myghty lexers
 * John Benediktsson -- Factor lexer
+* Christopher Bertels -- Fancy lexer
 * Jarrett Billingsley -- MiniD lexer
 * Adam Blinkinsop -- Haskell, Redcode lexers
 * Frits van Bommel -- assembler lexers
 * Pierre Bourdon -- bugfixes
 * Hiram Chirino -- Scaml and Jade lexers
+* Leaf Corcoran -- MoonScript lexer
 * Christopher Creutzig -- MuPAD lexer
 * Pete Curry -- bugfixes
 * Owen Durni -- haXe lexer
 * Nick Efford -- Python 3 lexer
 * Artem Egorkine -- terminal256 formatter
 * James H. Fisher -- PostScript lexer
-* Naveen Garg - Autohotkey lexer
+* Carlos Galdino -- Elixir and Elixir Console lexers
+* Naveen Garg -- Autohotkey lexer
 * Laurent Gautier -- R/S lexer
+* Alex Gaynor -- PyPy log lexer
+* Bertrand Goetzmann -- Groovy lexer
 * Krzysiek Goj -- Scala lexer
 * Matt Good -- Genshi, Cheetah lexers
 * Patrick Gotthardt -- PHP namespaces support
 * Olivier Guibe -- Asymptote lexer
+* Martin Harriman -- SNOBOL lexer
 * Matthew Harrison -- SVG formatter
 * Steven Hazel -- Tcl lexer
 * Aslak Hellesøy -- Gherkin lexer
+* Jordi Gutiérrez Hermoso -- Octave lexer
 * David Hess, Fish Software, Inc. -- Objective-J lexer
 * Varun Hiremath -- Debian control lexer
 * Ben Hollis -- Mason lexer
 * Tim Howard -- BlitzMax lexer
+* Ivan Inozemtsev -- Fantom lexer
+* Brian R. Jackson -- Tea lexer
 * Dennis Kaarsemaker -- sources.list lexer
+* Igor Kalnitsky -- vhdl lexer
+* Adam Koprowski -- Opa lexer
 * Benjamin Kowarsch -- Modula-2 lexer
 * Marek Kubica -- Scheme lexer
 * Jochen Kupperschmidt -- Markdown processor
 * Gerd Kurzbach -- Modelica lexer
+* Olov Lassus -- Dart lexer
+* Sylvestre Ledru -- Scilab lexer
 * Mark Lee -- Vala lexer
 * Ben Mabey -- Gherkin lexer
 * Simone Margaritelli -- Hybris lexer
 * Kirk McDonald -- D lexer
+* Gordon McGregor -- SystemVerilog lexer
 * Stephen McKamey -- Duel/JBST lexer
+* Brian McKenna -- F# lexer
 * Lukas Meuser -- BBCode formatter, Lua lexer
+* Hong Minhee -- HTTP lexer
+* Michael Mior -- Awk lexer
 * Paulo Moura -- Logtalk lexer
+* Mher Movsisyan -- DTD lexer
 * Ana Nelson -- Ragel, ANTLR, R console lexers
 * Nam T. Nguyen -- Monokai style
 * Jesper Noehr -- HTML formatter "anchorlinenos"
@@ -60,7 +78,10 @@ Other contributors, listed alphabetically, are:
 * Jon Parise -- Protocol buffers lexer
 * Ronny Pfannschmidt -- BBCode lexer
 * Benjamin Peterson -- Test suite refactoring
+* Dominik Picheta -- Nimrod lexer
+* Clément Prévost -- UrbiScript lexer
 * Justin Reidy -- MXML lexer
+* Norman Richards -- JSON lexer
 * Lubomir Rintel -- GoodData MAQL and CL lexers
 * Andre Roberge -- Tango style
 * Konrad Rudolph -- LaTeX formatter enhancements
@@ -71,15 +92,23 @@ Other contributors, listed alphabetically, are:
 * Ken Schutte -- Matlab lexers
 * Tassilo Schweyer -- Io, MOOCode lexers
 * Joerg Sieker -- ABAP lexer
+* Robert Simmons -- Standard ML lexer
 * Kirill Simonov -- YAML lexer
 * Steve Spigarelli -- XQuery lexer
+* Jerome St-Louis -- eC lexer
+* James Strachan -- Kotlin lexer
 * Tiberius Teng -- default style overhaul
 * Jeremy Thurgood -- Erlang, Squid config lexers
 * Erick Tryzelaar -- Felix lexer
+* Daniele Varrazzo -- PostgreSQL lexers
+* Abe Voelker -- OpenEdge ABL lexer
 * Whitney Young -- ObjectiveC lexer
+* Matthias Vallentin -- Bro lexer
 * Nathan Weizenbaum -- Haml and Sass lexers
 * Dietmar Winkler -- Modelica lexer
 * Nils Winter -- Smalltalk lexer
 * Davy Wybiral -- Clojure lexer
+* Diego Zamboni -- CFengine3 lexer
+* Alex Zimin -- Nemerle lexer
 
 Many thanks for all contributions!
diff --git a/CHANGES b/CHANGES
index 60090be1ef8e43847b482449624ce2ac1a574743..56778f8e9a37b8f6a6d706ad5ba797f740c05fe6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,9 +4,91 @@ Pygments changelog
 Issue numbers refer to the tracker at
 http://bitbucket.org/birkenfeld/pygments-main/issues.
 
+Version 1.5
+-----------
+(codename Zeitdilatation, released Mar 10, 2012)
+
+- Lexers added:
+
+  * Awk (#630)
+  * Fancy (#633)
+  * PyPy Log
+  * eC
+  * Nimrod
+  * Nemerle (#667)
+  * F# (#353)
+  * Groovy (#501)
+  * PostgreSQL (#660)
+  * DTD
+  * Gosu (#634)
+  * Octave (PR#22)
+  * Standard ML (PR#14)
+  * CFengine3 (#601)
+  * Opa (PR#37)
+  * HTTP sessions (PR#42)
+  * JSON (PR#31)
+  * SNOBOL (PR#30)
+  * MoonScript (PR#43)
+  * ECL (PR#29)
+  * Urbiscript (PR#17)
+  * OpenEdge ABL (PR#27)
+  * SystemVerilog (PR#35)
+  * Coq (#734)
+  * PowerShell (#654)
+  * Dart (#715)
+  * Fantom (PR#36)
+  * Bro (PR#5)
+  * NewLISP (PR#26)
+  * VHDL (PR#45)
+  * Scilab (#740)
+  * Elixir (PR#57)
+  * Tea (PR#56)
+  * Kotlin (PR#58)
+
+- Fix Python 3 terminal highlighting with pygmentize (#691).
+
+- In the LaTeX formatter, escape special &, < and > chars (#648).
+
+- In the LaTeX formatter, fix display problems for styles with token
+  background colors (#670).
+
+- Enhancements to the Squid conf lexer (#664).
+
+- Several fixes to the reStructuredText lexer (#636).
+
+- Recognize methods in the ObjC lexer (#638).
+
+- Fix Lua "class" highlighting: it does not have classes (#665).
+
+- Fix degenerate regex in Scala lexer (#671) and highlighting bugs (#713, 708).
+
+- Fix number pattern order in Ocaml lexer (#647).
+
+- Fix generic type highlighting in ActionScript 3 (#666).
+
+- Fixes to the Clojure lexer (PR#9).
+
+- Fix degenerate regex in Nemerle lexer (#706).
+
+- Fix infinite looping in CoffeeScript lexer (#729).
+
+- Fix crashes and analysis with ObjectiveC lexer (#693, #696).
+
+- Add some Fortran 2003 keywords.
+
+- Fix Boo string regexes (#679).
+
+- Add "rrt" style (#727).
+
+- Fix infinite looping in Darcs Patch lexer.
+
+- Lots of misc fixes to character-eating bugs and ordering problems in many
+  different lexers.
+
+
 Version 1.4
 -----------
-(codename Unschärfe, released Jan 03, 2010)
+(codename Unschärfe, released Jan 03, 2011)
 
 - Lexers added:
 
@@ -269,7 +351,7 @@ Version 1.0
 
 - Added Tango style, written by Andre Roberge for the Crunchy project.
 
-- Added Python3TracebackLexer and ``python3`` option to 
+- Added Python3TracebackLexer and ``python3`` option to
   PythonConsoleLexer.
 
 - Fixed a few bugs in the Haskell lexer.
@@ -607,7 +689,7 @@ Version 0.7
 
 - Added token stream filters, and a pygmentize option to use them.
 
-- Changed behavior of `in` Operator for tokens. 
+- Changed behavior of `in` Operator for tokens.
 
 - Added mimetypes for all lexers.
 
diff --git a/LICENSE b/LICENSE
index 0ad59ecf940fb5cd1aa3be8c2eed97c52865967f..314b37105c4b1bcdb4f10bbc19907bb81db02a77 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2010 by the respective authors (see AUTHORS file).
+Copyright (c) 2006-2011 by the respective authors (see AUTHORS file).
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
index 6e81f2eeeebae55056f9da2afb2cb96414ce24c2..c89401254376ac6600d654a97d6883d0da539d1e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 #
 # Combines scripts for common tasks.
 #
-# :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+# :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
 # :license: BSD, see LICENSE for details.
 #
 
index 332c5dc4022727a8996da8df92b378573e92c674..0fec6275c5562f83a1f285bc51bc0eb97a12fa0a 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: Pygments
-Version: 1.4
+Version: 1.5
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
@@ -28,7 +28,7 @@ Description:
             .. _Pygments tip:
                http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev
         
-            :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+            :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
             :license: BSD, see LICENSE for details.
         
 Keywords: syntax highlighting
index 332c5dc4022727a8996da8df92b378573e92c674..0fec6275c5562f83a1f285bc51bc0eb97a12fa0a 100644 (file)
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: Pygments
-Version: 1.4
+Version: 1.5
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
@@ -28,7 +28,7 @@ Description:
             .. _Pygments tip:
                http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev
         
-            :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+            :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
             :license: BSD, see LICENSE for details.
         
 Keywords: syntax highlighting
index b3f065bb1880c3a7aa765b00806e6a1adc9a8c4d..6c36a84fa7069cc23498cc06207e945d67601aff 100644 (file)
@@ -91,6 +91,8 @@ pygments/lexers/_clbuiltins.py
 pygments/lexers/_luabuiltins.py
 pygments/lexers/_mapping.py
 pygments/lexers/_phpbuiltins.py
+pygments/lexers/_postgres_builtins.py
+pygments/lexers/_scilab_builtins.py
 pygments/lexers/_vimbuiltins.py
 pygments/lexers/agile.py
 pygments/lexers/asm.py
@@ -98,10 +100,13 @@ pygments/lexers/compiled.py
 pygments/lexers/dotnet.py
 pygments/lexers/functional.py
 pygments/lexers/hdl.py
+pygments/lexers/jvm.py
 pygments/lexers/math.py
 pygments/lexers/other.py
 pygments/lexers/parsers.py
+pygments/lexers/shell.py
 pygments/lexers/special.py
+pygments/lexers/sql.py
 pygments/lexers/templates.py
 pygments/lexers/text.py
 pygments/lexers/web.py
@@ -120,6 +125,7 @@ pygments/styles/murphy.py
 pygments/styles/native.py
 pygments/styles/pastie.py
 pygments/styles/perldoc.py
+pygments/styles/rrt.py
 pygments/styles/tango.py
 pygments/styles/trac.py
 pygments/styles/vim.py
@@ -142,6 +148,7 @@ tests/test_cmdline.py
 tests/test_examplefiles.py
 tests/test_html_formatter.py
 tests/test_latex_formatter.py
+tests/test_perllexer.py
 tests/test_regexlexer.py
 tests/test_token.py
 tests/test_using_api.py
@@ -169,6 +176,7 @@ tests/examplefiles/SmallCheck.hs
 tests/examplefiles/Sorting.mod
 tests/examplefiles/Sudoku.lhs
 tests/examplefiles/addressbook.proto
+tests/examplefiles/antlr_throws
 tests/examplefiles/apache2.conf
 tests/examplefiles/as3_test.as
 tests/examplefiles/as3_test2.as
@@ -182,6 +190,7 @@ tests/examplefiles/ceval.c
 tests/examplefiles/cheetah_example.html
 tests/examplefiles/classes.dylan
 tests/examplefiles/condensed_ruby.rb
+tests/examplefiles/coq_RelationClasses
 tests/examplefiles/database.pytb
 tests/examplefiles/de.MoinMoin.po
 tests/examplefiles/demo.ahk
@@ -192,22 +201,37 @@ tests/examplefiles/erl_session
 tests/examplefiles/escape_semicolon.clj
 tests/examplefiles/evil_regex.js
 tests/examplefiles/example.c
+tests/examplefiles/example.cls
 tests/examplefiles/example.cpp
+tests/examplefiles/example.gs
+tests/examplefiles/example.gst
+tests/examplefiles/example.kt
 tests/examplefiles/example.lua
 tests/examplefiles/example.moo
+tests/examplefiles/example.moon
+tests/examplefiles/example.nim
 tests/examplefiles/example.ns2
+tests/examplefiles/example.p
 tests/examplefiles/example.pas
 tests/examplefiles/example.rb
 tests/examplefiles/example.rhtml
 tests/examplefiles/example.sh-session
+tests/examplefiles/example.sml
+tests/examplefiles/example.snobol
+tests/examplefiles/example.tea
+tests/examplefiles/example.u
 tests/examplefiles/example.weechatlog
 tests/examplefiles/example.xhtml
 tests/examplefiles/example.yaml
 tests/examplefiles/example2.aspx
+tests/examplefiles/example_elixir.ex
+tests/examplefiles/example_file.fy
 tests/examplefiles/firefox.mak
 tests/examplefiles/flipflop.sv
+tests/examplefiles/foo.sce
 tests/examplefiles/format.ml
 tests/examplefiles/fucked_up.rb
+tests/examplefiles/function.mu
 tests/examplefiles/functional.rst
 tests/examplefiles/genclass.clj
 tests/examplefiles/genshi_example.xml+genshi
@@ -215,10 +239,15 @@ tests/examplefiles/genshitext_example.genshitext
 tests/examplefiles/glsl.frag
 tests/examplefiles/glsl.vert
 tests/examplefiles/html+php_faulty.php
+tests/examplefiles/http_request_example
+tests/examplefiles/http_response_example
 tests/examplefiles/import.hs
 tests/examplefiles/intro.ik
 tests/examplefiles/ints.php
+tests/examplefiles/intsyn.fun
+tests/examplefiles/intsyn.sig
 tests/examplefiles/irb_heredoc
+tests/examplefiles/irc.lsp
 tests/examplefiles/java.properties
 tests/examplefiles/jbst_example1.jbst
 tests/examplefiles/jbst_example2.jbst
@@ -227,6 +256,7 @@ tests/examplefiles/lighttpd_config.conf
 tests/examplefiles/linecontinuation.py
 tests/examplefiles/ltmain.sh
 tests/examplefiles/main.cmake
+tests/examplefiles/markdown.lsp
 tests/examplefiles/matlab_noreturn
 tests/examplefiles/matlab_sample
 tests/examplefiles/matlabsession_sample.txt
@@ -235,6 +265,7 @@ tests/examplefiles/moin_SyntaxReference.txt
 tests/examplefiles/multiline_regexes.rb
 tests/examplefiles/nasm_aoutso.asm
 tests/examplefiles/nasm_objexe.asm
+tests/examplefiles/nemerle_sample.n
 tests/examplefiles/nginx_nginx.conf
 tests/examplefiles/numbers.c
 tests/examplefiles/objc_example.m
@@ -245,7 +276,9 @@ tests/examplefiles/perl_regex-delims
 tests/examplefiles/perlfunc.1
 tests/examplefiles/phpcomplete.vim
 tests/examplefiles/pleac.in.rb
+tests/examplefiles/postgresql_test.txt
 tests/examplefiles/pppoe.applescript
+tests/examplefiles/psql_session.txt
 tests/examplefiles/py3_test.txt
 tests/examplefiles/pycon_test.pycon
 tests/examplefiles/pytb_test2.pytb
@@ -255,7 +288,9 @@ tests/examplefiles/r-console-transcript.Rout
 tests/examplefiles/ragel-cpp_rlscan
 tests/examplefiles/ragel-cpp_snippet
 tests/examplefiles/regex.js
+tests/examplefiles/reversi.lsp
 tests/examplefiles/ruby_func_def.rb
+tests/examplefiles/scilab.sci
 tests/examplefiles/sibling.prolog
 tests/examplefiles/simple.md
 tests/examplefiles/smarty_example.html
@@ -269,16 +304,25 @@ tests/examplefiles/stripheredoc.sh
 tests/examplefiles/test.R
 tests/examplefiles/test.adb
 tests/examplefiles/test.asy
+tests/examplefiles/test.awk
 tests/examplefiles/test.bas
 tests/examplefiles/test.bmx
 tests/examplefiles/test.boo
+tests/examplefiles/test.bro
 tests/examplefiles/test.cs
 tests/examplefiles/test.css
 tests/examplefiles/test.d
+tests/examplefiles/test.dart
+tests/examplefiles/test.dtd
+tests/examplefiles/test.ec
+tests/examplefiles/test.ecl
+tests/examplefiles/test.eh
 tests/examplefiles/test.erl
 tests/examplefiles/test.evoque
+tests/examplefiles/test.fan
 tests/examplefiles/test.flx
 tests/examplefiles/test.gdc
+tests/examplefiles/test.groovy
 tests/examplefiles/test.html
 tests/examplefiles/test.ini
 tests/examplefiles/test.java
@@ -287,9 +331,12 @@ tests/examplefiles/test.maql
 tests/examplefiles/test.mod
 tests/examplefiles/test.moo
 tests/examplefiles/test.myt
+tests/examplefiles/test.nim
 tests/examplefiles/test.pas
 tests/examplefiles/test.php
 tests/examplefiles/test.plot
+tests/examplefiles/test.ps1
+tests/examplefiles/test.pypylog
 tests/examplefiles/test.r3
 tests/examplefiles/test.rb
 tests/examplefiles/test.rhtml
@@ -297,6 +344,7 @@ tests/examplefiles/test.scaml
 tests/examplefiles/test.ssp
 tests/examplefiles/test.tcsh
 tests/examplefiles/test.vb
+tests/examplefiles/test.vhdl
 tests/examplefiles/test.xqy
 tests/examplefiles/test.xsl
 tests/examplefiles/truncated.pytb
diff --git a/TODO b/TODO
index 64827004c95d0443a1605a8d76e845b4087b0573..3ff63a3f5294775327e39ed739e453f0bd84243b 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,8 +3,6 @@ Todo
 
 - suggested new lexers
   * IPython sessions
-  * PostgreSQL/SQLite
-  * Nemerle
 
 - lexers that need work:
   * review perl lexer (numerous bugs, but so far no one had complaints ;)
index 42a6f7158dc9be1bfc653561d245e6c43eeba9f6..3f583fcb1eadb73e667cc99f2e1e63d14e90db54 100644 (file)
@@ -453,6 +453,6 @@ or a tuple, it is returned as a list.</dd>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.186271
+<!-- generated on: 2012-03-10 22:10:14.556528
      file id: api -->
 </html>
\ No newline at end of file
index 6fb30e6379f3f77fac52a5661fd92b04936b58bc..8f520b77698a351f858e8e42bdb5b8811b8569d3 100644 (file)
@@ -225,42 +225,60 @@ div.toc h2 {
 <li>Paul Baumgart, 280 North, Inc. -- Objective-J lexer</li>
 <li>Michael Bayer -- Myghty lexers</li>
 <li>John Benediktsson -- Factor lexer</li>
+<li>Christopher Bertels -- Fancy lexer</li>
 <li>Jarrett Billingsley -- MiniD lexer</li>
 <li>Adam Blinkinsop -- Haskell, Redcode lexers</li>
 <li>Frits van Bommel -- assembler lexers</li>
 <li>Pierre Bourdon -- bugfixes</li>
 <li>Hiram Chirino -- Scaml and Jade lexers</li>
+<li>Leaf Corcoran -- MoonScript lexer</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>James H. Fisher -- PostScript lexer</li>
-<li>Naveen Garg - Autohotkey lexer</li>
+<li>Carlos Galdino -- Elixir and Elixir Console lexers</li>
+<li>Naveen Garg -- Autohotkey lexer</li>
 <li>Laurent Gautier -- R/S lexer</li>
+<li>Alex Gaynor -- PyPy log lexer</li>
+<li>Bertrand Goetzmann -- Groovy 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>Martin Harriman -- SNOBOL lexer</li>
 <li>Matthew Harrison -- SVG formatter</li>
 <li>Steven Hazel -- Tcl lexer</li>
 <li>Aslak Hellesøy -- Gherkin lexer</li>
+<li>Jordi Gutiérrez Hermoso -- Octave lexer</li>
 <li>David Hess, Fish Software, Inc. -- Objective-J lexer</li>
 <li>Varun Hiremath -- Debian control lexer</li>
 <li>Ben Hollis -- Mason lexer</li>
 <li>Tim Howard -- BlitzMax lexer</li>
+<li>Ivan Inozemtsev -- Fantom lexer</li>
+<li>Brian R. Jackson -- Tea lexer</li>
 <li>Dennis Kaarsemaker -- sources.list lexer</li>
+<li>Igor Kalnitsky -- vhdl lexer</li>
+<li>Adam Koprowski -- Opa 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>
+<li>Olov Lassus -- Dart lexer</li>
+<li>Sylvestre Ledru -- Scilab lexer</li>
 <li>Mark Lee -- Vala lexer</li>
 <li>Ben Mabey -- Gherkin lexer</li>
 <li>Simone Margaritelli -- Hybris lexer</li>
 <li>Kirk McDonald -- D lexer</li>
+<li>Gordon McGregor -- SystemVerilog lexer</li>
 <li>Stephen McKamey -- Duel/JBST lexer</li>
+<li>Brian McKenna -- F# lexer</li>
 <li>Lukas Meuser -- BBCode formatter, Lua lexer</li>
+<li>Hong Minhee -- HTTP lexer</li>
+<li>Michael Mior -- Awk lexer</li>
 <li>Paulo Moura -- Logtalk lexer</li>
+<li>Mher Movsisyan -- DTD lexer</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>
@@ -269,7 +287,10 @@ div.toc h2 {
 <li>Jon Parise -- Protocol buffers lexer</li>
 <li>Ronny Pfannschmidt -- BBCode lexer</li>
 <li>Benjamin Peterson -- Test suite refactoring</li>
+<li>Dominik Picheta -- Nimrod lexer</li>
+<li>Clément Prévost -- UrbiScript lexer</li>
 <li>Justin Reidy -- MXML lexer</li>
+<li>Norman Richards -- JSON lexer</li>
 <li>Lubomir Rintel -- GoodData MAQL and CL lexers</li>
 <li>Andre Roberge -- Tango style</li>
 <li>Konrad Rudolph -- LaTeX formatter enhancements</li>
@@ -280,21 +301,29 @@ div.toc h2 {
 <li>Ken Schutte -- Matlab lexers</li>
 <li>Tassilo Schweyer -- Io, MOOCode lexers</li>
 <li>Joerg Sieker -- ABAP lexer</li>
+<li>Robert Simmons -- Standard ML lexer</li>
 <li>Kirill Simonov -- YAML lexer</li>
 <li>Steve Spigarelli -- XQuery lexer</li>
+<li>Jerome St-Louis -- eC lexer</li>
+<li>James Strachan -- Kotlin lexer</li>
 <li>Tiberius Teng -- default style overhaul</li>
 <li>Jeremy Thurgood -- Erlang, Squid config lexers</li>
 <li>Erick Tryzelaar -- Felix lexer</li>
+<li>Daniele Varrazzo -- PostgreSQL lexers</li>
+<li>Abe Voelker -- OpenEdge ABL lexer</li>
 <li>Whitney Young -- ObjectiveC lexer</li>
+<li>Matthias Vallentin -- Bro 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>
+<li>Diego Zamboni -- CFengine3 lexer</li>
+<li>Alex Zimin -- Nemerle lexer</li>
 </ul>
 <p>Many thanks for all contributions!</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:48.981365
+<!-- generated on: 2012-03-10 22:10:14.237201
      file id: authors -->
 </html>
\ No newline at end of file
index a785d5f38ed974f3ce12b600b1118ad3f1f36770..4415fa711bac64523ad42b9aa12717452e649200 100644 (file)
@@ -213,6 +213,8 @@ div.toc h2 {
         <h2>Contents</h2>
         <ul class="contents">
         
+          <li><a href="#version-1-5">Version 1.5</a></li>
+        
           <li><a href="#version-1-4">Version 1.4</a></li>
         
           <li><a href="#version-1-3-1">Version 1.3.1</a></li>
@@ -258,9 +260,73 @@ div.toc h2 {
     
     <p>Issue numbers refer to the tracker at
 <a class="reference external" href="http://bitbucket.org/birkenfeld/pygments-main/issues">http://bitbucket.org/birkenfeld/pygments-main/issues</a>.</p>
+<div class="section" id="version-1-5">
+<h3>Version 1.5</h3>
+<p>(codename Zeitdilatation, released Mar 10, 2012)</p>
+<ul class="simple">
+<li>Lexers added:<ul>
+<li>Awk (#630)</li>
+<li>Fancy (#633)</li>
+<li>PyPy Log</li>
+<li>eC</li>
+<li>Nimrod</li>
+<li>Nemerle (#667)</li>
+<li>F# (#353)</li>
+<li>Groovy (#501)</li>
+<li>PostgreSQL (#660)</li>
+<li>DTD</li>
+<li>Gosu (#634)</li>
+<li>Octave (PR#22)</li>
+<li>Standard ML (PR#14)</li>
+<li>CFengine3 (#601)</li>
+<li>Opa (PR#37)</li>
+<li>HTTP sessions (PR#42)</li>
+<li>JSON (PR#31)</li>
+<li>SNOBOL (PR#30)</li>
+<li>MoonScript (PR#43)</li>
+<li>ECL (PR#29)</li>
+<li>Urbiscript (PR#17)</li>
+<li>OpenEdge ABL (PR#27)</li>
+<li>SystemVerilog (PR#35)</li>
+<li>Coq (#734)</li>
+<li>PowerShell (#654)</li>
+<li>Dart (#715)</li>
+<li>Fantom (PR#36)</li>
+<li>Bro (PR#5)</li>
+<li>NewLISP (PR#26)</li>
+<li>VHDL (PR#45)</li>
+<li>Scilab (#740)</li>
+<li>Elixir (PR#57)</li>
+<li>Tea (PR#56)</li>
+<li>Kotlin (PR#58)</li>
+</ul>
+</li>
+<li>Fix Python 3 terminal highlighting with pygmentize (#691).</li>
+<li>In the LaTeX formatter, escape special &amp;, &lt; and &gt; chars (#648).</li>
+<li>In the LaTeX formatter, fix display problems for styles with token
+background colors (#670).</li>
+<li>Enhancements to the Squid conf lexer (#664).</li>
+<li>Several fixes to the reStructuredText lexer (#636).</li>
+<li>Recognize methods in the ObjC lexer (#638).</li>
+<li>Fix Lua &quot;class&quot; highlighting: it does not have classes (#665).</li>
+<li>Fix degenerate regex in Scala lexer (#671) and highlighting bugs (#713, 708).</li>
+<li>Fix number pattern order in Ocaml lexer (#647).</li>
+<li>Fix generic type highlighting in ActionScript 3 (#666).</li>
+<li>Fixes to the Clojure lexer (PR#9).</li>
+<li>Fix degenerate regex in Nemerle lexer (#706).</li>
+<li>Fix infinite looping in CoffeeScript lexer (#729).</li>
+<li>Fix crashes and analysis with ObjectiveC lexer (#693, #696).</li>
+<li>Add some Fortran 2003 keywords.</li>
+<li>Fix Boo string regexes (#679).</li>
+<li>Add &quot;rrt&quot; style (#727).</li>
+<li>Fix infinite looping in Darcs Patch lexer.</li>
+<li>Lots of misc fixes to character-eating bugs and ordering problems in many
+different lexers.</li>
+</ul>
+</div>
 <div class="section" id="version-1-4">
 <h3>Version 1.4</h3>
-<p>(codename Unschärfe, released Jan 03, 2010)</p>
+<p>(codename Unschärfe, released Jan 03, 2011)</p>
 <ul class="simple">
 <li>Lexers added:<ul>
 <li>Factor (#520)</li>
@@ -796,6 +862,6 @@ continuations.</li>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.597530
+<!-- generated on: 2012-03-10 22:10:15.041447
      file id: changelog -->
 </html>
\ No newline at end of file
index 56acb3f107c300950df0823a37d770ff97e6b583..f8c18108efea0cd0ffb0148accffc6c9963a9a09 100644 (file)
@@ -348,6 +348,6 @@ formatter is the terminal encoding (<cite>sys.stdout.encoding</cite>).</li>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:48.454222
+<!-- generated on: 2012-03-10 22:10:13.609306
      file id: cmdline -->
 </html>
\ No newline at end of file
index 09ad053a1b7f375a8df15eb2bd2a8e4ac3406888..4db54b9e34a456d338b4d637f00674b779241b3a 100644 (file)
@@ -277,6 +277,6 @@ decorated function for filtering.</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.153420
+<!-- generated on: 2012-03-10 22:10:14.454999
      file id: filterdevelopment -->
 </html>
\ No newline at end of file
index 5a90ac0fde50585614bc7ab88a7ede89e97f08d3..0cbe5fb0fab75b02c317544374418f9be152dc9c 100644 (file)
@@ -407,6 +407,6 @@ code to your styleguide.</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.071135
+<!-- generated on: 2012-03-10 22:10:14.362039
      file id: filters -->
 </html>
\ No newline at end of file
index 60724ca91acf1dd66cb3340aa6e91fb9cb34798d..44583134e2dbfb25cece5987fb131511ce788de2 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: 2011-01-03 18:05:48.789414
+<!-- generated on: 2012-03-10 22:10:14.013798
      file id: formatterdevelopment -->
 </html>
\ No newline at end of file
index 165729b4829f335237d6662e32409c5e5f6bdc18..1a21a04b7eb0919e515200ee668094154efe3c38 100644 (file)
@@ -903,6 +903,6 @@ no support for common styles.</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:48.500791
+<!-- generated on: 2012-03-10 22:10:13.666823
      file id: formatters -->
 </html>
\ No newline at end of file
index 022a077215d54c0d3b00e2fd02c574063c2cfc28..f4a7c32ac22fe9e028a29ba5bab48d68f302bdf5 100644 (file)
@@ -256,6 +256,6 @@ look <a class="reference external" href="http://pygments.org/contribute/">here</
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.293405
+<!-- generated on: 2012-03-10 22:10:14.682973
      file id: index -->
 </html>
\ No newline at end of file
index 874f43989779cc33426767fc416cc341f3b49eba..d7350243e8c23ef183e4b388499b23c25d0cc50a 100644 (file)
@@ -276,6 +276,6 @@ is run, the sources are updated from Subversion. -->
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.036012
+<!-- generated on: 2012-03-10 22:10:14.323148
      file id: installation -->
 </html>
\ No newline at end of file
index 37f6bba1654c8f3d361abb7db89ed51d2099b317..9936004893053583596b5ff385543bc93613e1c2 100644 (file)
@@ -257,6 +257,6 @@ sets up completion for the <tt class="docutils literal">pygmentize</tt> command
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:46.991572
+<!-- generated on: 2012-03-10 22:10:11.698970
      file id: integrate -->
 </html>
\ No newline at end of file
index c7b51712f781f27bf86be74d8d6b3a3ca16eb086..b82fe3b93ea9f29c32d4c34c2df16bc34a8fefc4 100644 (file)
@@ -331,7 +331,7 @@ sections, comments and key = value pairs:</p>
     <span class="p">}</span>
 </pre></div>
 <p>The lexer first looks for whitespace, comments and section names. And later it
-looks for a line that looks like a key, value pair, seperated by an <tt class="docutils literal">'='</tt>
+looks for a line that looks like a key, value pair, separated by an <tt class="docutils literal">'='</tt>
 sign, and optional whitespace.</p>
 <p>The <cite>bygroups</cite> helper makes sure that each group is yielded with a different
 token type. First the <cite>Name.Attribute</cite> token, then a <cite>Text</cite> token for the
@@ -686,6 +686,6 @@ the <tt class="docutils literal">get_tokens_unprocessed()</tt> method. The follo
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:48.278991
+<!-- generated on: 2012-03-10 22:10:13.417520
      file id: lexerdevelopment -->
 </html>
\ No newline at end of file
index 7ab6877d660681723ece773fd4f991d8579da0f3..bc78e54742b5febd7468d0654e3bde5f3a5ddcf1 100644 (file)
@@ -225,14 +225,20 @@ div.toc h2 {
         
           <li><a href="#lexers-for-hardware-descriptor-languages">Lexers for hardware descriptor languages</a></li>
         
+          <li><a href="#pygments-lexers-for-jvm-languages">Pygments lexers for JVM languages</a></li>
+        
           <li><a href="#lexers-for-math-languages">Lexers for math languages</a></li>
         
           <li><a href="#lexers-for-other-languages">Lexers for other languages</a></li>
         
           <li><a href="#lexers-for-parser-generators">Lexers for parser generators</a></li>
         
+          <li><a href="#lexers-for-various-shells">Lexers for various shells</a></li>
+        
           <li><a href="#special-lexers">Special lexers</a></li>
         
+          <li><a href="#lexers-for-various-sql-dialects-and-related-interactive-sessions">Lexers for various SQL dialects and related interactive sessions</a></li>
+        
           <li><a href="#lexers-for-various-template-engines-markup">Lexers for various template engines' markup</a></li>
         
           <li><a href="#lexers-for-non-source-code-file-types">Lexers for non-source code file types</a></li>
@@ -275,36 +281,39 @@ guess the encoding of the input.</p>
 <p>These lexers are builtin and can be imported from <cite>pygments.lexers</cite>:</p>
 <div class="section" id="lexers-for-agile-languages">
 <h3>Lexers for agile languages</h3>
-<p><cite>ClojureLexer</cite></p>
+<p><cite>FactorLexer</cite></p>
 <blockquote>
-<p>Lexer for <a class="reference external" href="http://clojure.org/">Clojure</a> source code.</p>
-<p><em>New in Pygments 0.11.</em></p>
+<p>Lexer for the <a class="reference external" href="http://factorcode.org">Factor</a> language.</p>
+<p><em>New in Pygments 1.4.</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">clojure, clj</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">factor</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.clj</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.factor</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-clojure, application/x-clojure</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-factor</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>FactorLexer</cite></p>
+<p><cite>FancyLexer</cite></p>
 <blockquote>
-<p>Lexer for the <a class="reference external" href="http://factorcode.org">Factor</a> language.</p>
-<p><em>New in Pygments 1.4.</em></p>
+<p>Pygments Lexer For <a class="reference external" href="http://www.fancy-lang.org/">Fancy</a>.</p>
+<p>Fancy is a self-hosted, pure object-oriented, dynamic,
+class-based, concurrent general-purpose programming language
+running on Rubinius, the Ruby VM.</p>
+<p><em>New in Pygments 1.5.</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">factor</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">fancy, fy</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.factor</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.fy, *.fancypack</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-factor</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-fancysrc</td>
 </tr>
 </tbody>
 </table>
@@ -327,24 +336,6 @@ programming language) source.</p>
 </tbody>
 </table>
 </blockquote>
-<p><cite>IokeLexer</cite></p>
-<blockquote>
-<p>For <a class="reference external" href="http://ioke.org/">Ioke</a> (a strongly typed, dynamic,
-prototype based programming language) source.</p>
-<p><em>New in Pygments 1.4.</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">ioke, ik</td>
-</tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ik</td>
-</tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-iokesrc</td>
-</tr>
-</tbody>
-</table>
-</blockquote>
 <p><cite>LuaLexer</cite></p>
 <blockquote>
 <p>For <a class="reference external" href="http://www.lua.org">Lua</a> source code.</p>
@@ -394,6 +385,23 @@ language) source.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>MoonScriptLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://moonscript.org.org">MoonScript</a> source code.</p>
+<p><em>New in Pygments 1.5.</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">moon, moonscript</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.moon</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-moonscript, application/x-moonscript</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>PerlLexer</cite></p>
 <blockquote>
 <p>For <a class="reference external" href="http://www.perl.org">Perl</a> source code.</p>
@@ -723,7 +731,7 @@ language) source.</p>
 <tbody valign="top">
 <tr class="field"><th class="field-name">Short names:</th><td class="field-body">c</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.c, *.h</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.c, *.h, *.idc</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-chdr, text/x-csrc</td>
 </tr>
@@ -827,6 +835,40 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>ECLexer</cite></p>
+<blockquote>
+<p>For eC source code with preprocessor directives.</p>
+<p><em>New in Pygments 1.5.</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">ec</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ec, *.eh</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-echdr, text/x-ecsrc</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>FantomLexer</cite></p>
+<blockquote>
+<p>For Fantom source code.</p>
+<p><em>New in Pygments 1.5.</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">fan</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.fan</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-fantom</td>
+</tr>
+</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>
@@ -854,7 +896,7 @@ Default is to consider all of them builtin.</dd>
 <tbody valign="top">
 <tr class="field"><th class="field-name">Short names:</th><td class="field-body">fortran</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.f, *.f90</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.f, *.f90, *.F, *.F90</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-fortran</td>
 </tr>
@@ -894,22 +936,6 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
-<p><cite>JavaLexer</cite></p>
-<blockquote>
-<p>For <a class="reference external" href="http://www.sun.com/java/">Java</a> source code.</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">java</td>
-</tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.java</td>
-</tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-java</td>
-</tr>
-</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>
@@ -938,6 +964,23 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>NimrodLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://nimrod-code.org/">Nimrod</a> source code.</p>
+<p><em>New in Pygments 1.5.</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">nimrod, nim</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.nim, *.nimrod</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-nimrod</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>ObjectiveCLexer</cite></p>
 <blockquote>
 <p>For Objective-C source code with preprocessor directives.</p>
@@ -987,22 +1030,6 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
-<p><cite>ScalaLexer</cite></p>
-<blockquote>
-<p>For <a class="reference external" href="http://www.scala-lang.org">Scala</a> source code.</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">scala</td>
-</tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.scala</td>
-</tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-scala</td>
-</tr>
-</tbody>
-</table>
-</blockquote>
 <p><cite>ValaLexer</cite></p>
 <blockquote>
 <p>For Vala source code with preprocessor directives.</p>
@@ -1090,6 +1117,57 @@ are allowed.  Note that this means a considerable slowdown since the
 </tbody>
 </table>
 </blockquote>
+<p><cite>FSharpLexer</cite></p>
+<blockquote>
+<p>For the F# language.</p>
+<p><em>New in Pygments 1.5.</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">fsharp</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.fs, *.fsi</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-fsharp</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>NemerleLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://nemerle.org">Nemerle</a> source code.</p>
+<p>Additional options accepted:</p>
+<dl class="docutils">
+<dt><cite>unicodelevel</cite></dt>
+<dd><p class="first">Determines which Unicode characters this lexer allows for identifiers.
+The possible values are:</p>
+<ul class="simple">
+<li><tt class="docutils literal">none</tt> -- only the ASCII letters and numbers are allowed. This
+is the fastest selection.</li>
+<li><tt class="docutils literal">basic</tt> -- all Unicode characters from the specification except
+category <tt class="docutils literal">Lo</tt> are allowed.</li>
+<li><tt class="docutils literal">full</tt> -- all Unicode characters as specified in the C# specs
+are allowed.  Note that this means a considerable slowdown since the
+<tt class="docutils literal">Lo</tt> category has more than 40,000 characters in it!</li>
+</ul>
+<p class="last">The default value is <tt class="docutils literal">basic</tt>.</p>
+</dd>
+</dl>
+<p><em>New in Pygments 1.5.</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">nemerle</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.n</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-nemerle</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>VbNetAspxLexer</cite></p>
 <blockquote>
 <p>Lexer for highligting Visual Basic.net within ASP.NET pages.</p>
@@ -1144,6 +1222,68 @@ source code.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>CoqLexer</cite></p>
+<blockquote>
+<p>For the <a class="reference external" href="http://coq.inria.fr/">Coq</a> theorem prover.</p>
+<p><em>New in Pygments 1.5.</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">coq</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.v</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-coq</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>ElixirConsoleLexer</cite></p>
+<blockquote>
+<p>For Elixir interactive console (iex) output like:</p>
+<div class="syntax"><pre><span class="gp">iex&gt; </span><span class="p">[</span><span class="n">head</span> <span class="o">|</span> <span class="n">tail</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="m">1</span><span class="p">,</span><span class="m">2</span><span class="p">,</span><span class="m">3</span><span class="p">]</span>
+<span class="go">[1,2,3]</span>
+<span class="gp">iex&gt; </span><span class="n">head</span>
+<span class="go">1</span>
+<span class="gp">iex&gt; </span><span class="n">tail</span>
+<span class="go">[2,3]</span>
+<span class="gp">iex&gt; </span><span class="p">[</span><span class="n">head</span> <span class="o">|</span> <span class="n">tail</span><span class="p">]</span>
+<span class="go">[1,2,3]</span>
+<span class="gp">iex&gt; </span><span class="n">length</span> <span class="p">[</span><span class="n">head</span> <span class="o">|</span> <span class="n">tail</span><span class="p">]</span>
+<span class="go">3</span>
+</pre></div>
+<p><em>New in Pygments 1.5.</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">iex</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">text/x-elixir-shellsession</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>ElixirLexer</cite></p>
+<blockquote>
+<p>For the <a class="reference external" href="http://elixir-lang.org">Elixir language</a>.</p>
+<p><em>New in Pygments 1.5.</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">elixir, ex, exs</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ex, *.exs</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-elixir</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>ErlangLexer</cite></p>
 <blockquote>
 <p>For the Erlang functional programming language.</p>
@@ -1155,7 +1295,7 @@ source code.</p>
 <tbody valign="top">
 <tr class="field"><th class="field-name">Short names:</th><td class="field-body">erlang</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.erl, *.hrl</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.erl, *.hrl, *.es, *.escript</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-erlang</td>
 </tr>
@@ -1220,6 +1360,23 @@ is a backslash or percent character, LaTeX is assumed, else Bird.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>NewLispLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="www.newlisp.org">newLISP.</a> source code (version 10.3.0).</p>
+<p><em>New in Pygments 1.5.</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">newlisp</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.lsp, *.nl</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-newlisp, application/x-newlisp</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>OcamlLexer</cite></p>
 <blockquote>
 <p>For the OCaml language.</p>
@@ -1237,6 +1394,40 @@ is a backslash or percent character, LaTeX is assumed, else Bird.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>OpaLexer</cite></p>
+<blockquote>
+<p>Lexer for the Opa language (<a class="reference external" href="http://opalang.org">http://opalang.org</a>).</p>
+<p><em>New in Pygments 1.5.</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">opa</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.opa</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-opa</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>SMLLexer</cite></p>
+<blockquote>
+<p>For the Standard ML language.</p>
+<p><em>New in Pygments 1.5.</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">sml</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sml, *.sig, *.fun</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-standardml, application/x-standardml</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>SchemeLexer</cite></p>
 <blockquote>
 <p>A Scheme lexer, parsing a stream and outputting the tokens
@@ -1253,7 +1444,7 @@ at <a class="reference external" href="http://paste.lisp.org/">http://paste.lisp
 <tbody valign="top">
 <tr class="field"><th class="field-name">Short names:</th><td class="field-body">scheme, scm</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.scm</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.scm, *.ss, *.rkt</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-scheme, application/x-scheme</td>
 </tr>
@@ -1263,6 +1454,24 @@ at <a class="reference external" href="http://paste.lisp.org/">http://paste.lisp
 </div>
 <div class="section" id="lexers-for-hardware-descriptor-languages">
 <h3>Lexers for hardware descriptor languages</h3>
+<p><cite>SystemVerilogLexer</cite></p>
+<blockquote>
+<p>Extends verilog lexer to recognise all SystemVerilog keywords from IEEE
+1800-2009 standard.</p>
+<p><em>New in Pygments 1.5.</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">sv</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sv, *.svh</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-systemverilog</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>VerilogLexer</cite></p>
 <blockquote>
 <p>For verilog source code with preprocessor directives.</p>
@@ -1273,26 +1482,199 @@ at <a class="reference external" href="http://paste.lisp.org/">http://paste.lisp
 <tbody valign="top">
 <tr class="field"><th class="field-name">Short names:</th><td class="field-body">v</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.v, *.sv</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.v</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-verilog</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
+<p><cite>VhdlLexer</cite></p>
+<blockquote>
+<p>For VHDL source code.</p>
+<p><em>New in Pygments 1.5.</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">vhdl</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.vhdl, *.vhd</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-vhdl</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+</div>
+<div class="section" id="pygments-lexers-for-jvm-languages">
+<h3>Pygments lexers for JVM languages</h3>
+<p><cite>ClojureLexer</cite></p>
+<blockquote>
+<p>Lexer for <a class="reference external" href="http://clojure.org/">Clojure</a> source code.</p>
+<p><em>New in Pygments 0.11.</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">clojure, clj</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.clj</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-clojure, application/x-clojure</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>GosuLexer</cite></p>
+<blockquote>
+<p>For Gosu source code.</p>
+<p><em>New in Pygments 1.5.</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">gosu</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.gs, *.gsx, *.gsp, *.vark</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-gosu</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>GosuTemplateLexer</cite></p>
+<blockquote>
+<p>For Gosu templates.</p>
+<p><em>New in Pygments 1.5.</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">gst</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.gst</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-gosu-template</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>GroovyLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://groovy.codehaus.org/">Groovy</a> source code.</p>
+<p><em>New in Pygments 1.5.</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">groovy</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.groovy</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-groovy</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>IokeLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://ioke.org/">Ioke</a> (a strongly typed, dynamic,
+prototype based programming language) source.</p>
+<p><em>New in Pygments 1.4.</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">ioke, ik</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ik</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-iokesrc</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>JavaLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://www.sun.com/java/">Java</a> source code.</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">java</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.java</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-java</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>KotlinLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://confluence.jetbrains.net/display/Kotlin/">Kotlin</a>
+source code.</p>
+<p>Additional options accepted:</p>
+<dl class="docutils">
+<dt><cite>unicodelevel</cite></dt>
+<dd><p class="first">Determines which Unicode characters this lexer allows for identifiers.
+The possible values are:</p>
+<ul class="simple">
+<li><tt class="docutils literal">none</tt> -- only the ASCII letters and numbers are allowed. This
+is the fastest selection.</li>
+<li><tt class="docutils literal">basic</tt> -- all Unicode characters from the specification except
+category <tt class="docutils literal">Lo</tt> are allowed.</li>
+<li><tt class="docutils literal">full</tt> -- all Unicode characters as specified in the C# specs
+are allowed.  Note that this means a considerable slowdown since the
+<tt class="docutils literal">Lo</tt> category has more than 40,000 characters in it!</li>
+</ul>
+<p class="last">The default value is <tt class="docutils literal">basic</tt>.</p>
+</dd>
+</dl>
+<p><em>New in Pygments 1.5.</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">kotlin</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.kt</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-kotlin</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>ScalaLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://www.scala-lang.org">Scala</a> source code.</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">scala</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.scala</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-scala</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 </div>
 <div class="section" id="lexers-for-math-languages">
 <h3>Lexers for math languages</h3>
 <p><cite>MatlabLexer</cite></p>
 <blockquote>
-<p>For Matlab (or GNU Octave) source code.
+<p>For Matlab source code.
 Contributed by Ken Schutte &lt;<a class="reference external" href="mailto:kschutte&#64;csail.mit.edu">kschutte&#64;csail.mit.edu</a>&gt;.</p>
 <p><em>New in Pygments 0.10.</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">matlab, octave</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">matlab</td>
 </tr>
 <tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.m</td>
 </tr>
@@ -1303,7 +1685,7 @@ Contributed by Ken Schutte &lt;<a class="reference external" href="mailto:kschut
 </blockquote>
 <p><cite>MatlabSessionLexer</cite></p>
 <blockquote>
-<p>For Matlab (or GNU Octave) sessions.  Modeled after PythonConsoleLexer.
+<p>For Matlab sessions.  Modeled after PythonConsoleLexer.
 Contributed by Ken Schutte &lt;<a class="reference external" href="mailto:kschutte&#64;csail.mit.edu">kschutte&#64;csail.mit.edu</a>&gt;.</p>
 <p><em>New in Pygments 0.10.</em></p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -1354,6 +1736,23 @@ Contributed by Christopher Creutzig &lt;<a class="reference external" href="mail
 </tbody>
 </table>
 </blockquote>
+<p><cite>OctaveLexer</cite></p>
+<blockquote>
+<p>For GNU Octave source code.</p>
+<p><em>New in Pygments 1.5.</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">octave</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.m</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/octave</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>RConsoleLexer</cite></p>
 <blockquote>
 <p>For R console transcripts or R CMD BATCH output files.</p>
@@ -1387,6 +1786,23 @@ Contributed by Christopher Creutzig &lt;<a class="reference external" href="mail
 </tbody>
 </table>
 </blockquote>
+<p><cite>ScilabLexer</cite></p>
+<blockquote>
+<p>For Scilab source code.</p>
+<p><em>New in Pygments 1.5.</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">scilab</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sci, *.sce, *.tst</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/scilab</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 </div>
 <div class="section" id="lexers-for-other-languages">
 <h3>Lexers for other languages</h3>
@@ -1459,88 +1875,106 @@ Contributed by Andreas Amann &lt;<a class="reference external" href="mailto:aama
 </tbody>
 </table>
 </blockquote>
-<p><cite>BashLexer</cite></p>
+<p><cite>AwkLexer</cite></p>
 <blockquote>
-<p>Lexer for (ba|k|)sh shell scripts.</p>
-<p><em>New in Pygments 0.6.</em></p>
+<p>For Awk scripts.</p>
+<p><em>New in Pygments 1.5.</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, ksh</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">awk, gawk, mawk, nawk</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sh, *.ksh, *.bash, *.ebuild, *.eclass</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.awk</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-sh, application/x-shellscript</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-awk</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>BashSessionLexer</cite></p>
+<p><cite>BefungeLexer</cite></p>
 <blockquote>
-<p>Lexer for simplistic shell sessions.</p>
-<p><em>New in Pygments 1.1.</em></p>
+<p>Lexer for the esoteric <a class="reference external" href="http://en.wikipedia.org/wiki/Befunge">Befunge</a>
+language.</p>
+<p><em>New in Pygments 0.7.</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">console</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">befunge</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sh-session</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.befunge</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-shell-session</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-befunge</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>BatchLexer</cite></p>
+<p><cite>BrainfuckLexer</cite></p>
 <blockquote>
-<p>Lexer for the DOS/Windows Batch file format.</p>
-<p><em>New in Pygments 0.7.</em></p>
+<p>Lexer for the esoteric <a class="reference external" href="http://www.muppetlabs.com/~breadbox/bf/">BrainFuck</a>
+language.</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">bat</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">brainfuck, bf</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.bat, *.cmd</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.bf, *.b</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-dos-batch</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-brainfuck</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>BefungeLexer</cite></p>
+<p><cite>BroLexer</cite></p>
 <blockquote>
-<p>Lexer for the esoteric <a class="reference external" href="http://en.wikipedia.org/wiki/Befunge">Befunge</a>
-language.</p>
-<p><em>New in Pygments 0.7.</em></p>
+<p>For <a class="reference external" href="http://bro-ids.org/">Bro</a> scripts.</p>
+<p><em>New in Pygments 1.5.</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">befunge</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">bro</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.befunge</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.bro</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-befunge</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">None</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>BrainfuckLexer</cite></p>
+<p><cite>Cfengine3Lexer</cite></p>
 <blockquote>
-<p>Lexer for the esoteric <a class="reference external" href="http://www.muppetlabs.com/~breadbox/bf/">BrainFuck</a>
+<p>Lexer for <a class="reference external" href="http://cfengine.org">CFEngine3</a> policy files.</p>
+<p><em>New in Pygments 1.5.</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">cfengine3, cf3</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.cf</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">None</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>ECLLexer</cite></p>
+<blockquote>
+<p>Lexer for the declarative big-data <a class="reference external" href="http://hpccsystems.com/community/docs/ecl-language-reference/html">ECL</a>
 language.</p>
+<p><em>New in Pygments 1.5.</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">brainfuck, bf</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">ecl</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.bf, *.b</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ecl</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-brainfuck</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-ecl</td>
 </tr>
 </tbody>
 </table>
@@ -1684,34 +2118,35 @@ scripts.</p>
 </tbody>
 </table>
 </blockquote>
-<p><cite>MySqlLexer</cite></p>
+<p><cite>NewspeakLexer</cite></p>
 <blockquote>
-<p>Special lexer for MySQL.</p>
+<p>For <cite>Newspeak &lt;http://newspeaklanguage.org/&gt;</cite> syntax.</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">mysql</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">newspeak</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">None</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ns2</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-mysql</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-newspeak</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>NewspeakLexer</cite></p>
+<p><cite>OpenEdgeLexer</cite></p>
 <blockquote>
-<p>For <cite>Newspeak &lt;http://newspeaklanguage.org/&gt;</cite> syntax.</p>
+<p>Lexer for <a class="reference external" href="http://web.progress.com/en/openedge/abl.html">OpenEdge ABL (formerly Progress)</a> source code.</p>
+<p><em>New in Pygments 1.5.</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">newspeak</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">openedge, abl, progress</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ns2</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.p, *.cls</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-newspeak</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-openedge, application/x-openedge</td>
 </tr>
 </tbody>
 </table>
@@ -1809,69 +2244,54 @@ Contributed by Adam Blinkinsop &lt;<a class="reference external" href="mailto:bl
 <p><cite>SmalltalkLexer</cite></p>
 <blockquote>
 <p>For <a class="reference external" href="http://www.smalltalk.org/">Smalltalk</a> syntax.
-Contributed by Stefan Matthias Aust.
-Rewritten by Nils Winter.</p>
-<p><em>New in Pygments 0.10.</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">smalltalk, squeak</td>
-</tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.st</td>
-</tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-smalltalk</td>
-</tr>
-</tbody>
-</table>
-</blockquote>
-<p><cite>SqlLexer</cite></p>
-<blockquote>
-<p>Lexer for Structured Query Language. Currently, this lexer does
-not recognize any special syntax except ANSI SQL.</p>
+Contributed by Stefan Matthias Aust.
+Rewritten by Nils Winter.</p>
+<p><em>New in Pygments 0.10.</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">sql</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">smalltalk, squeak</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sql</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.st</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-sql</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-smalltalk</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>SqliteConsoleLexer</cite></p>
+<p><cite>SnobolLexer</cite></p>
 <blockquote>
-<p>Lexer for example sessions using sqlite3.</p>
-<p><em>New in Pygments 0.11.</em></p>
+<p>Lexer for the SNOBOL4 programming language.</p>
+<p>Recognizes the common ASCII equivalents of the original SNOBOL4 operators.
+Does not require spaces around binary operators.</p>
+<p><em>New in Pygments 1.5.</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">sqlite3</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">snobol</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sqlite3-console</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.snobol</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-sqlite3-console</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-snobol</td>
 </tr>
 </tbody>
 </table>
 </blockquote>
-<p><cite>TcshLexer</cite></p>
+<p><cite>UrbiscriptLexer</cite></p>
 <blockquote>
-<p>Lexer for tcsh scripts.</p>
-<p><em>New in Pygments 0.10.</em></p>
+<p>For UrbiScript source code.</p>
+<p><em>New in Pygments 1.5.</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">tcsh, csh</td>
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">urbiscript</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.tcsh, *.csh</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.u</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-csh</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-urbiscript</td>
 </tr>
 </tbody>
 </table>
@@ -2175,6 +2595,94 @@ fragments of Ragel.  For <tt class="docutils literal">.rl</tt> files, use RagelE
 </table>
 </blockquote>
 </div>
+<div class="section" id="lexers-for-various-shells">
+<h3>Lexers for various shells</h3>
+<p><cite>BashLexer</cite></p>
+<blockquote>
+<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, ksh</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sh, *.ksh, *.bash, *.ebuild, *.eclass, .bashrc, bashrc, .bash\*, bash\*</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-sh, application/x-shellscript</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>BashSessionLexer</cite></p>
+<blockquote>
+<p>Lexer for simplistic shell sessions.</p>
+<p><em>New in Pygments 1.1.</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">console</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sh-session</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-shell-session</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>BatchLexer</cite></p>
+<blockquote>
+<p>Lexer for the DOS/Windows Batch file format.</p>
+<p><em>New in Pygments 0.7.</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">bat</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.bat, *.cmd</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-dos-batch</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>PowerShellLexer</cite></p>
+<blockquote>
+<p>For Windows PowerShell code.</p>
+<p><em>New in Pygments 1.5.</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">powershell, posh, ps1</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ps1</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-powershell</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>TcshLexer</cite></p>
+<blockquote>
+<p>Lexer for tcsh scripts.</p>
+<p><em>New in Pygments 0.10.</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">tcsh, csh</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.tcsh, *.csh</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-csh</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+</div>
 <div class="section" id="special-lexers">
 <h3>Special lexers</h3>
 <p><cite>RawTokenLexer</cite></p>
@@ -2218,6 +2726,110 @@ the given compression algorithm before lexing (default: <tt class="docutils lite
 </table>
 </blockquote>
 </div>
+<div class="section" id="lexers-for-various-sql-dialects-and-related-interactive-sessions">
+<h3>Lexers for various SQL dialects and related interactive sessions</h3>
+<p><cite>MySqlLexer</cite></p>
+<blockquote>
+<p>Special lexer for MySQL.</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">mysql</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">text/x-mysql</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>PlPgsqlLexer</cite></p>
+<blockquote>
+<p>Handle the extra syntax in Pl/pgSQL language.</p>
+<p><em>New in Pygments 1.5.</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">plpgsql</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">text/x-plpgsql</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>PostgresConsoleLexer</cite></p>
+<blockquote>
+<p>Lexer for psql sessions.</p>
+<p><em>New in Pygments 1.5.</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">psql, postgresql-console, postgres-console</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">text/x-postgresql-psql</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>PostgresLexer</cite></p>
+<blockquote>
+<p>Lexer for the PostgreSQL dialect of SQL.</p>
+<p><em>New in Pygments 1.5.</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">postgresql, postgres</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">text/x-postgresql</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>SqlLexer</cite></p>
+<blockquote>
+<p>Lexer for Structured Query Language. Currently, this lexer does
+not recognize any special syntax except ANSI SQL.</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">sql</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sql</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-sql</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>SqliteConsoleLexer</cite></p>
+<blockquote>
+<p>Lexer for example sessions using sqlite3.</p>
+<p><em>New in Pygments 0.11.</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">sqlite3</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.sqlite3-console</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-sqlite3-console</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+</div>
 <div class="section" id="lexers-for-various-template-engines-markup">
 <h3>Lexers for various template engines' markup</h3>
 <p><cite>CheetahHtmlLexer</cite></p>
@@ -2951,6 +3563,23 @@ data is left untouched by the lexer.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>TeaTemplateLexer</cite></p>
+<blockquote>
+<p>Lexer for <a class="reference external" href="http://teatrove.org/">Tea Templates</a>.</p>
+<p><em>New in Pygments 1.5.</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">tea</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.tea</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-tea</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>VelocityHtmlLexer</cite></p>
 <blockquote>
 <p>Subclass of the <cite>VelocityLexer</cite> that highlights unlexer data
@@ -3229,6 +3858,23 @@ extensions. Mainly useful for highlighting manpage sources.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>HttpLexer</cite></p>
+<blockquote>
+<p>Lexer for HTTP sessions.</p>
+<p><em>New in Pygments 1.5.</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">http</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>IniLexer</cite></p>
 <blockquote>
 <p>Lexer for configuration files in INI style.</p>
@@ -3347,6 +3993,23 @@ the same file even).</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>PyPyLogLexer</cite></p>
+<blockquote>
+<p>Lexer for PyPy log files.</p>
+<p><em>New in Pygments 1.5.</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">pypylog, pypy</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.pypylog</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-pypylog</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>RstLexer</cite></p>
 <blockquote>
 <p>For <a class="reference external" href="http://docutils.sf.net/rst.html">reStructuredText</a> markup.</p>
@@ -3431,7 +4094,7 @@ language (default: <tt class="docutils literal">True</tt>). <em>New in Pygments
 <tbody valign="top">
 <tr class="field"><th class="field-name">Short names:</th><td class="field-body">vim</td>
 </tr>
-<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.vim, .vimrc</td>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.vim, .vimrc, .exrc, .gvimrc, vimrc, exrc, gvimrc, vimrc, gvimrc</td>
 </tr>
 <tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-vim</td>
 </tr>
@@ -3488,7 +4151,7 @@ language.</p>
 </tr>
 <tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.as</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-actionscript, text/x-actionscript, text/actionscript</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/x-actionscript3, text/x-actionscript3, text/actionscript3</td>
 </tr>
 </tbody>
 </table>
@@ -3526,6 +4189,40 @@ language.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>DartLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://dartlang.org/">Dart</a> source code.</p>
+<p><em>New in Pygments 1.5.</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">dart</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.dart</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-dart</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>DtdLexer</cite></p>
+<blockquote>
+<p>A lexer for DTDs (Document Type Definitions).</p>
+<p><em>New in Pygments 1.5.</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">dtd</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.dtd</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/xml-dtd</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>DuelLexer</cite></p>
 <blockquote>
 <p>Lexer for Duel Views Engine (formerly JBST) markup with JavaScript code blocks.
@@ -3595,6 +4292,23 @@ by the appropriate lexer.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>JSONLexer</cite></p>
+<blockquote>
+<p>For JSON data structures.</p>
+<p><em>New in Pygments 1.5.</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">json</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.json</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/json</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>JadeLexer</cite></p>
 <blockquote>
 <p>For Jade markup.
@@ -3784,7 +4498,7 @@ highlight xquery code.</p>
 </tr>
 <tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.xml, *.xsl, *.rss, *.xslt, *.xsd, *.wsdl</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/xml, application/xml, image/svg+xml, application/rss+xml, application/atom+xml, application/xsl+xml, application/xslt+xml</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/xml, application/xml, image/svg+xml, application/rss+xml, application/atom+xml</td>
 </tr>
 </tbody>
 </table>
@@ -3801,7 +4515,7 @@ highlight xquery code.</p>
 </tr>
 <tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.xsl, *.xslt</td>
 </tr>
-<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/xml, application/xml, image/svg+xml, application/rss+xml, application/atom+xml, application/xsl+xml, application/xslt+xml</td>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">application/xsl+xml, application/xslt+xml</td>
 </tr>
 </tbody>
 </table>
@@ -3828,6 +4542,6 @@ in the form <tt class="docutils literal">(name, aliases, filetypes, mimetypes)</
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:47.043159
+<!-- generated on: 2012-03-10 22:10:11.754524
      file id: lexers -->
 </html>
\ No newline at end of file
index 1dfffb75c0e622ca1e89e49ff102574eaede86ab..05917e0c2d3c68d7bf729bf79d3ca39ec48fe05c 100644 (file)
@@ -240,6 +240,6 @@ can set the <tt class="docutils literal">INLINESTYLES</tt> option to True.</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:48.842433
+<!-- generated on: 2012-03-10 22:10:14.077803
      file id: moinmoin -->
 </html>
\ No newline at end of file
index 824c90457d3ac34fddc536e7d87b93303c5ef284..a6115fb5b851a726cdfd1ee9a489962c52aca94b 100644 (file)
@@ -278,7 +278,7 @@ entrypoint is the name of the filter:</p>
 <h3>How To Use Entrypoints</h3>
 <p>This documentation doesn't explain how to use those entrypoints because this is
 covered in the <a class="reference external" href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools documentation</a>. That page should cover everything
-you need to write a plugin. Also <a class="reference external" href="http://lucumr.pocoo.org/2006/7/30/setuptools-plugins">this blog entry</a> might be interesting.</p>
+you need to write a plugin.</p>
 </div>
 <div class="section" id="extending-the-core">
 <h3>Extending The Core</h3>
@@ -289,6 +289,6 @@ distribution.</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:48.935660
+<!-- generated on: 2012-03-10 22:10:14.187118
      file id: plugins -->
 </html>
\ No newline at end of file
index 1dbd57a0fb2386b420c7723b6b048f1c9bff0bdd..57a509d2b1b9966049be2bfbe484f458b279cf83 100644 (file)
@@ -385,6 +385,6 @@ $ pygmentize -S default -f html &gt; style.css
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:48.867231
+<!-- generated on: 2012-03-10 22:10:14.106454
      file id: quickstart -->
 </html>
\ No newline at end of file
index 55148600ca1a11801824ba259d9870771e7fbf11..00a450dfea0cac0a9898aefebbd76feeac39114c 100644 (file)
@@ -224,6 +224,6 @@ if the `handlecodeblocks` option is true. -->
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.547371
+<!-- generated on: 2012-03-10 22:10:14.980838
      file id: rstdirective -->
 </html>
\ No newline at end of file
index 3778f92bf6d8559d86e2f571ddcb72d0ef2a7ec2..39b2560dec5fab026fe350bff12b204db373ca68 100644 (file)
@@ -287,7 +287,7 @@ directory.</li>
 <dt><tt class="docutils literal">bold</tt></dt>
 <dd>render text as bold</dd>
 <dt><tt class="docutils literal">nobold</tt></dt>
-<dd>don't render text as bold (to prevent subtokens behing highlighted bold)</dd>
+<dd>don't render text as bold (to prevent subtokens being highlighted bold)</dd>
 <dt><tt class="docutils literal">italic</tt></dt>
 <dd>render text italic</dd>
 <dt><tt class="docutils literal">noitalic</tt></dt>
@@ -336,6 +336,6 @@ a way to iterate over all styles:</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.346455
+<!-- generated on: 2012-03-10 22:10:14.740063
      file id: styles -->
 </html>
\ No newline at end of file
index cbc501a1f1f4ca9d23ba5aafb357e466265ba486..943c1de582421db2ecad7f582dfc032346b4a1ed 100644 (file)
@@ -501,7 +501,7 @@ in Ruby).</dd>
 <dd>Token type for comments that end at the end of a line (e.g. <tt class="docutils literal"># foo</tt>).</dd>
 <dt><cite>Comment.Special</cite></dt>
 <dd>Special data in comments. For example code tags, author and license
-informations etc.</dd>
+information, etc.</dd>
 </dl>
 </div>
 <div class="section" id="generic-tokens">
@@ -536,6 +536,6 @@ highlight a programming language but a patch file.</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.406395
+<!-- generated on: 2012-03-10 22:10:14.809717
      file id: tokens -->
 </html>
\ No newline at end of file
index dfce253c24a260dfec619e4916783cf834a7cf4d..4b81b5bbc3ba162f12e13598056986999846c124 100644 (file)
@@ -244,6 +244,6 @@ input and output encodings.</p>
 
   </div>
 </body>
-<!-- generated on: 2011-01-03 18:05:49.568120
+<!-- generated on: 2012-03-10 22:10:15.004712
      file id: unicode -->
 </html>
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index e5e7eaa..0ceeb58
@@ -6,7 +6,7 @@
 
     Generates a bunch of html files containing the documentation.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -56,7 +56,7 @@ def generate_lexer_docs():
             classname,
             cls.__doc__,
             ', '.join(data[2]) or 'None',
-            ', '.join(data[3]).replace('*', '\\*') or 'None',
+            ', '.join(data[3]).replace('*', '\\*').replace('_', '\\') or 'None',
             ', '.join(data[4]) or 'None'))
         if module not in moduledocstrings:
             moduledocstrings[module] = mod.__doc__
index b67d6c87860397e1db7a512fb16c24d11f8e62bd..6ffc4b72a2721271472ddb2eb48daac14fe0801c 100644 (file)
@@ -121,7 +121,7 @@ sections, comments and key = value pairs:
         }
 
 The lexer first looks for whitespace, comments and section names. And later it
-looks for a line that looks like a key, value pair, seperated by an ``'='``
+looks for a line that looks like a key, value pair, separated by an ``'='``
 sign, and optional whitespace.
 
 The `bygroups` helper makes sure that each group is yielded with a different
index 335cf4ce1fc7d4db736950d32cb10a6033a03933..a6f8d7b007d7706f4ebb528177adb576666fb3e5 100644 (file)
@@ -80,10 +80,9 @@ How To Use Entrypoints
 
 This documentation doesn't explain how to use those entrypoints because this is
 covered in the `setuptools documentation`_. That page should cover everything
-you need to write a plugin. Also `this blog entry`_ might be interesting.
+you need to write a plugin.
 
 .. _setuptools documentation: http://peak.telecommunity.com/DevCenter/setuptools
-.. _this blog entry: http://lucumr.pocoo.org/2006/7/30/setuptools-plugins
 
 
 Extending The Core
index acb70c37e14e90aeb2f7289909f6abd1f5e5e809..e3e9cfb32e60861f2de62da76b806375c75f932e 100644 (file)
@@ -85,7 +85,7 @@ Here a small overview of all allowed styles:
 ``bold``
     render text as bold
 ``nobold``
-    don't render text as bold (to prevent subtokens behing highlighted bold)
+    don't render text as bold (to prevent subtokens being highlighted bold)
 ``italic``
     render text italic
 ``noitalic``
index 9ef0df8d227a5daf6d3a6f61b6cd70fe89771470..4900a9abb5e6c12542668b7bfed426bc6f524dbe 100644 (file)
@@ -303,7 +303,7 @@ Comments
 
 `Comment.Special`
     Special data in comments. For example code tags, author and license
-    informations etc.
+    information, etc.
 
 
 Generic Tokens
index 0371af2bc494f0f57354c4e98c8d04971ea5c39d..0d939b67c4d1331506c60d96712561b288a6ae93 100644 (file)
@@ -27,7 +27,7 @@
 
     .. _Markdown: http://www.freewisdom.org/projects/python-markdown/
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 6d55004ff8dac04f18886daceb957acbb6f53672..0bb9791c4d9c4ec4b44a386fbe9b519bbcb8e1f9 100644 (file)
@@ -31,7 +31,7 @@
     If you do not want to do that and are willing to accept larger HTML
     output, you can set the INLINESTYLES option below to True.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index b7877ae715030c170004c5345986650f201080e6..8e703faafb07b56f8ed05157f042fdc236ccfab1 100644 (file)
@@ -31,7 +31,7 @@
     .. _directive documentation:
        http://docutils.sourceforge.net/docs/howto/rst-directives.html
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 934adb54f47e65eb39a23c8e371ee2f5d95a7057..b54b03ef67049977c0b4b4c34c3354436230a988 100644 (file)
@@ -31,7 +31,7 @@
     .. _directive documentation:
        http://docutils.sourceforge.net/docs/howto/rst-directives.html
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index bc8ae83ef12eae111f8d82ed255ccdbe4d179fbd..0ecc167dfd4a8a2ea52fcb316ae9931a0b538406 100644 (file)
     .. _Pygments tip:
        http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
-__version__ = '1.4'
+__version__ = '1.5'
 __docformat__ = 'restructuredtext'
 
 __all__ = ['lex', 'format', 'highlight']
index cfce216ac1072e0745e4e1e40dac4e4691b609d3..e5b9b9b249523bd9fc6975c5ee8592e73d389509 100644 (file)
@@ -5,7 +5,7 @@
 
     Command line interface.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import sys
@@ -219,7 +219,7 @@ def main(args=sys.argv):
         return 0
 
     if opts.pop('-V', None) is not None:
-        print 'Pygments version %s, (c) 2006-2008 by Georg Brandl.' % __version__
+        print 'Pygments version %s, (c) 2006-2011 by Georg Brandl.' % __version__
         return 0
 
     # handle ``pygmentize -L``
@@ -408,6 +408,9 @@ def main(args=sys.argv):
                                          None) or 'ascii'
                 fmter.encoding = getattr(sys.stdout, 'encoding',
                                          None) or 'ascii'
+    elif not outfn and sys.version_info > (3,):
+        # output to terminal with encoding -> use .buffer
+        outfile = sys.stdout.buffer
 
     # ... and do it!
     try:
index 92a8c6d81dff9cda931baf2ba79a2e30594960bf..3901bd18ea5266edce5f60efa4cca6679a4208da 100644 (file)
@@ -5,7 +5,7 @@
 
     Format colored console output.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index acb0d0ada4caf0e17fc95d5c2d9d2d12315e9df0..de1bf79c6491894223f888f681074b60fd4150fc 100644 (file)
@@ -5,7 +5,7 @@
 
     Module that implements the default filter.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 504c3e1e47f17d3c03b63b9c64f79cb44c5974dd..b816c58c70605b128ed8c20eba02eb9bc3de6344 100644 (file)
@@ -6,7 +6,7 @@
     Module containing filter lookup functions and default
     filters.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 6eea3d75f1782e794c4b6c5b0a7ee662170d6ca7..7312484621720c73362971d01794f380977cfc83 100644 (file)
@@ -5,7 +5,7 @@
 
     Base formatter class.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 0e02a522b082082d89f30f41e0099edd0520feee..da0fd51eda7f7d528019cdef3832d4e157f8e3c7 100644 (file)
@@ -5,7 +5,7 @@
 
     Pygments formatters.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import os.path
index 0c344a7a969e087e8bf3c0877452e364dbddea41..b64eb685d9b5ae98663663d55ebae983f04cbecc 100755 (executable)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 """
     pygments.formatters._mapping
-    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     Formatter mapping defintions. This file is generated by itself. Everytime
     you change something on a builtin formatter defintion, run this script from
@@ -9,7 +9,7 @@
 
     Do not alter the FORMATTERS dictionary by hand.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 03852b3e2a25381af034dc30843e6ee745bcc127..a0d50553f3540160464afb8fabd8ed10bf51d525 100644 (file)
@@ -5,7 +5,7 @@
 
     BBcode formatter.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index d1172c7fc9a9ba1ae591d699028cdd2786c3e3e3..85a16ff8d7cc94d6dc889295bc1509142a527572 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for HTML output.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -596,7 +596,7 @@ class HtmlFormatter(Formatter):
 
     def _wrap_lineanchors(self, inner):
         s = self.lineanchors
-        i = 0
+        i = self.linenostart - 1 # subtract 1 since we have to increment i *before* yielding
         for t, line in inner:
             if t:
                 i += 1
index 62f5f9b37ceb587a88c37ad7735b9d581a9e92ee..e2267f5e92d545e4f7c570adad0734f027fba33e 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for Pixmap output.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index cc46442061ef477fcc89a561c52ef63e1dc480d0..3406548a3ddd10cb59acf42b18bd1bd6762d28da 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for LaTeX fancyvrb output.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -26,6 +26,9 @@ def escape_tex(text, commandprefix):
                 replace('\x02', r'\%sZcb{}' % commandprefix). \
                 replace('^', r'\%sZca{}' % commandprefix). \
                 replace('_', r'\%sZus{}' % commandprefix). \
+                replace('&', r'\%sZam{}' % commandprefix). \
+                replace('<', r'\%sZlt{}' % commandprefix). \
+                replace('>', r'\%sZgt{}' % commandprefix). \
                 replace('#', r'\%sZsh{}' % commandprefix). \
                 replace('%', r'\%sZpc{}' % commandprefix). \
                 replace('$', r'\%sZdl{}' % commandprefix). \
@@ -106,6 +109,9 @@ STYLE_TEMPLATE = r'''
 \def\%(cp)sZob{\char`\{}
 \def\%(cp)sZcb{\char`\}}
 \def\%(cp)sZca{\char`\^}
+\def\%(cp)sZam{\char`\&}
+\def\%(cp)sZlt{\char`\<}
+\def\%(cp)sZgt{\char`\>}
 \def\%(cp)sZsh{\char`\#}
 \def\%(cp)sZpc{\char`\%%}
 \def\%(cp)sZdl{\char`\$}
@@ -258,11 +264,13 @@ class LatexFormatter(Formatter):
                 cmndef += (r'\def\$$@tc##1{\textcolor[rgb]{%s}{##1}}' %
                            rgbcolor(ndef['color']))
             if ndef['border']:
-                cmndef += (r'\def\$$@bc##1{\fcolorbox[rgb]{%s}{%s}{##1}}' %
+                cmndef += (r'\def\$$@bc##1{\setlength{\fboxsep}{0pt}'
+                           r'\fcolorbox[rgb]{%s}{%s}{\strut ##1}}' %
                            (rgbcolor(ndef['border']),
                             rgbcolor(ndef['bgcolor'])))
             elif ndef['bgcolor']:
-                cmndef += (r'\def\$$@bc##1{\colorbox[rgb]{%s}{##1}}' %
+                cmndef += (r'\def\$$@bc##1{\setlength{\fboxsep}{0pt}'
+                           r'\colorbox[rgb]{%s}{\strut ##1}}' %
                            rgbcolor(ndef['bgcolor']))
             if cmndef == '':
                 continue
@@ -278,7 +286,8 @@ class LatexFormatter(Formatter):
         cp = self.commandprefix
         styles = []
         for name, definition in self.cmd2def.iteritems():
-            styles.append(r'\def\%s@tok@%s{%s}' % (cp, name, definition))
+            styles.append(r'\expandafter\def\csname %s@tok@%s\endcsname{%s}' %
+                          (cp, name, definition))
         return STYLE_TEMPLATE % {'cp': self.commandprefix,
                                  'styles': '\n'.join(styles)}
 
index 249291a814680ff1dd8c54705eedb8e409cc3774..a19e4ce0130442d543b35ce9b71cf1628b4d8e6e 100644 (file)
@@ -5,7 +5,7 @@
 
     Other formatters: NullFormatter, RawTokenFormatter.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 83414c589d8be4ee63f8016969ea284de73b6dcd..5627d0704f94c279d6e5f9e364b2e275df8926a2 100644 (file)
@@ -5,7 +5,7 @@
 
     A formatter that generates RTF files.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 9928345abc48083cf3da1c758c52f06f1809cbf9..f08e65701bcbcdb11771902d3eeeba7c5cd92c67 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for SVG output.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index fc05cad7f9ac394d8d2cd2448f6849c68a9a96c4..dae00157df84177a6df248c5a3d3b3f1de0472de 100644 (file)
@@ -5,10 +5,12 @@
 
     Formatter for terminal output with ANSI sequences.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
+import sys
+
 from pygments.formatter import Formatter
 from pygments.token import Keyword, Name, Comment, String, Error, \
      Number, Operator, Generic, Token, Whitespace
@@ -86,7 +88,8 @@ class TerminalFormatter(Formatter):
         # hack: if the output is a terminal and has an encoding set,
         # use that to avoid unicode encode problems
         if not self.encoding and hasattr(outfile, "encoding") and \
-           hasattr(outfile, "isatty") and outfile.isatty():
+           hasattr(outfile, "isatty") and outfile.isatty() and \
+           sys.version_info < (3,):
             self.encoding = outfile.encoding
         return Formatter.format(self, tokensource, outfile)
 
index d72a939e7d001ee34426a3ebbbb95efb05ca56a6..cbd30be1424dfcc2836ad53a56a240ca95c8eca6 100644 (file)
@@ -11,7 +11,7 @@
 
     Formatter version 1.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -24,6 +24,8 @@
 #    black-on-while, so colors like "white background" need to be converted
 #    to "white background, black foreground", etc...
 
+import sys
+
 from pygments.formatter import Formatter
 
 
@@ -185,7 +187,8 @@ class Terminal256Formatter(Formatter):
         # hack: if the output is a terminal and has an encoding set,
         # use that to avoid unicode encode problems
         if not self.encoding and hasattr(outfile, "encoding") and \
-           hasattr(outfile, "isatty") and outfile.isatty():
+           hasattr(outfile, "isatty") and outfile.isatty() and \
+           sys.version_info < (3,):
             self.encoding = outfile.encoding
         return Formatter.format(self, tokensource, outfile)
 
index a22768a3a27fc464173cc25e4dc88dd180dd1901..82f0931899eda590f93892a04a07d99a2b49923d 100644 (file)
@@ -5,7 +5,7 @@
 
     Base lexer classes.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import re
@@ -21,6 +21,12 @@ __all__ = ['Lexer', 'RegexLexer', 'ExtendedRegexLexer', 'DelegatingLexer',
            'LexerContext', 'include', 'bygroups', 'using', 'this']
 
 
+_encoding_map = [('\xef\xbb\xbf', 'utf-8'),
+                 ('\xff\xfe\0\0', 'utf-32'),
+                 ('\0\0\xfe\xff', 'utf-32be'),
+                 ('\xff\xfe', 'utf-16'),
+                 ('\xfe\xff', 'utf-16be')]
+
 _default_analyse = staticmethod(lambda x: 0.0)
 
 
@@ -142,8 +148,19 @@ class Lexer(object):
                     raise ImportError('To enable chardet encoding guessing, '
                                       'please install the chardet library '
                                       'from http://chardet.feedparser.org/')
-                enc = chardet.detect(text)
-                text = text.decode(enc['encoding'])
+                # check for BOM first
+                decoded = None
+                for bom, encoding in _encoding_map:
+                    if text.startswith(bom):
+                        decoded = unicode(text[len(bom):], encoding,
+                                          errors='replace')
+                        break
+                # no BOM found, so use chardet
+                if decoded is None:
+                    enc = chardet.detect(text[:1024]) # Guess using first 1KB
+                    decoded = unicode(text, enc.get('encoding') or 'utf-8',
+                                      errors='replace')
+                text = decoded
             else:
                 text = text.decode(self.encoding)
         # text now *is* a unicode string
@@ -274,12 +291,14 @@ def bygroups(*args):
                 if data:
                     yield match.start(i + 1), action, data
             else:
-                if ctx:
-                    ctx.pos = match.start(i + 1)
-                for item in action(lexer, _PseudoMatch(match.start(i + 1),
-                                   match.group(i + 1)), ctx):
-                    if item:
-                        yield item
+                data = match.group(i + 1)
+                if data is not None:
+                    if ctx:
+                        ctx.pos = match.start(i + 1)
+                    for item in action(lexer, _PseudoMatch(match.start(i + 1),
+                                       data), ctx):
+                        if item:
+                            yield item
         if ctx:
             ctx.pos = match.end()
     return callback
@@ -439,7 +458,7 @@ class RegexLexerMeta(LexerMeta):
 
     def __call__(cls, *args, **kwds):
         """Instantiate cls after preprocessing its token definitions."""
-        if not hasattr(cls, '_tokens'):
+        if '_tokens' not in cls.__dict__:
             cls._all_tokens = {}
             cls._tmpname = 0
             if hasattr(cls, 'token_variants') and cls.token_variants:
index cce7e9b615201afc53ce3f497c40ce0b2c9576d0..eb8609d4442654c8b75c76a2f22806615d4e9dd0 100644 (file)
@@ -5,7 +5,7 @@
 
     Pygments lexers.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -93,30 +93,32 @@ def get_lexer_for_filename(_fn, code=None, **options):
             if fnmatch.fnmatch(fn, filename):
                 if name not in _lexer_cache:
                     _load_lexers(modname)
-                matches.append(_lexer_cache[name])
+                matches.append((_lexer_cache[name], filename))
     for cls in find_plugin_lexers():
         for filename in cls.filenames:
             if fnmatch.fnmatch(fn, filename):
-                matches.append(cls)
+                matches.append((cls, filename))
 
     if sys.version_info > (3,) and isinstance(code, bytes):
         # decode it, since all analyse_text functions expect unicode
         code = code.decode('latin1')
 
-    def get_rating(cls):
+    def get_rating(info):
+        cls, filename = info
+        # explicit patterns get a bonus
+        bonus = '*' not in filename and 0.5 or 0
         # The class _always_ defines analyse_text because it's included in
         # the Lexer class.  The default implementation returns None which
         # gets turned into 0.0.  Run scripts/detect_missing_analyse_text.py
         # to find lexers which need it overridden.
-        d = cls.analyse_text(code)
-        #print "Got %r from %r" % (d, cls)
-        return d
+        if code:
+            return cls.analyse_text(code) + bonus
+        return bonus
 
-    if code:
-        matches.sort(key=get_rating)
     if matches:
+        matches.sort(key=get_rating)
         #print "Possible lexers, after sort:", matches
-        return matches[-1](**options)
+        return matches[-1][0](**options)
     raise ClassNotFound('no lexer for filename %r found' % _fn)
 
 
@@ -139,7 +141,8 @@ def _iter_lexerclasses():
     """
     Return an iterator over all lexer classes.
     """
-    for module_name, name, _, _, _ in LEXERS.itervalues():
+    for key in sorted(LEXERS):
+        module_name, name = LEXERS[key][:2]
         if name not in _lexer_cache:
             _load_lexers(module_name)
         yield _lexer_cache[name]
index fbfd937eaffb85b8fa9e46adf64f3964ffa6e49f..d2edace66f620e119f7b1cd8375bfdc7982855e0 100644 (file)
@@ -10,7 +10,7 @@
     TODO: perl/python script in Asymptote SVN similar to asy-list.pl but only
     for function and variable names.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 03e5cad4a8cff33ea729b8719f5d0647682a00ac..3a3b3dfc948d1206e98c410ddb2b1336417a0286 100644 (file)
@@ -5,7 +5,7 @@
 
     ANSI Common Lisp builtins.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 502a3e6303c3256be68a4240dbf126d9219a4ad1..27b398227088b00a496cca76dd9a0d4b0dacd166 100644 (file)
@@ -9,7 +9,7 @@
 
     Do not edit the MODULES dict by hand.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 4444e7b0ba2b6f456f2c988cd6b553cf4c78ccf8..7c745a89e2e96b3143ce679eeaae413fb432297b 100644 (file)
@@ -9,14 +9,14 @@
 
     Do not alter the LEXERS dictionary by hand.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
 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')),
+    'ActionScriptLexer': ('pygments.lexers.web', 'ActionScript', ('as', 'actionscript'), ('*.as',), ('application/x-actionscript3', 'text/x-actionscript3', 'text/actionscript3')),
     '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'), ()),
@@ -31,29 +31,33 @@ LEXERS = {
     'AppleScriptLexer': ('pygments.lexers.other', 'AppleScript', ('applescript',), ('*.applescript',), ()),
     'AsymptoteLexer': ('pygments.lexers.other', 'Asymptote', ('asy', 'asymptote'), ('*.asy',), ('text/x-asymptote',)),
     'AutohotkeyLexer': ('pygments.lexers.other', 'autohotkey', ('ahk',), ('*.ahk', '*.ahkl'), ('text/x-autohotkey',)),
+    'AwkLexer': ('pygments.lexers.other', 'Awk', ('awk', 'gawk', 'mawk', 'nawk'), ('*.awk',), ('application/x-awk',)),
     'BBCodeLexer': ('pygments.lexers.text', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)),
-    'BaseMakefileLexer': ('pygments.lexers.text', 'Makefile', ('basemake',), (), ()),
-    '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',)),
+    'BaseMakefileLexer': ('pygments.lexers.text', 'Base Makefile', ('basemake',), (), ()),
+    'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '.bashrc', 'bashrc', '.bash_*', 'bash_*'), ('application/x-sh', 'application/x-shellscript')),
+    'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console',), ('*.sh-session',), ('application/x-shell-session',)),
+    'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('bat',), ('*.bat', '*.cmd'), ('application/x-dos-batch',)),
     'BefungeLexer': ('pygments.lexers.other', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)),
     'BlitzMaxLexer': ('pygments.lexers.compiled', 'BlitzMax', ('blitzmax', 'bmax'), ('*.bmx',), ('text/x-bmx',)),
     'BooLexer': ('pygments.lexers.dotnet', 'Boo', ('boo',), ('*.boo',), ('text/x-boo',)),
     'BrainfuckLexer': ('pygments.lexers.other', 'Brainfuck', ('brainfuck', 'bf'), ('*.bf', '*.b'), ('application/x-brainfuck',)),
-    'CLexer': ('pygments.lexers.compiled', 'C', ('c',), ('*.c', '*.h'), ('text/x-chdr', 'text/x-csrc')),
+    'BroLexer': ('pygments.lexers.other', 'Bro', ('bro',), ('*.bro',), ()),
+    'CLexer': ('pygments.lexers.compiled', 'C', ('c',), ('*.c', '*.h', '*.idc'), ('text/x-chdr', 'text/x-csrc')),
     'CMakeLexer': ('pygments.lexers.text', 'CMake', ('cmake',), ('*.cmake', 'CMakeLists.txt'), ('text/x-cmake',)),
     'CObjdumpLexer': ('pygments.lexers.asm', 'c-objdump', ('c-objdump',), ('*.c-objdump',), ('text/x-c-objdump',)),
     'CSharpAspxLexer': ('pygments.lexers.dotnet', 'aspx-cs', ('aspx-cs',), ('*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'), ()),
     'CSharpLexer': ('pygments.lexers.dotnet', 'C#', ('csharp', 'c#'), ('*.cs',), ('text/x-csharp',)),
+    'Cfengine3Lexer': ('pygments.lexers.other', 'CFEngine3', ('cfengine3', 'cf3'), ('*.cf',), ()),
     'CheetahHtmlLexer': ('pygments.lexers.templates', 'HTML+Cheetah', ('html+cheetah', 'html+spitfire'), (), ('text/html+cheetah', 'text/html+spitfire')),
     'CheetahJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Cheetah', ('js+cheetah', 'javascript+cheetah', 'js+spitfire', 'javascript+spitfire'), (), ('application/x-javascript+cheetah', 'text/x-javascript+cheetah', 'text/javascript+cheetah', 'application/x-javascript+spitfire', 'text/x-javascript+spitfire', 'text/javascript+spitfire')),
     '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')),
+    'ClojureLexer': ('pygments.lexers.jvm', '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', 'Coldfusion 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',)),
+    'CoqLexer': ('pygments.lexers.functional', 'Coq', ('coq',), ('*.v',), ('text/x-coq',)),
     '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',)),
     'CssDjangoLexer': ('pygments.lexers.templates', 'CSS+Django/Jinja', ('css+django', 'css+jinja'), (), ('text/css+django', 'text/css+jinja')),
@@ -66,21 +70,30 @@ LEXERS = {
     'DLexer': ('pygments.lexers.compiled', 'D', ('d',), ('*.d', '*.di'), ('text/x-dsrc',)),
     'DObjdumpLexer': ('pygments.lexers.asm', 'd-objdump', ('d-objdump',), ('*.d-objdump',), ('text/x-d-objdump',)),
     'DarcsPatchLexer': ('pygments.lexers.text', 'Darcs Patch', ('dpatch',), ('*.dpatch', '*.darcspatch'), ()),
+    'DartLexer': ('pygments.lexers.web', 'Dart', ('dart',), ('*.dart',), ('text/x-dart',)),
     'DebianControlLexer': ('pygments.lexers.text', 'Debian Control file', ('control',), ('control',), ()),
     'DelphiLexer': ('pygments.lexers.compiled', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas',), ('text/x-pascal',)),
     'DiffLexer': ('pygments.lexers.text', 'Diff', ('diff', 'udiff'), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')),
     'DjangoLexer': ('pygments.lexers.templates', 'Django/Jinja', ('django', 'jinja'), (), ('application/x-django-templating', 'application/x-jinja')),
+    'DtdLexer': ('pygments.lexers.web', 'DTD', ('dtd',), ('*.dtd',), ('application/xml-dtd',)),
     'DuelLexer': ('pygments.lexers.web', 'Duel', ('duel', 'Duel Engine', 'Duel View', 'JBST', 'jbst', 'JsonML+BST'), ('*.duel', '*.jbst'), ('text/x-duel', 'text/x-jbst')),
     'DylanLexer': ('pygments.lexers.compiled', 'Dylan', ('dylan',), ('*.dylan', '*.dyl'), ('text/x-dylan',)),
+    'ECLLexer': ('pygments.lexers.other', 'ECL', ('ecl',), ('*.ecl',), ('application/x-ecl',)),
+    'ECLexer': ('pygments.lexers.compiled', 'eC', ('ec',), ('*.ec', '*.eh'), ('text/x-echdr', 'text/x-ecsrc')),
+    'ElixirConsoleLexer': ('pygments.lexers.functional', 'Elixir iex session', ('iex',), (), ('text/x-elixir-shellsession',)),
+    'ElixirLexer': ('pygments.lexers.functional', 'Elixir', ('elixir', 'ex', 'exs'), ('*.ex', '*.exs'), ('text/x-elixir',)),
     'ErbLexer': ('pygments.lexers.templates', 'ERB', ('erb',), (), ('application/x-ruby-templating',)),
-    'ErlangLexer': ('pygments.lexers.functional', 'Erlang', ('erlang',), ('*.erl', '*.hrl'), ('text/x-erlang',)),
+    'ErlangLexer': ('pygments.lexers.functional', 'Erlang', ('erlang',), ('*.erl', '*.hrl', '*.es', '*.escript'), ('text/x-erlang',)),
     'ErlangShellLexer': ('pygments.lexers.functional', 'Erlang erl session', ('erl',), ('*.erl-sh',), ('text/x-erl-shellsession',)),
     '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',)),
+    'FSharpLexer': ('pygments.lexers.dotnet', 'FSharp', ('fsharp',), ('*.fs', '*.fsi'), ('text/x-fsharp',)),
     'FactorLexer': ('pygments.lexers.agile', 'Factor', ('factor',), ('*.factor',), ('text/x-factor',)),
+    'FancyLexer': ('pygments.lexers.agile', 'Fancy', ('fancy', 'fy'), ('*.fy', '*.fancypack'), ('text/x-fancysrc',)),
+    'FantomLexer': ('pygments.lexers.compiled', 'Fantom', ('fan',), ('*.fan',), ('application/x-fantom',)),
     'FelixLexer': ('pygments.lexers.compiled', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)),
-    'FortranLexer': ('pygments.lexers.compiled', 'Fortran', ('fortran',), ('*.f', '*.f90'), ('text/x-fortran',)),
+    'FortranLexer': ('pygments.lexers.compiled', 'Fortran', ('fortran',), ('*.f', '*.f90', '*.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',)),
     'GenshiLexer': ('pygments.lexers.templates', 'Genshi', ('genshi', 'kid', 'xml+genshi', 'xml+kid'), ('*.kid',), ('application/x-genshi', 'application/x-kid')),
@@ -90,7 +103,10 @@ LEXERS = {
     'GnuplotLexer': ('pygments.lexers.other', 'Gnuplot', ('gnuplot',), ('*.plot', '*.plt'), ('text/x-gnuplot',)),
     'GoLexer': ('pygments.lexers.compiled', 'Go', ('go',), ('*.go',), ('text/x-gosrc',)),
     'GoodDataCLLexer': ('pygments.lexers.other', 'GoodData-CL', ('gooddata-cl',), ('*.gdc',), ('text/x-gooddata-cl',)),
+    'GosuLexer': ('pygments.lexers.jvm', 'Gosu', ('gosu',), ('*.gs', '*.gsx', '*.gsp', '*.vark'), ('text/x-gosu',)),
+    'GosuTemplateLexer': ('pygments.lexers.jvm', 'Gosu Template', ('gst',), ('*.gst',), ('text/x-gosu-template',)),
     'GroffLexer': ('pygments.lexers.text', 'Groff', ('groff', 'nroff', 'man'), ('*.[1234567]', '*.man'), ('application/x-troff', 'text/troff')),
+    'GroovyLexer': ('pygments.lexers.jvm', 'Groovy', ('groovy',), ('*.groovy',), ('text/x-groovy',)),
     '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',)),
@@ -99,13 +115,15 @@ LEXERS = {
     'HtmlLexer': ('pygments.lexers.web', 'HTML', ('html',), ('*.html', '*.htm', '*.xhtml', '*.xslt'), ('text/html', 'application/xhtml+xml')),
     'HtmlPhpLexer': ('pygments.lexers.templates', 'HTML+PHP', ('html+php',), ('*.phtml',), ('application/x-php', 'application/x-httpd-php', 'application/x-httpd-php3', 'application/x-httpd-php4', 'application/x-httpd-php5')),
     'HtmlSmartyLexer': ('pygments.lexers.templates', 'HTML+Smarty', ('html+smarty',), (), ('text/html+smarty',)),
+    'HttpLexer': ('pygments.lexers.text', 'HTTP', ('http',), (), ()),
     'HybrisLexer': ('pygments.lexers.other', 'Hybris', ('hybris', 'hy'), ('*.hy', '*.hyb'), ('text/x-hybris', 'application/x-hybris')),
     'IniLexer': ('pygments.lexers.text', 'INI', ('ini', 'cfg'), ('*.ini', '*.cfg'), ('text/x-ini',)),
     'IoLexer': ('pygments.lexers.agile', 'Io', ('io',), ('*.io',), ('text/x-iosrc',)),
-    'IokeLexer': ('pygments.lexers.agile', 'Ioke', ('ioke', 'ik'), ('*.ik',), ('text/x-iokesrc',)),
+    'IokeLexer': ('pygments.lexers.jvm', 'Ioke', ('ioke', 'ik'), ('*.ik',), ('text/x-iokesrc',)),
     'IrcLogsLexer': ('pygments.lexers.text', 'IRC logs', ('irc',), ('*.weechatlog',), ('text/x-irclog',)),
+    'JSONLexer': ('pygments.lexers.web', 'JSON', ('json',), ('*.json',), ('application/json',)),
     'JadeLexer': ('pygments.lexers.web', 'Jade', ('jade', 'JADE'), ('*.jade',), ('text/x-jade',)),
-    'JavaLexer': ('pygments.lexers.compiled', 'Java', ('java',), ('*.java',), ('text/x-java',)),
+    'JavaLexer': ('pygments.lexers.jvm', 'Java', ('java',), ('*.java',), ('text/x-java',)),
     'JavascriptDjangoLexer': ('pygments.lexers.templates', 'JavaScript+Django/Jinja', ('js+django', 'javascript+django', 'js+jinja', 'javascript+jinja'), (), ('application/x-javascript+django', 'application/x-javascript+jinja', 'text/x-javascript+django', 'text/x-javascript+jinja', 'text/javascript+django', 'text/javascript+jinja')),
     'JavascriptErbLexer': ('pygments.lexers.templates', 'JavaScript+Ruby', ('js+erb', 'javascript+erb', 'js+ruby', 'javascript+ruby'), (), ('application/x-javascript+ruby', 'text/x-javascript+ruby', 'text/javascript+ruby')),
     'JavascriptGenshiLexer': ('pygments.lexers.templates', 'JavaScript+Genshi Text', ('js+genshitext', 'js+genshi', 'javascript+genshitext', 'javascript+genshi'), (), ('application/x-javascript+genshi', 'text/x-javascript+genshi', 'text/javascript+genshi')),
@@ -113,6 +131,7 @@ LEXERS = {
     'JavascriptPhpLexer': ('pygments.lexers.templates', 'JavaScript+PHP', ('js+php', 'javascript+php'), (), ('application/x-javascript+php', 'text/x-javascript+php', 'text/javascript+php')),
     'JavascriptSmartyLexer': ('pygments.lexers.templates', 'JavaScript+Smarty', ('js+smarty', 'javascript+smarty'), (), ('application/x-javascript+smarty', 'text/x-javascript+smarty', 'text/javascript+smarty')),
     'JspLexer': ('pygments.lexers.templates', 'Java Server Page', ('jsp',), ('*.jsp',), ('application/x-jsp',)),
+    'KotlinLexer': ('pygments.lexers.jvm', 'Kotlin', ('kotlin',), ('*.kt',), ('text/x-kotlin',)),
     'LighttpdConfLexer': ('pygments.lexers.text', 'Lighttpd configuration file', ('lighty', 'lighttpd'), (), ('text/x-lighttpd-conf',)),
     'LiterateHaskellLexer': ('pygments.lexers.functional', 'Literate Haskell', ('lhs', 'literate-haskell'), ('*.lhs',), ('text/x-literate-haskell',)),
     'LlvmLexer': ('pygments.lexers.asm', 'LLVM', ('llvm',), ('*.ll',), ('text/x-llvm',)),
@@ -127,37 +146,48 @@ LEXERS = {
     'MakoXmlLexer': ('pygments.lexers.templates', 'XML+Mako', ('xml+mako',), (), ('application/xml+mako',)),
     'MaqlLexer': ('pygments.lexers.other', 'MAQL', ('maql',), ('*.maql',), ('text/x-gooddata-maql', 'application/x-gooddata-maql')),
     'MasonLexer': ('pygments.lexers.templates', 'Mason', ('mason',), ('*.m', '*.mhtml', '*.mc', '*.mi', 'autohandler', 'dhandler'), ('application/x-mason',)),
-    'MatlabLexer': ('pygments.lexers.math', 'Matlab', ('matlab', 'octave'), ('*.m',), ('text/matlab',)),
+    'MatlabLexer': ('pygments.lexers.math', 'Matlab', ('matlab',), ('*.m',), ('text/matlab',)),
     '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',)),
+    'MoonScriptLexer': ('pygments.lexers.agile', 'MoonScript', ('moon', 'moonscript'), ('*.moon',), ('text/x-moonscript', 'application/x-moonscript')),
     'MuPADLexer': ('pygments.lexers.math', 'MuPAD', ('mupad',), ('*.mu',), ()),
     'MxmlLexer': ('pygments.lexers.web', 'MXML', ('mxml',), ('*.mxml',), ()),
-    'MySqlLexer': ('pygments.lexers.other', 'MySQL', ('mysql',), (), ('text/x-mysql',)),
+    'MySqlLexer': ('pygments.lexers.sql', 'MySQL', ('mysql',), (), ('text/x-mysql',)),
     'MyghtyCssLexer': ('pygments.lexers.templates', 'CSS+Myghty', ('css+myghty',), (), ('text/css+myghty',)),
     'MyghtyHtmlLexer': ('pygments.lexers.templates', 'HTML+Myghty', ('html+myghty',), (), ('text/html+myghty',)),
     'MyghtyJavascriptLexer': ('pygments.lexers.templates', 'JavaScript+Myghty', ('js+myghty', 'javascript+myghty'), (), ('application/x-javascript+myghty', 'text/x-javascript+myghty', 'text/javascript+mygthy')),
     'MyghtyLexer': ('pygments.lexers.templates', 'Myghty', ('myghty',), ('*.myt', 'autodelegate'), ('application/x-myghty',)),
     'MyghtyXmlLexer': ('pygments.lexers.templates', 'XML+Myghty', ('xml+myghty',), (), ('application/xml+myghty',)),
     'NasmLexer': ('pygments.lexers.asm', 'NASM', ('nasm',), ('*.asm', '*.ASM'), ('text/x-nasm',)),
+    'NemerleLexer': ('pygments.lexers.dotnet', 'Nemerle', ('nemerle',), ('*.n',), ('text/x-nemerle',)),
+    'NewLispLexer': ('pygments.lexers.functional', 'NewLisp', ('newlisp',), ('*.lsp', '*.nl'), ('text/x-newlisp', 'application/x-newlisp')),
     'NewspeakLexer': ('pygments.lexers.other', 'Newspeak', ('newspeak',), ('*.ns2',), ('text/x-newspeak',)),
     'NginxConfLexer': ('pygments.lexers.text', 'Nginx configuration file', ('nginx',), (), ('text/x-nginx-conf',)),
+    'NimrodLexer': ('pygments.lexers.compiled', 'Nimrod', ('nimrod', 'nim'), ('*.nim', '*.nimrod'), ('text/x-nimrod',)),
     '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',)),
+    'OctaveLexer': ('pygments.lexers.math', 'Octave', ('octave',), ('*.m',), ('text/octave',)),
     'OocLexer': ('pygments.lexers.compiled', 'Ooc', ('ooc',), ('*.ooc',), ('text/x-ooc',)),
+    'OpaLexer': ('pygments.lexers.functional', 'Opa', ('opa',), ('*.opa',), ('text/x-opa',)),
+    'OpenEdgeLexer': ('pygments.lexers.other', 'OpenEdge ABL', ('openedge', 'abl', 'progress'), ('*.p', '*.cls'), ('text/x-openedge', 'application/x-openedge')),
     'PerlLexer': ('pygments.lexers.agile', 'Perl', ('perl', 'pl'), ('*.pl', '*.pm'), ('text/x-perl', 'application/x-perl')),
     'PhpLexer': ('pygments.lexers.web', 'PHP', ('php', 'php3', 'php4', 'php5'), ('*.php', '*.php[345]'), ('text/x-php',)),
+    'PlPgsqlLexer': ('pygments.lexers.sql', 'PL/pgSQL', ('plpgsql',), (), ('text/x-plpgsql',)),
     'PostScriptLexer': ('pygments.lexers.other', 'PostScript', ('postscript',), ('*.ps', '*.eps'), ('application/postscript',)),
+    'PostgresConsoleLexer': ('pygments.lexers.sql', 'PostgreSQL console (psql)', ('psql', 'postgresql-console', 'postgres-console'), (), ('text/x-postgresql-psql',)),
+    'PostgresLexer': ('pygments.lexers.sql', 'PostgreSQL SQL dialect', ('postgresql', 'postgres'), (), ('text/x-postgresql',)),
     'PovrayLexer': ('pygments.lexers.other', 'POVRay', ('pov',), ('*.pov', '*.inc'), ('text/x-povray',)),
+    'PowerShellLexer': ('pygments.lexers.shell', 'PowerShell', ('powershell', 'posh', 'ps1'), ('*.ps1',), ('text/x-powershell',)),
     'PrologLexer': ('pygments.lexers.compiled', 'Prolog', ('prolog',), ('*.prolog', '*.pro', '*.pl'), ('text/x-prolog',)),
     'PropertiesLexer': ('pygments.lexers.text', 'Properties', ('properties',), ('*.properties',), ('text/x-java-properties',)),
     'ProtoBufLexer': ('pygments.lexers.other', 'Protocol Buffer', ('protobuf',), ('*.proto',), ()),
+    'PyPyLogLexer': ('pygments.lexers.text', 'PyPy Log', ('pypylog', 'pypy'), ('*.pypylog',), ('application/x-pypylog',)),
     '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',)),
@@ -180,38 +210,45 @@ LEXERS = {
     'RubyConsoleLexer': ('pygments.lexers.agile', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)),
     'RubyLexer': ('pygments.lexers.agile', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby'), ('text/x-ruby', 'application/x-ruby')),
     'SLexer': ('pygments.lexers.math', 'S', ('splus', 's', 'r'), ('*.S', '*.R'), ('text/S-plus', 'text/S', 'text/R')),
+    'SMLLexer': ('pygments.lexers.functional', 'Standard ML', ('sml',), ('*.sml', '*.sig', '*.fun'), ('text/x-standardml', 'application/x-standardml')),
     'SassLexer': ('pygments.lexers.web', 'Sass', ('sass', 'SASS'), ('*.sass',), ('text/x-sass',)),
-    'ScalaLexer': ('pygments.lexers.compiled', 'Scala', ('scala',), ('*.scala',), ('text/x-scala',)),
+    'ScalaLexer': ('pygments.lexers.jvm', 'Scala', ('scala',), ('*.scala',), ('text/x-scala',)),
     'ScamlLexer': ('pygments.lexers.web', 'Scaml', ('scaml', 'SCAML'), ('*.scaml',), ('text/x-scaml',)),
-    'SchemeLexer': ('pygments.lexers.functional', 'Scheme', ('scheme', 'scm'), ('*.scm',), ('text/x-scheme', 'application/x-scheme')),
+    'SchemeLexer': ('pygments.lexers.functional', 'Scheme', ('scheme', 'scm'), ('*.scm', '*.ss', '*.rkt'), ('text/x-scheme', 'application/x-scheme')),
+    'ScilabLexer': ('pygments.lexers.math', 'Scilab', ('scilab',), ('*.sci', '*.sce', '*.tst'), ('text/scilab',)),
     'ScssLexer': ('pygments.lexers.web', 'SCSS', ('scss',), ('*.scss',), ('text/x-scss',)),
     'SmalltalkLexer': ('pygments.lexers.other', 'Smalltalk', ('smalltalk', 'squeak'), ('*.st',), ('text/x-smalltalk',)),
     'SmartyLexer': ('pygments.lexers.templates', 'Smarty', ('smarty',), ('*.tpl',), ('application/x-smarty',)),
+    'SnobolLexer': ('pygments.lexers.other', 'Snobol', ('snobol',), ('*.snobol',), ('text/x-snobol',)),
     'SourcesListLexer': ('pygments.lexers.text', 'Debian Sourcelist', ('sourceslist', 'sources.list'), ('sources.list',), ()),
-    'SqlLexer': ('pygments.lexers.other', 'SQL', ('sql',), ('*.sql',), ('text/x-sql',)),
-    'SqliteConsoleLexer': ('pygments.lexers.other', 'sqlite3con', ('sqlite3',), ('*.sqlite3-console',), ('text/x-sqlite3-console',)),
+    'SqlLexer': ('pygments.lexers.sql', 'SQL', ('sql',), ('*.sql',), ('text/x-sql',)),
+    'SqliteConsoleLexer': ('pygments.lexers.sql', 'sqlite3con', ('sqlite3',), ('*.sqlite3-console',), ('text/x-sqlite3-console',)),
     'SquidConfLexer': ('pygments.lexers.text', 'SquidConf', ('squidconf', 'squid.conf', 'squid'), ('squid.conf',), ('text/x-squidconf',)),
     'SspLexer': ('pygments.lexers.templates', 'Scalate Server Page', ('ssp',), ('*.ssp',), ('application/x-ssp',)),
+    'SystemVerilogLexer': ('pygments.lexers.hdl', 'systemverilog', ('sv',), ('*.sv', '*.svh'), ('text/x-systemverilog',)),
     'TclLexer': ('pygments.lexers.agile', 'Tcl', ('tcl',), ('*.tcl',), ('text/x-tcl', 'text/x-script.tcl', 'application/x-tcl')),
-    'TcshLexer': ('pygments.lexers.other', 'Tcsh', ('tcsh', 'csh'), ('*.tcsh', '*.csh'), ('application/x-csh',)),
+    'TcshLexer': ('pygments.lexers.shell', 'Tcsh', ('tcsh', 'csh'), ('*.tcsh', '*.csh'), ('application/x-csh',)),
+    'TeaTemplateLexer': ('pygments.lexers.templates', 'Tea', ('tea',), ('*.tea',), ('text/x-tea',)),
     'TexLexer': ('pygments.lexers.text', 'TeX', ('tex', 'latex'), ('*.tex', '*.aux', '*.toc'), ('text/x-tex', 'text/x-latex')),
     'TextLexer': ('pygments.lexers.special', 'Text only', ('text',), ('*.txt',), ('text/plain',)),
+    'UrbiscriptLexer': ('pygments.lexers.other', 'UrbiScript', ('urbiscript',), ('*.u',), ('application/x-urbiscript',)),
     'ValaLexer': ('pygments.lexers.compiled', 'Vala', ('vala', 'vapi'), ('*.vala', '*.vapi'), ('text/x-vala',)),
     'VbNetAspxLexer': ('pygments.lexers.dotnet', 'aspx-vb', ('aspx-vb',), ('*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'), ()),
     'VbNetLexer': ('pygments.lexers.dotnet', 'VB.net', ('vb.net', 'vbnet'), ('*.vb', '*.bas'), ('text/x-vbnet', 'text/x-vba')),
     'VelocityHtmlLexer': ('pygments.lexers.templates', 'HTML+Velocity', ('html+velocity',), (), ('text/html+velocity',)),
     'VelocityLexer': ('pygments.lexers.templates', 'Velocity', ('velocity',), ('*.vm', '*.fhtml'), ()),
     'VelocityXmlLexer': ('pygments.lexers.templates', 'XML+Velocity', ('xml+velocity',), (), ('application/xml+velocity',)),
-    'VerilogLexer': ('pygments.lexers.hdl', 'verilog', ('v',), ('*.v', '*.sv'), ('text/x-verilog',)),
-    'VimLexer': ('pygments.lexers.text', 'VimL', ('vim',), ('*.vim', '.vimrc'), ('text/x-vim',)),
+    'VerilogLexer': ('pygments.lexers.hdl', 'verilog', ('v',), ('*.v',), ('text/x-verilog',)),
+    'VhdlLexer': ('pygments.lexers.hdl', 'vhdl', ('vhdl',), ('*.vhdl', '*.vhd'), ('text/x-vhdl',)),
+    'VimLexer': ('pygments.lexers.text', 'VimL', ('vim',), ('*.vim', '.vimrc', '.exrc', '.gvimrc', '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc'), ('text/x-vim',)),
     'XQueryLexer': ('pygments.lexers.web', 'XQuery', ('xquery', 'xqy'), ('*.xqy', '*.xquery'), ('text/xquery', 'application/xquery')),
     'XmlDjangoLexer': ('pygments.lexers.templates', 'XML+Django/Jinja', ('xml+django', 'xml+jinja'), (), ('application/xml+django', 'application/xml+jinja')),
     'XmlErbLexer': ('pygments.lexers.templates', 'XML+Ruby', ('xml+erb', 'xml+ruby'), (), ('application/xml+ruby',)),
-    'XmlLexer': ('pygments.lexers.web', 'XML', ('xml',), ('*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd', '*.wsdl'), ('text/xml', 'application/xml', 'image/svg+xml', 'application/rss+xml', 'application/atom+xml', 'application/xsl+xml', 'application/xslt+xml')),
+    'XmlLexer': ('pygments.lexers.web', 'XML', ('xml',), ('*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd', '*.wsdl'), ('text/xml', 'application/xml', 'image/svg+xml', 'application/rss+xml', 'application/atom+xml')),
     'XmlPhpLexer': ('pygments.lexers.templates', 'XML+PHP', ('xml+php',), (), ('application/xml+php',)),
     'XmlSmartyLexer': ('pygments.lexers.templates', 'XML+Smarty', ('xml+smarty',), (), ('application/xml+smarty',)),
-    'XsltLexer': ('pygments.lexers.web', 'XSLT', ('xslt',), ('*.xsl', '*.xslt'), ('text/xml', 'application/xml', 'image/svg+xml', 'application/rss+xml', 'application/atom+xml', 'application/xsl+xml', 'application/xslt+xml')),
-    'YamlLexer': ('pygments.lexers.text', 'YAML', ('yaml',), ('*.yaml', '*.yml'), ('text/x-yaml',))
+    'XsltLexer': ('pygments.lexers.web', 'XSLT', ('xslt',), ('*.xsl', '*.xslt'), ('application/xsl+xml', 'application/xslt+xml')),
+    'YamlLexer': ('pygments.lexers.text', 'YAML', ('yaml',), ('*.yaml', '*.yml'), ('text/x-yaml',)),
 }
 
 if __name__ == '__main__':
@@ -250,6 +287,6 @@ if __name__ == '__main__':
     # write new file
     f = open(__file__, 'w')
     f.write(header)
-    f.write('LEXERS = {\n    %s\n}\n\n' % ',\n    '.join(found_lexers))
+    f.write('LEXERS = {\n    %s,\n}\n\n' % ',\n    '.join(found_lexers))
     f.write(footer)
     f.close()
index 0c0accccc3747f4810f06b883cb39ff0cde14e5a..cd1608f1b2f2903c5886524043c40ef2867a7c27 100644 (file)
              internet connection. don't run that at home, use
              a server ;-)
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
 
 MODULES = {'.NET': ['dotnet_load'],
+ 'APC': ['apc_add',
+         'apc_bin_dump',
+         'apc_bin_dumpfile',
+         'apc_bin_load',
+         'apc_bin_loadfile',
+         'apc_cache_info',
+         'apc_cas',
+         'apc_clear_cache',
+         'apc_compile_file',
+         'apc_dec',
+         'apc_define_constants',
+         'apc_delete_file',
+         'apc_delete',
+         'apc_exists',
+         'apc_fetch',
+         'apc_inc',
+         'apc_load_constants',
+         'apc_sma_info',
+         'apc_store'],
  'APD': ['apd_breakpoint',
          'apd_callstack',
          'apd_clunk',
@@ -29,11 +48,33 @@ MODULES = {'.NET': ['dotnet_load'],
          'apd_echo',
          'apd_get_active_symbols',
          'apd_set_pprof_trace',
-         'apd_set_session',
+         'apd_set_session_trace_socket',
          'apd_set_session_trace',
-         'apd_set_socket_session_trace',
+         'apd_set_session',
          'override_function',
          'rename_function'],
+ 'Aliases and deprecated Mysqli': ['mysqli_bind_param',
+                                   'mysqli_bind_result',
+                                   'mysqli_client_encoding',
+                                   'mysqli_connect',
+                                   'mysqli_disable_reads_from_master',
+                                   'mysqli_disable_rpl_parse',
+                                   'mysqli_enable_reads_from_master',
+                                   'mysqli_enable_rpl_parse',
+                                   'mysqli_escape_string',
+                                   'mysqli_execute',
+                                   'mysqli_fetch',
+                                   'mysqli_get_metadata',
+                                   'mysqli_master_query',
+                                   'mysqli_param_count',
+                                   'mysqli_report',
+                                   'mysqli_rpl_parse_enabled',
+                                   'mysqli_rpl_probe',
+                                   'mysqli_rpl_query_type',
+                                   'mysqli_send_long_data',
+                                   'mysqli_send_query',
+                                   'mysqli_set_opt',
+                                   'mysqli_slave_query'],
  'Apache': ['apache_child_terminate',
             'apache_get_modules',
             'apache_get_version',
@@ -44,88 +85,93 @@ MODULES = {'.NET': ['dotnet_load'],
             'apache_reset_timeout',
             'apache_response_headers',
             'apache_setenv',
-            'ascii2ebcdic',
-            'ebcdic2ascii',
             'getallheaders',
             'virtual'],
- 'Arrays': ['array',
-            'array_change_key_case',
-            'array_chunk',
-            'array_combine',
-            'array_count_values',
-            'array_diff',
-            'array_diff_assoc',
-            'array_diff_key',
-            'array_diff_uassoc',
-            'array_diff_ukey',
-            'array_fill',
-            'array_filter',
-            'array_flip',
-            'array_intersect',
-            'array_intersect_assoc',
-            'array_intersect_key',
-            'array_intersect_uassoc',
-            'array_intersect_ukey',
-            'array_key_exists',
-            'array_keys',
-            'array_map',
-            'array_merge',
-            'array_merge_recursive',
-            'array_multisort',
-            'array_pad',
-            'array_pop',
-            'array_push',
-            'array_rand',
-            'array_reduce',
-            'array_reverse',
-            'array_search',
-            'array_shift',
-            'array_slice',
-            'array_splice',
-            'array_sum',
-            'array_udiff',
-            'array_udiff_assoc',
-            'array_udiff_uassoc',
-            'array_uintersect',
-            'array_uintersect_assoc',
-            'array_uintersect_uassoc',
-            'array_unique',
-            'array_unshift',
-            'array_values',
-            'array_walk',
-            'array_walk_recursive',
-            'arsort',
-            'asort',
-            'compact',
-            'count',
-            'current',
-            'each',
-            'end',
-            'extract',
-            'in_array',
-            'key',
-            'krsort',
-            'ksort',
-            'list',
-            'natcasesort',
-            'natsort',
-            'next',
-            'pos',
-            'prev',
-            'range',
-            'reset',
-            'rsort',
-            'shuffle',
-            'sizeof',
-            'sort',
-            'uasort',
-            'uksort',
-            'usort'],
- 'Aspell': ['aspell_check',
-            'aspell_check_raw',
-            'aspell_new',
-            'aspell_suggest'],
- 'BC math': ['bcadd',
+ 'Array': ['array_change_key_case',
+           'array_chunk',
+           'array_combine',
+           'array_count_values',
+           'array_diff_assoc',
+           'array_diff_key',
+           'array_diff_uassoc',
+           'array_diff_ukey',
+           'array_diff',
+           'array_fill_keys',
+           'array_fill',
+           'array_filter',
+           'array_flip',
+           'array_intersect_assoc',
+           'array_intersect_key',
+           'array_intersect_uassoc',
+           'array_intersect_ukey',
+           'array_intersect',
+           'array_key_exists',
+           'array_keys',
+           'array_map',
+           'array_merge_recursive',
+           'array_merge',
+           'array_multisort',
+           'array_pad',
+           'array_pop',
+           'array_product',
+           'array_push',
+           'array_rand',
+           'array_reduce',
+           'array_replace_recursive',
+           'array_replace',
+           'array_reverse',
+           'array_search',
+           'array_shift',
+           'array_slice',
+           'array_splice',
+           'array_sum',
+           'array_udiff_assoc',
+           'array_udiff_uassoc',
+           'array_udiff',
+           'array_uintersect_assoc',
+           'array_uintersect_uassoc',
+           'array_uintersect',
+           'array_unique',
+           'array_unshift',
+           'array_values',
+           'array_walk_recursive',
+           'array_walk',
+           'array',
+           'arsort',
+           'asort',
+           'compact',
+           'count',
+           'current',
+           'each',
+           'end',
+           'extract',
+           'in_array',
+           'key',
+           'krsort',
+           'ksort',
+           'list',
+           'natcasesort',
+           'natsort',
+           'next',
+           'pos',
+           'prev',
+           'range',
+           'reset',
+           'rsort',
+           'shuffle',
+           'sizeof',
+           'sort',
+           'uasort',
+           'uksort',
+           'usort'],
+ 'BBCode': ['bbcode_add_element',
+            'bbcode_add_smiley',
+            'bbcode_create',
+            'bbcode_destroy',
+            'bbcode_parse',
+            'bbcode_set_arg_parser',
+            'bbcode_set_flags'],
+ 'BC Math': ['bcadd',
              'bccomp',
              'bcdiv',
              'bcmod',
@@ -145,31 +191,15 @@ MODULES = {'.NET': ['dotnet_load'],
            'bzopen',
            'bzread',
            'bzwrite'],
- 'CCVS': ['ccvs_add',
-          'ccvs_auth',
-          'ccvs_command',
-          'ccvs_count',
-          'ccvs_delete',
-          'ccvs_done',
-          'ccvs_init',
-          'ccvs_lookup',
-          'ccvs_new',
-          'ccvs_report',
-          'ccvs_return',
-          'ccvs_reverse',
-          'ccvs_sale',
-          'ccvs_status',
-          'ccvs_textvalue',
-          'ccvs_void'],
  'COM': ['com_addref',
          'com_create_guid',
          'com_event_sink',
-         'com_get',
          'com_get_active_object',
+         'com_get',
          'com_invoke',
          'com_isenum',
-         'com_load',
          'com_load_typelib',
+         'com_load',
          'com_message_pump',
          'com_print_typeinfo',
          'com_propget',
@@ -199,151 +229,212 @@ MODULES = {'.NET': ['dotnet_load'],
          'variant_or',
          'variant_pow',
          'variant_round',
-         'variant_set',
          'variant_set_type',
+         'variant_set',
          'variant_sub',
          'variant_xor'],
- 'CURL': ['curl_close',
-          'curl_copy_handle',
-          'curl_errno',
-          'curl_error',
-          'curl_exec',
-          'curl_getinfo',
-          'curl_init',
-          'curl_multi_add_handle',
-          'curl_multi_close',
-          'curl_multi_exec',
-          'curl_multi_getcontent',
-          'curl_multi_info_read',
-          'curl_multi_init',
-          'curl_multi_remove_handle',
-          'curl_multi_select',
-          'curl_setopt',
-          'curl_version'],
+ 'CUBRID': ['cubrid_affected_rows',
+            'cubrid_bind',
+            'cubrid_close_prepare',
+            'cubrid_close_request',
+            'cubrid_col_get',
+            'cubrid_col_size',
+            'cubrid_column_names',
+            'cubrid_column_types',
+            'cubrid_commit',
+            'cubrid_connect_with_url',
+            'cubrid_connect',
+            'cubrid_current_oid',
+            'cubrid_disconnect',
+            'cubrid_drop',
+            'cubrid_error_code_facility',
+            'cubrid_error_code',
+            'cubrid_error_msg',
+            'cubrid_execute',
+            'cubrid_fetch',
+            'cubrid_free_result',
+            'cubrid_get_charset',
+            'cubrid_get_class_name',
+            'cubrid_get_client_info',
+            'cubrid_get_db_parameter',
+            'cubrid_get_server_info',
+            'cubrid_get',
+            'cubrid_insert_id',
+            'cubrid_is_instance',
+            'cubrid_lob_close',
+            'cubrid_lob_export',
+            'cubrid_lob_get',
+            'cubrid_lob_send',
+            'cubrid_lob_size',
+            'cubrid_lock_read',
+            'cubrid_lock_write',
+            'cubrid_move_cursor',
+            'cubrid_num_cols',
+            'cubrid_num_rows',
+            'cubrid_prepare',
+            'cubrid_put',
+            'cubrid_rollback',
+            'cubrid_schema',
+            'cubrid_seq_drop',
+            'cubrid_seq_insert',
+            'cubrid_seq_put',
+            'cubrid_set_add',
+            'cubrid_set_drop',
+            'cubrid_version'],
+ 'Cairo': ['cairo_create',
+           'cairo_font_face_get_type',
+           'cairo_font_face_status',
+           'cairo_font_options_create',
+           'cairo_font_options_equal',
+           'cairo_font_options_get_antialias',
+           'cairo_font_options_get_hint_metrics',
+           'cairo_font_options_get_hint_style',
+           'cairo_font_options_get_subpixel_order',
+           'cairo_font_options_hash',
+           'cairo_font_options_merge',
+           'cairo_font_options_set_antialias',
+           'cairo_font_options_set_hint_metrics',
+           'cairo_font_options_set_hint_style',
+           'cairo_font_options_set_subpixel_order',
+           'cairo_font_options_status',
+           'cairo_format_stride_for_width',
+           'cairo_image_surface_create_for_data',
+           'cairo_image_surface_create_from_png',
+           'cairo_image_surface_create',
+           'cairo_image_surface_get_data',
+           'cairo_image_surface_get_format',
+           'cairo_image_surface_get_height',
+           'cairo_image_surface_get_stride',
+           'cairo_image_surface_get_width',
+           'cairo_matrix_create_scale',
+           'cairo_matrix_create_translate',
+           'cairo_matrix_invert',
+           'cairo_matrix_multiply',
+           'cairo_matrix_rotate',
+           'cairo_matrix_transform_distance',
+           'cairo_matrix_transform_point',
+           'cairo_matrix_translate',
+           'cairo_pattern_add_color_stop_rgb',
+           'cairo_pattern_add_color_stop_rgba',
+           'cairo_pattern_create_for_surface',
+           'cairo_pattern_create_linear',
+           'cairo_pattern_create_radial',
+           'cairo_pattern_create_rgb',
+           'cairo_pattern_create_rgba',
+           'cairo_pattern_get_color_stop_count',
+           'cairo_pattern_get_color_stop_rgba',
+           'cairo_pattern_get_extend',
+           'cairo_pattern_get_filter',
+           'cairo_pattern_get_linear_points',
+           'cairo_pattern_get_matrix',
+           'cairo_pattern_get_radial_circles',
+           'cairo_pattern_get_rgba',
+           'cairo_pattern_get_surface',
+           'cairo_pattern_get_type',
+           'cairo_pattern_set_extend',
+           'cairo_pattern_set_filter',
+           'cairo_pattern_set_matrix',
+           'cairo_pattern_status',
+           'cairo_pdf_surface_create',
+           'cairo_pdf_surface_set_size',
+           'cairo_ps_get_levels',
+           'cairo_ps_level_to_string',
+           'cairo_ps_surface_create',
+           'cairo_ps_surface_dsc_begin_page_setup',
+           'cairo_ps_surface_dsc_begin_setup',
+           'cairo_ps_surface_dsc_comment',
+           'cairo_ps_surface_get_eps',
+           'cairo_ps_surface_restrict_to_level',
+           'cairo_ps_surface_set_eps',
+           'cairo_ps_surface_set_size',
+           'cairo_scaled_font_create',
+           'cairo_scaled_font_extents',
+           'cairo_scaled_font_get_ctm',
+           'cairo_scaled_font_get_font_face',
+           'cairo_scaled_font_get_font_matrix',
+           'cairo_scaled_font_get_font_options',
+           'cairo_scaled_font_get_scale_matrix',
+           'cairo_scaled_font_get_type',
+           'cairo_scaled_font_glyph_extents',
+           'cairo_scaled_font_status',
+           'cairo_scaled_font_text_extents',
+           'cairo_surface_copy_page',
+           'cairo_surface_create_similar',
+           'cairo_surface_finish',
+           'cairo_surface_flush',
+           'cairo_surface_get_content',
+           'cairo_surface_get_device_offset',
+           'cairo_surface_get_font_options',
+           'cairo_surface_get_type',
+           'cairo_surface_mark_dirty_rectangle',
+           'cairo_surface_mark_dirty',
+           'cairo_surface_set_device_offset',
+           'cairo_surface_set_fallback_resolution',
+           'cairo_surface_show_page',
+           'cairo_surface_status',
+           'cairo_surface_write_to_png',
+           'cairo_svg_surface_create',
+           'cairo_svg_surface_restrict_to_version',
+           'cairo_svg_version_to_string'],
  'Calendar': ['cal_days_in_month',
               'cal_from_jd',
               'cal_info',
               'cal_to_jd',
               'easter_date',
               'easter_days',
-              'frenchtojd',
-              'gregoriantojd',
-              'jddayofweek',
-              'jdmonthname',
-              'jdtofrench',
-              'jdtogregorian',
+              'FrenchToJD',
+              'GregorianToJD',
+              'JDDayOfWeek',
+              'JDMonthName',
+              'JDToFrench',
+              'JDToGregorian',
               'jdtojewish',
-              'jdtojulian',
+              'JDToJulian',
               'jdtounix',
-              'jewishtojd',
-              'juliantojd',
+              'JewishToJD',
+              'JulianToJD',
               'unixtojd'],
- 'Classes/Objects': ['call_user_method',
-                     'call_user_method_array',
-                     'class_exists',
-                     'get_class',
-                     'get_class_methods',
-                     'get_class_vars',
-                     'get_declared_classes',
-                     'get_declared_interfaces',
-                     'get_object_vars',
-                     'get_parent_class',
-                     'interface_exists',
-                     'is_a',
-                     'is_subclass_of',
-                     'method_exists'],
+ 'Classes/Object': ['call_user_method_array',
+                    'call_user_method',
+                    'class_alias',
+                    'class_exists',
+                    'get_called_class',
+                    'get_class_methods',
+                    'get_class_vars',
+                    'get_class',
+                    'get_declared_classes',
+                    'get_declared_interfaces',
+                    'get_object_vars',
+                    'get_parent_class',
+                    'interface_exists',
+                    'is_a',
+                    'is_subclass_of',
+                    'method_exists',
+                    'property_exists'],
  'Classkit': ['classkit_import',
               'classkit_method_add',
               'classkit_method_copy',
               'classkit_method_redefine',
               'classkit_method_remove',
               'classkit_method_rename'],
- 'ClibPDF': ['cpdf_add_annotation',
-             'cpdf_add_outline',
-             'cpdf_arc',
-             'cpdf_begin_text',
-             'cpdf_circle',
-             'cpdf_clip',
-             'cpdf_close',
-             'cpdf_closepath',
-             'cpdf_closepath_fill_stroke',
-             'cpdf_closepath_stroke',
-             'cpdf_continue_text',
-             'cpdf_curveto',
-             'cpdf_end_text',
-             'cpdf_fill',
-             'cpdf_fill_stroke',
-             'cpdf_finalize',
-             'cpdf_finalize_page',
-             'cpdf_global_set_document_limits',
-             'cpdf_import_jpeg',
-             'cpdf_lineto',
-             'cpdf_moveto',
-             'cpdf_newpath',
-             'cpdf_open',
-             'cpdf_output_buffer',
-             'cpdf_page_init',
-             'cpdf_place_inline_image',
-             'cpdf_rect',
-             'cpdf_restore',
-             'cpdf_rlineto',
-             'cpdf_rmoveto',
-             'cpdf_rotate',
-             'cpdf_rotate_text',
-             'cpdf_save',
-             'cpdf_save_to_file',
-             'cpdf_scale',
-             'cpdf_set_action_url',
-             'cpdf_set_char_spacing',
-             'cpdf_set_creator',
-             'cpdf_set_current_page',
-             'cpdf_set_font',
-             'cpdf_set_font_directories',
-             'cpdf_set_font_map_file',
-             'cpdf_set_horiz_scaling',
-             'cpdf_set_keywords',
-             'cpdf_set_leading',
-             'cpdf_set_page_animation',
-             'cpdf_set_subject',
-             'cpdf_set_text_matrix',
-             'cpdf_set_text_pos',
-             'cpdf_set_text_rendering',
-             'cpdf_set_text_rise',
-             'cpdf_set_title',
-             'cpdf_set_viewer_preferences',
-             'cpdf_set_word_spacing',
-             'cpdf_setdash',
-             'cpdf_setflat',
-             'cpdf_setgray',
-             'cpdf_setgray_fill',
-             'cpdf_setgray_stroke',
-             'cpdf_setlinecap',
-             'cpdf_setlinejoin',
-             'cpdf_setlinewidth',
-             'cpdf_setmiterlimit',
-             'cpdf_setrgbcolor',
-             'cpdf_setrgbcolor_fill',
-             'cpdf_setrgbcolor_stroke',
-             'cpdf_show',
-             'cpdf_show_xy',
-             'cpdf_stringwidth',
-             'cpdf_stroke',
-             'cpdf_text',
-             'cpdf_translate'],
  'Crack': ['crack_check',
            'crack_closedict',
            'crack_getlastmessage',
            'crack_opendict'],
- 'Cybercash': ['cybercash_base64_decode',
-               'cybercash_base64_encode',
-               'cybercash_decr',
-               'cybercash_encr'],
- 'Cyrus IMAP': ['cyrus_authenticate',
-                'cyrus_bind',
-                'cyrus_close',
-                'cyrus_connect',
-                'cyrus_query',
-                'cyrus_unbind'],
+ 'Ctype': ['ctype_alnum',
+           'ctype_alpha',
+           'ctype_cntrl',
+           'ctype_digit',
+           'ctype_graph',
+           'ctype_lower',
+           'ctype_print',
+           'ctype_punct'],
+ 'Cyrus': ['cyrus_authenticate',
+           'cyrus_bind',
+           'cyrus_close',
+           'cyrus_connect',
+           'cyrus_query',
+           'cyrus_unbind'],
  'DB++': ['dbplus_add',
           'dbplus_aql',
           'dbplus_chdir',
@@ -391,34 +482,65 @@ MODULES = {'.NET': ['dotnet_load'],
           'dbplus_update',
           'dbplus_xlockrel',
           'dbplus_xunlockrel'],
- 'DBM': ['dblist',
-         'dbmclose',
-         'dbmdelete',
-         'dbmexists',
-         'dbmfetch',
-         'dbmfirstkey',
-         'dbminsert',
-         'dbmnextkey',
-         'dbmopen',
-         'dbmreplace'],
+ 'DBA': ['dba_close',
+         'dba_delete',
+         'dba_exists',
+         'dba_fetch',
+         'dba_firstkey',
+         'dba_handlers',
+         'dba_insert',
+         'dba_key_split',
+         'dba_list',
+         'dba_nextkey',
+         'dba_open',
+         'dba_optimize',
+         'dba_popen',
+         'dba_replace',
+         'dba_sync'],
  'DOM': ['dom_import_simplexml'],
- 'DOM XML': ['domxml_new_doc',
-             'domxml_open_file',
-             'domxml_open_mem',
-             'domxml_version',
-             'domxml_xmltree',
-             'domxml_xslt_stylesheet',
-             'domxml_xslt_stylesheet_doc',
-             'domxml_xslt_stylesheet_file',
-             'xpath_eval',
-             'xpath_eval_expression',
-             'xpath_new_context',
-             'xptr_eval',
-             'xptr_new_context'],
+ 'DOM XML (PHP 4)': ['domxml_new_doc',
+                     'domxml_open_file',
+                     'domxml_open_mem',
+                     'domxml_version',
+                     'domxml_xmltree',
+                     'domxml_xslt_stylesheet_doc',
+                     'domxml_xslt_stylesheet_file',
+                     'domxml_xslt_stylesheet',
+                     'domxml_xslt_version',
+                     'xpath_eval_expression',
+                     'xpath_eval',
+                     'xpath_new_context',
+                     'xpath_register_ns_auto',
+                     'xpath_register_ns',
+                     'xptr_eval',
+                     'xptr_new_context'],
  'Date/Time': ['checkdate',
-               'date',
+               'date_add',
+               'date_create_from_format',
+               'date_create',
+               'date_date_set',
+               'date_default_timezone_get',
+               'date_default_timezone_set',
+               'date_diff',
+               'date_format',
+               'date_get_last_errors',
+               'date_interval_create_from_date_string',
+               'date_interval_format',
+               'date_isodate_set',
+               'date_modify',
+               'date_offset_get',
+               'date_parse_from_format',
+               'date_parse',
+               'date_sub',
+               'date_sun_info',
                'date_sunrise',
                'date_sunset',
+               'date_time_set',
+               'date_timestamp_get',
+               'date_timestamp_set',
+               'date_timezone_get',
+               'date_timezone_set',
+               'date',
                'getdate',
                'gettimeofday',
                'gmdate',
@@ -431,39 +553,71 @@ MODULES = {'.NET': ['dotnet_load'],
                'strftime',
                'strptime',
                'strtotime',
-               'time'],
- 'Direct IO': ['dio_close',
-               'dio_fcntl',
-               'dio_open',
-               'dio_read',
-               'dio_seek',
-               'dio_stat',
-               'dio_tcsetattr',
-               'dio_truncate',
-               'dio_write'],
- 'Directories': ['chdir',
-                 'chroot',
-                 'closedir',
-                 'getcwd',
-                 'opendir',
-                 'readdir',
-                 'rewinddir',
-                 'scandir'],
- 'Errors and Logging': ['debug_backtrace',
-                        'debug_print_backtrace',
-                        'error_log',
-                        'error_reporting',
-                        'restore_error_handler',
-                        'restore_exception_handler',
-                        'set_error_handler',
-                        'set_exception_handler',
-                        'trigger_error',
-                        'user_error'],
+               'time',
+               'timezone_abbreviations_list',
+               'timezone_identifiers_list',
+               'timezone_location_get',
+               'timezone_name_from_abbr',
+               'timezone_name_get',
+               'timezone_offset_get',
+               'timezone_open',
+               'timezone_transitions_get',
+               'timezone_version_get'],
+ 'Direct IO': ['dio_close', 'dio_fcntl', 'dio_open'],
+ 'Directory': ['chdir',
+               'chroot',
+               'closedir',
+               'getcwd',
+               'opendir',
+               'readdir',
+               'rewinddir',
+               'scandir'],
+ 'Enchant': ['enchant_broker_describe',
+             'enchant_broker_dict_exists',
+             'enchant_broker_free_dict',
+             'enchant_broker_free',
+             'enchant_broker_get_error',
+             'enchant_broker_init',
+             'enchant_broker_list_dicts',
+             'enchant_broker_request_dict',
+             'enchant_broker_request_pwl_dict',
+             'enchant_broker_set_ordering',
+             'enchant_dict_add_to_personal',
+             'enchant_dict_add_to_session',
+             'enchant_dict_check',
+             'enchant_dict_describe',
+             'enchant_dict_get_error',
+             'enchant_dict_is_in_session',
+             'enchant_dict_quick_check',
+             'enchant_dict_store_replacement',
+             'enchant_dict_suggest'],
+ 'Error Handling': ['debug_backtrace',
+                    'debug_print_backtrace',
+                    'error_get_last',
+                    'error_log',
+                    'error_reporting',
+                    'restore_error_handler',
+                    'restore_exception_handler',
+                    'set_error_handler',
+                    'set_exception_handler',
+                    'trigger_error',
+                    'user_error'],
  'Exif': ['exif_imagetype',
           'exif_read_data',
           'exif_tagname',
           'exif_thumbnail',
           'read_exif_data'],
+ 'Expect': ['expect_expectl'],
+ 'FAM': ['fam_cancel_monitor',
+         'fam_close',
+         'fam_monitor_collection',
+         'fam_monitor_directory',
+         'fam_monitor_file',
+         'fam_next_event',
+         'fam_open',
+         'fam_pending',
+         'fam_resume_monitor',
+         'fam_suspend_monitor'],
  'FDF': ['fdf_add_doc_javascript',
          'fdf_add_template',
          'fdf_close',
@@ -482,11 +636,11 @@ MODULES = {'.NET': ['dotnet_load'],
          'fdf_get_version',
          'fdf_header',
          'fdf_next_field_name',
-         'fdf_open',
          'fdf_open_string',
+         'fdf_open',
          'fdf_remove_item',
-         'fdf_save',
          'fdf_save_string',
+         'fdf_save',
          'fdf_set_ap',
          'fdf_set_encoding',
          'fdf_set_file',
@@ -509,8 +663,8 @@ MODULES = {'.NET': ['dotnet_load'],
          'ftp_exec',
          'ftp_fget',
          'ftp_fput',
-         'ftp_get',
          'ftp_get_option',
+         'ftp_get',
          'ftp_login',
          'ftp_mdtm',
          'ftp_mkdir',
@@ -533,13 +687,18 @@ MODULES = {'.NET': ['dotnet_load'],
          'ftp_size',
          'ftp_ssl_connect',
          'ftp_systype'],
+ 'Fileinfo': ['finfo_buffer',
+              'finfo_close',
+              'finfo_file',
+              'finfo_open',
+              'finfo_set_flags',
+              'mime_content_type'],
  'Filesystem': ['basename',
                 'chgrp',
                 'chmod',
                 'chown',
                 'clearstatcache',
                 'copy',
-                'delete',
                 'dirname',
                 'disk_free_space',
                 'disk_total_space',
@@ -551,10 +710,10 @@ MODULES = {'.NET': ['dotnet_load'],
                 'fgetcsv',
                 'fgets',
                 'fgetss',
-                'file',
                 'file_exists',
                 'file_get_contents',
                 'file_put_contents',
+                'file',
                 'fileatime',
                 'filectime',
                 'filegroup',
@@ -586,17 +745,22 @@ MODULES = {'.NET': ['dotnet_load'],
                 'is_uploaded_file',
                 'is_writable',
                 'is_writeable',
+                'lchgrp',
+                'lchown',
                 'link',
                 'linkinfo',
                 'lstat',
                 'mkdir',
                 'move_uploaded_file',
                 'parse_ini_file',
+                'parse_ini_string',
                 'pathinfo',
                 'pclose',
                 'popen',
                 'readfile',
                 'readlink',
+                'realpath_cache_get',
+                'realpath_cache_size',
                 'realpath',
                 'rename',
                 'rewind',
@@ -609,6 +773,13 @@ MODULES = {'.NET': ['dotnet_load'],
                 'touch',
                 'umask',
                 'unlink'],
+ 'Filter': ['filter_has_var',
+            'filter_id',
+            'filter_input_array',
+            'filter_input',
+            'filter_list',
+            'filter_var_array',
+            'filter_var'],
  'Firebird/InterBase': ['ibase_add_user',
                         'ibase_affected_rows',
                         'ibase_backup',
@@ -622,8 +793,8 @@ MODULES = {'.NET': ['dotnet_load'],
                         'ibase_blob_info',
                         'ibase_blob_open',
                         'ibase_close',
-                        'ibase_commit',
                         'ibase_commit_ret',
+                        'ibase_commit',
                         'ibase_connect',
                         'ibase_db_info',
                         'ibase_delete_user',
@@ -649,8 +820,8 @@ MODULES = {'.NET': ['dotnet_load'],
                         'ibase_prepare',
                         'ibase_query',
                         'ibase_restore',
-                        'ibase_rollback',
                         'ibase_rollback_ret',
+                        'ibase_rollback',
                         'ibase_server_info',
                         'ibase_service_attach',
                         'ibase_service_detach',
@@ -671,8 +842,8 @@ MODULES = {'.NET': ['dotnet_load'],
                'fbsql_create_clob',
                'fbsql_create_db',
                'fbsql_data_seek',
-               'fbsql_database',
                'fbsql_database_password',
+               'fbsql_database',
                'fbsql_db_query',
                'fbsql_db_status',
                'fbsql_drop_db',
@@ -707,18 +878,23 @@ MODULES = {'.NET': ['dotnet_load'],
                'fbsql_read_clob',
                'fbsql_result',
                'fbsql_rollback',
+               'fbsql_rows_fetched',
                'fbsql_select_db',
+               'fbsql_set_characterset',
                'fbsql_set_lob_mode',
                'fbsql_set_password',
                'fbsql_set_transaction',
                'fbsql_start_db',
                'fbsql_stop_db',
+               'fbsql_table_name',
                'fbsql_tablename',
                'fbsql_username',
                'fbsql_warnings'],
- 'Function handling': ['call_user_func',
-                       'call_user_func_array',
+ 'Function handling': ['call_user_func_array',
+                       'call_user_func',
                        'create_function',
+                       'forward_static_call_array',
+                       'forward_static_call',
                        'func_get_arg',
                        'func_get_args',
                        'func_num_args',
@@ -727,16 +903,20 @@ MODULES = {'.NET': ['dotnet_load'],
                        'register_shutdown_function',
                        'register_tick_function',
                        'unregister_tick_function'],
+ 'GD and Image': ['gd_info',
+                  'getimagesize',
+                  'image_type_to_extension',
+                  'image_type_to_mime_type'],
  'GMP': ['gmp_abs',
          'gmp_add',
          'gmp_and',
          'gmp_clrbit',
          'gmp_cmp',
          'gmp_com',
-         'gmp_div',
          'gmp_div_q',
          'gmp_div_qr',
          'gmp_div_r',
+         'gmp_div',
          'gmp_divexact',
          'gmp_fact',
          'gmp_gcd',
@@ -750,6 +930,7 @@ MODULES = {'.NET': ['dotnet_load'],
          'gmp_mod',
          'gmp_mul',
          'gmp_neg',
+         'gmp_nextprime',
          'gmp_or',
          'gmp_perfect_square',
          'gmp_popcount',
@@ -765,70 +946,286 @@ MODULES = {'.NET': ['dotnet_load'],
          'gmp_sqrtrem',
          'gmp_strval',
          'gmp_sub',
+         'gmp_testbit',
          'gmp_xor'],
- 'Hyperwave': ['hw_array2objrec',
+ 'GeoIP': ['geoip_continent_code_by_name',
+           'geoip_country_code_by_name',
+           'geoip_country_code3_by_name',
+           'geoip_country_name_by_name',
+           'geoip_database_info',
+           'geoip_db_avail',
+           'geoip_db_filename',
+           'geoip_db_get_all_info',
+           'geoip_id_by_name',
+           'geoip_isp_by_name',
+           'geoip_org_by_name',
+           'geoip_record_by_name',
+           'geoip_region_by_name',
+           'geoip_region_name_by_code',
+           'geoip_time_zone_by_country_and_region'],
+ 'Gettext': ['bind_textdomain_codeset',
+             'bindtextdomain',
+             'dcgettext',
+             'dcngettext',
+             'dgettext',
+             'dngettext',
+             'gettext',
+             'ngettext',
+             'textdomain'],
+ 'GnuPG': ['gnupg_adddecryptkey',
+           'gnupg_addencryptkey',
+           'gnupg_addsignkey',
+           'gnupg_cleardecryptkeys',
+           'gnupg_clearencryptkeys',
+           'gnupg_clearsignkeys',
+           'gnupg_decrypt',
+           'gnupg_decryptverify',
+           'gnupg_encrypt',
+           'gnupg_encryptsign',
+           'gnupg_export',
+           'gnupg_geterror',
+           'gnupg_getprotocol',
+           'gnupg_import',
+           'gnupg_init',
+           'gnupg_keyinfo',
+           'gnupg_setarmor',
+           'gnupg_seterrormode',
+           'gnupg_setsignmode',
+           'gnupg_sign',
+           'gnupg_verify'],
+ 'Gopher': ['gopher_parsedir'],
+ 'Grapheme': ['grapheme_extract',
+              'grapheme_stripos',
+              'grapheme_stristr',
+              'grapheme_strlen',
+              'grapheme_strpos',
+              'grapheme_strripos',
+              'grapheme_strrpos',
+              'grapheme_strstr',
+              'grapheme_substr'],
+ 'Gupnp': ['gupnp_context_get_host_ip',
+           'gupnp_context_get_port',
+           'gupnp_context_get_subscription_timeout',
+           'gupnp_context_host_path',
+           'gupnp_context_new',
+           'gupnp_context_set_subscription_timeout',
+           'gupnp_context_timeout_add',
+           'gupnp_context_unhost_path',
+           'gupnp_control_point_browse_start',
+           'gupnp_control_point_browse_stop',
+           'gupnp_control_point_callback_set',
+           'gupnp_control_point_new',
+           'gupnp_device_action_callback_set',
+           'gupnp_device_info_get_service',
+           'gupnp_device_info_get',
+           'gupnp_root_device_get_available',
+           'gupnp_root_device_get_relative_location',
+           'gupnp_root_device_new',
+           'gupnp_root_device_set_available',
+           'gupnp_root_device_start',
+           'gupnp_root_device_stop',
+           'gupnp_service_action_get',
+           'gupnp_service_action_return_error',
+           'gupnp_service_action_return',
+           'gupnp_service_action_set',
+           'gupnp_service_freeze_notify',
+           'gupnp_service_info_get_introspection',
+           'gupnp_service_info_get',
+           'gupnp_service_introspection_get_state_variable',
+           'gupnp_service_notify',
+           'gupnp_service_proxy_action_get',
+           'gupnp_service_proxy_action_set',
+           'gupnp_service_proxy_add_notify',
+           'gupnp_service_proxy_callback_set',
+           'gupnp_service_proxy_get_subscribed',
+           'gupnp_service_proxy_remove_notify',
+           'gupnp_service_proxy_set_subscribed',
+           'gupnp_service_thaw_notify'],
+ 'HTTP': ['http_cache_etag',
+          'http_cache_last_modified',
+          'http_chunked_decode',
+          'http_deflate',
+          'http_inflate',
+          'http_build_cookie',
+          'http_date',
+          'http_get_request_body_stream',
+          'http_get_request_body',
+          'http_get_request_headers',
+          'http_match_etag',
+          'http_match_modified',
+          'http_match_request_header',
+          'http_support',
+          'http_negotiate_charset',
+          'http_negotiate_content_type',
+          'http_negotiate_language',
+          'ob_deflatehandler',
+          'ob_etaghandler',
+          'ob_inflatehandler',
+          'http_parse_cookie',
+          'http_parse_headers',
+          'http_parse_message',
+          'http_parse_params',
+          'http_persistent_handles_clean',
+          'http_persistent_handles_count',
+          'http_persistent_handles_ident',
+          'http_get',
+          'http_head',
+          'http_post_data',
+          'http_post_fields',
+          'http_put_data',
+          'http_put_file',
+          'http_put_stream',
+          'http_request_body_encode',
+          'http_request_method_exists',
+          'http_request_method_name',
+          'http_request_method_register',
+          'http_request_method_unregister',
+          'http_request',
+          'http_redirect',
+          'http_send_content_disposition',
+          'http_send_content_type',
+          'http_send_data',
+          'http_send_file',
+          'http_send_last_modified',
+          'http_send_status',
+          'http_send_stream',
+          'http_throttle',
+          'http_build_str',
+          'http_build_url'],
+ 'Hash': ['hash_algos',
+          'hash_copy',
+          'hash_file',
+          'hash_final',
+          'hash_hmac_file',
+          'hash_hmac',
+          'hash_init',
+          'hash_update_file',
+          'hash_update_stream',
+          'hash_update',
+          'hash'],
+ 'Hyperwave': ['hw_Array2Objrec',
                'hw_changeobject',
-               'hw_children',
-               'hw_childrenobj',
-               'hw_close',
-               'hw_connect',
+               'hw_Children',
+               'hw_ChildrenObj',
+               'hw_Close',
+               'hw_Connect',
                'hw_connection_info',
                'hw_cp',
-               'hw_deleteobject',
-               'hw_docbyanchor',
-               'hw_docbyanchorobj',
-               'hw_document_attributes',
-               'hw_document_bodytag',
-               'hw_document_content',
-               'hw_document_setcontent',
-               'hw_document_size',
+               'hw_Deleteobject',
+               'hw_DocByAnchor',
+               'hw_DocByAnchorObj',
+               'hw_Document_Attributes',
+               'hw_Document_BodyTag',
+               'hw_Document_Content',
+               'hw_Document_SetContent',
+               'hw_Document_Size',
                'hw_dummy',
-               'hw_edittext',
-               'hw_error',
-               'hw_errormsg',
-               'hw_free_document',
-               'hw_getanchors',
-               'hw_getanchorsobj',
-               'hw_getandlock',
-               'hw_getchildcoll',
-               'hw_getchildcollobj',
-               'hw_getchilddoccoll',
-               'hw_getchilddoccollobj',
-               'hw_getobject',
-               'hw_getobjectbyquery',
-               'hw_getobjectbyquerycoll',
-               'hw_getobjectbyquerycollobj',
-               'hw_getobjectbyqueryobj',
-               'hw_getparents',
-               'hw_getparentsobj',
+               'hw_EditText',
+               'hw_Error',
+               'hw_ErrorMsg',
+               'hw_Free_Document',
+               'hw_GetAnchors',
+               'hw_GetAnchorsObj',
+               'hw_GetAndLock',
+               'hw_GetChildColl',
+               'hw_GetChildCollObj',
+               'hw_GetChildDocColl',
+               'hw_GetChildDocCollObj',
+               'hw_GetObject',
+               'hw_GetObjectByQuery',
+               'hw_GetObjectByQueryColl',
+               'hw_GetObjectByQueryCollObj',
+               'hw_GetObjectByQueryObj',
+               'hw_GetParents',
+               'hw_GetParentsObj',
                'hw_getrellink',
-               'hw_getremote',
+               'hw_GetRemote',
                'hw_getremotechildren',
-               'hw_getsrcbydestobj',
-               'hw_gettext',
+               'hw_GetSrcByDestObj',
+               'hw_GetText',
                'hw_getusername',
-               'hw_identify',
-               'hw_incollections',
-               'hw_info',
-               'hw_inscoll',
-               'hw_insdoc',
+               'hw_Identify',
+               'hw_InCollections',
+               'hw_Info',
+               'hw_InsColl',
+               'hw_InsDoc',
                'hw_insertanchors',
-               'hw_insertdocument',
-               'hw_insertobject',
+               'hw_InsertDocument',
+               'hw_InsertObject',
                'hw_mapid',
-               'hw_modifyobject',
+               'hw_Modifyobject',
                'hw_mv',
-               'hw_new_document',
+               'hw_New_Document',
                'hw_objrec2array',
-               'hw_output_document',
-               'hw_pconnect',
-               'hw_pipedocument',
-               'hw_root',
+               'hw_Output_Document',
+               'hw_pConnect',
+               'hw_PipeDocument',
+               'hw_Root',
                'hw_setlinkroot',
                'hw_stat',
-               'hw_unlock',
-               'hw_who'],
- 'Hyperwave API': ['hwapi_hgcsp'],
+               'hw_Unlock',
+               'hw_Who'],
+ 'Hyperwave API': ['hw_api_attribute',
+                   'hwapi_hgcsp',
+                   'hw_api_content',
+                   'hw_api_object'],
+ 'IBM DB2': ['db2_autocommit',
+             'db2_bind_param',
+             'db2_client_info',
+             'db2_close',
+             'db2_column_privileges',
+             'db2_columns',
+             'db2_commit',
+             'db2_conn_error',
+             'db2_conn_errormsg',
+             'db2_connect',
+             'db2_cursor_type',
+             'db2_escape_string',
+             'db2_exec',
+             'db2_execute',
+             'db2_fetch_array',
+             'db2_fetch_assoc',
+             'db2_fetch_both',
+             'db2_fetch_object',
+             'db2_fetch_row',
+             'db2_field_display_size',
+             'db2_field_name',
+             'db2_field_num',
+             'db2_field_precision',
+             'db2_field_scale',
+             'db2_field_type',
+             'db2_field_width',
+             'db2_foreign_keys',
+             'db2_free_result',
+             'db2_free_stmt',
+             'db2_get_option',
+             'db2_last_insert_id'],
+ 'ID3': ['id3_get_frame_long_name',
+         'id3_get_frame_short_name',
+         'id3_get_genre_id',
+         'id3_get_genre_list',
+         'id3_get_genre_name',
+         'id3_get_tag',
+         'id3_get_version',
+         'id3_remove_tag',
+         'id3_set_tag'],
+ 'IDN': ['idn_to_ascii', 'idn_to_unicode', 'idn_to_utf8'],
+ 'IIS': ['iis_add_server',
+         'iis_get_dir_security',
+         'iis_get_script_map',
+         'iis_get_server_by_comment',
+         'iis_get_server_by_path',
+         'iis_get_server_rights',
+         'iis_get_service_state',
+         'iis_remove_server',
+         'iis_set_app_settings',
+         'iis_set_dir_security',
+         'iis_set_script_map',
+         'iis_set_server_rights',
+         'iis_start_server',
+         'iis_start_service',
+         'iis_stop_server',
+         'iis_stop_service'],
  'IMAP': ['imap_8bit',
           'imap_alerts',
           'imap_append',
@@ -847,7 +1244,9 @@ MODULES = {'.NET': ['dotnet_load'],
           'imap_fetch_overview',
           'imap_fetchbody',
           'imap_fetchheader',
+          'imap_fetchmime',
           'imap_fetchstructure',
+          'imap_gc',
           'imap_get_quota',
           'imap_get_quotaroot',
           'imap_getacl',
@@ -862,10 +1261,10 @@ MODULES = {'.NET': ['dotnet_load'],
           'imap_listscan',
           'imap_listsubscribed',
           'imap_lsub',
-          'imap_mail',
           'imap_mail_compose',
           'imap_mail_copy',
           'imap_mail_move',
+          'imap_mail',
           'imap_mailboxmsginfo',
           'imap_mime_header_decode',
           'imap_msgno',
@@ -879,6 +1278,7 @@ MODULES = {'.NET': ['dotnet_load'],
           'imap_rfc822_parse_adrlist',
           'imap_rfc822_parse_headers',
           'imap_rfc822_write_address',
+          'imap_savebody',
           'imap_scanmailbox',
           'imap_search',
           'imap_set_quota',
@@ -895,136 +1295,6 @@ MODULES = {'.NET': ['dotnet_load'],
           'imap_utf7_decode',
           'imap_utf7_encode',
           'imap_utf8'],
- 'IRC Gateway': ['ircg_channel_mode',
-                 'ircg_disconnect',
-                 'ircg_eval_ecmascript_params',
-                 'ircg_fetch_error_msg',
-                 'ircg_get_username',
-                 'ircg_html_encode',
-                 'ircg_ignore_add',
-                 'ircg_ignore_del',
-                 'ircg_invite',
-                 'ircg_is_conn_alive',
-                 'ircg_join',
-                 'ircg_kick',
-                 'ircg_list',
-                 'ircg_lookup_format_messages',
-                 'ircg_lusers',
-                 'ircg_msg',
-                 'ircg_names',
-                 'ircg_nick',
-                 'ircg_nickname_escape',
-                 'ircg_nickname_unescape',
-                 'ircg_notice',
-                 'ircg_oper',
-                 'ircg_part',
-                 'ircg_pconnect',
-                 'ircg_register_format_messages',
-                 'ircg_set_current',
-                 'ircg_set_file',
-                 'ircg_set_on_die',
-                 'ircg_topic',
-                 'ircg_who',
-                 'ircg_whois'],
- 'Image': ['gd_info',
-           'getimagesize',
-           'image2wbmp',
-           'image_type_to_extension',
-           'image_type_to_mime_type',
-           'imagealphablending',
-           'imageantialias',
-           'imagearc',
-           'imagechar',
-           'imagecharup',
-           'imagecolorallocate',
-           'imagecolorallocatealpha',
-           'imagecolorat',
-           'imagecolorclosest',
-           'imagecolorclosestalpha',
-           'imagecolorclosesthwb',
-           'imagecolordeallocate',
-           'imagecolorexact',
-           'imagecolorexactalpha',
-           'imagecolormatch',
-           'imagecolorresolve',
-           'imagecolorresolvealpha',
-           'imagecolorset',
-           'imagecolorsforindex',
-           'imagecolorstotal',
-           'imagecolortransparent',
-           'imagecopy',
-           'imagecopymerge',
-           'imagecopymergegray',
-           'imagecopyresampled',
-           'imagecopyresized',
-           'imagecreate',
-           'imagecreatefromgd',
-           'imagecreatefromgd2',
-           'imagecreatefromgd2part',
-           'imagecreatefromgif',
-           'imagecreatefromjpeg',
-           'imagecreatefrompng',
-           'imagecreatefromstring',
-           'imagecreatefromwbmp',
-           'imagecreatefromxbm',
-           'imagecreatefromxpm',
-           'imagecreatetruecolor',
-           'imagedashedline',
-           'imagedestroy',
-           'imageellipse',
-           'imagefill',
-           'imagefilledarc',
-           'imagefilledellipse',
-           'imagefilledpolygon',
-           'imagefilledrectangle',
-           'imagefilltoborder',
-           'imagefilter',
-           'imagefontheight',
-           'imagefontwidth',
-           'imageftbbox',
-           'imagefttext',
-           'imagegammacorrect',
-           'imagegd',
-           'imagegd2',
-           'imagegif',
-           'imageinterlace',
-           'imageistruecolor',
-           'imagejpeg',
-           'imagelayereffect',
-           'imageline',
-           'imageloadfont',
-           'imagepalettecopy',
-           'imagepng',
-           'imagepolygon',
-           'imagepsbbox',
-           'imagepsencodefont',
-           'imagepsextendfont',
-           'imagepsfreefont',
-           'imagepsloadfont',
-           'imagepsslantfont',
-           'imagepstext',
-           'imagerectangle',
-           'imagerotate',
-           'imagesavealpha',
-           'imagesetbrush',
-           'imagesetpixel',
-           'imagesetstyle',
-           'imagesetthickness',
-           'imagesettile',
-           'imagestring',
-           'imagestringup',
-           'imagesx',
-           'imagesy',
-           'imagetruecolortopalette',
-           'imagettfbbox',
-           'imagettftext',
-           'imagetypes',
-           'imagewbmp',
-           'imagexbm',
-           'iptcembed',
-           'iptcparse',
-           'jpeg2wbmp',
-           'png2wbmp'],
  'Informix': ['ifx_affected_rows',
               'ifx_blobinfile_mode',
               'ifx_byteasvarchar',
@@ -1063,25 +1333,58 @@ MODULES = {'.NET': ['dotnet_load'],
               'ifxus_seek_slob',
               'ifxus_tell_slob',
               'ifxus_write_slob'],
- 'Ingres II': ['ingres_autocommit',
-               'ingres_close',
-               'ingres_commit',
-               'ingres_connect',
-               'ingres_fetch_array',
-               'ingres_fetch_object',
-               'ingres_fetch_row',
-               'ingres_field_length',
-               'ingres_field_name',
-               'ingres_field_nullable',
-               'ingres_field_precision',
-               'ingres_field_scale',
-               'ingres_field_type',
-               'ingres_num_fields',
-               'ingres_num_rows',
-               'ingres_pconnect',
-               'ingres_query',
-               'ingres_rollback'],
+ 'Ingres': ['ingres_autocommit_state',
+            'ingres_autocommit',
+            'ingres_charset',
+            'ingres_close',
+            'ingres_commit',
+            'ingres_connect',
+            'ingres_cursor',
+            'ingres_errno',
+            'ingres_error',
+            'ingres_errsqlstate',
+            'ingres_escape_string',
+            'ingres_execute',
+            'ingres_fetch_array',
+            'ingres_fetch_assoc',
+            'ingres_fetch_object',
+            'ingres_fetch_proc_return',
+            'ingres_fetch_row',
+            'ingres_field_length',
+            'ingres_field_name',
+            'ingres_field_nullable',
+            'ingres_field_precision',
+            'ingres_field_scale',
+            'ingres_field_type',
+            'ingres_free_result',
+            'ingres_next_error',
+            'ingres_num_fields',
+            'ingres_num_rows',
+            'ingres_pconnect',
+            'ingres_prepare',
+            'ingres_query',
+            'ingres_result_seek',
+            'ingres_rollback',
+            'ingres_set_environment',
+            'ingres_unbuffered_query'],
+ 'Inotify': ['inotify_add_watch',
+             'inotify_init',
+             'inotify_queue_len',
+             'inotify_read',
+             'inotify_rm_watch'],
+ 'JSON': ['json_decode', 'json_encode', 'json_last_error'],
  'Java': ['java_last_exception_clear', 'java_last_exception_get'],
+ 'Judy': ['judy_type', 'judy_version'],
+ 'KADM5': ['kadm5_chpass_principal',
+           'kadm5_create_principal',
+           'kadm5_delete_principal',
+           'kadm5_destroy',
+           'kadm5_flush',
+           'kadm5_get_policies',
+           'kadm5_get_principal',
+           'kadm5_get_principals',
+           'kadm5_init_with_password',
+           'kadm5_modify_principal'],
  'LDAP': ['ldap_8859_to_t61',
           'ldap_add',
           'ldap_bind',
@@ -1103,8 +1406,8 @@ MODULES = {'.NET': ['dotnet_load'],
           'ldap_get_dn',
           'ldap_get_entries',
           'ldap_get_option',
-          'ldap_get_values',
           'ldap_get_values_len',
+          'ldap_get_values',
           'ldap_list',
           'ldap_mod_add',
           'ldap_mod_del',
@@ -1126,6 +1429,30 @@ MODULES = {'.NET': ['dotnet_load'],
           'ldap_t61_to_8859',
           'ldap_unbind'],
  'LZF': ['lzf_compress', 'lzf_decompress', 'lzf_optimized_for'],
+ 'Libevent': ['event_add',
+              'event_base_free',
+              'event_base_loop',
+              'event_base_loopbreak',
+              'event_base_loopexit',
+              'event_base_new',
+              'event_base_priority_init',
+              'event_base_set',
+              'event_buffer_base_set',
+              'event_buffer_disable',
+              'event_buffer_enable',
+              'event_buffer_fd_set',
+              'event_buffer_free',
+              'event_buffer_new',
+              'event_buffer_priority_set',
+              'event_buffer_read',
+              'event_buffer_set_callback',
+              'event_buffer_timeout_set',
+              'event_buffer_watermark_set',
+              'event_buffer_write',
+              'event_del',
+              'event_free',
+              'event_new',
+              'event_set'],
  'Lotus Notes': ['notes_body',
                  'notes_copy_db',
                  'notes_create_db',
@@ -1140,84 +1467,48 @@ MODULES = {'.NET': ['dotnet_load'],
                  'notes_search',
                  'notes_unread',
                  'notes_version'],
- 'MCAL': ['mcal_append_event',
-          'mcal_close',
-          'mcal_create_calendar',
-          'mcal_date_compare',
-          'mcal_date_valid',
-          'mcal_day_of_week',
-          'mcal_day_of_year',
-          'mcal_days_in_month',
-          'mcal_delete_calendar',
-          'mcal_delete_event',
-          'mcal_event_add_attribute',
-          'mcal_event_init',
-          'mcal_event_set_alarm',
-          'mcal_event_set_category',
-          'mcal_event_set_class',
-          'mcal_event_set_description',
-          'mcal_event_set_end',
-          'mcal_event_set_recur_daily',
-          'mcal_event_set_recur_monthly_mday',
-          'mcal_event_set_recur_monthly_wday',
-          'mcal_event_set_recur_none',
-          'mcal_event_set_recur_weekly',
-          'mcal_event_set_recur_yearly',
-          'mcal_event_set_start',
-          'mcal_event_set_title',
-          'mcal_expunge',
-          'mcal_fetch_current_stream_event',
-          'mcal_fetch_event',
-          'mcal_is_leap_year',
-          'mcal_list_alarms',
-          'mcal_list_events',
-          'mcal_next_recurrence',
-          'mcal_open',
-          'mcal_popen',
-          'mcal_rename_calendar',
-          'mcal_reopen',
-          'mcal_snooze',
-          'mcal_store_event',
-          'mcal_time_valid',
-          'mcal_week_of_year'],
- 'MS SQL Server': ['mssql_bind',
-                   'mssql_close',
-                   'mssql_connect',
-                   'mssql_data_seek',
-                   'mssql_execute',
-                   'mssql_fetch_array',
-                   'mssql_fetch_assoc',
-                   'mssql_fetch_batch',
-                   'mssql_fetch_field',
-                   'mssql_fetch_object',
-                   'mssql_fetch_row',
-                   'mssql_field_length',
-                   'mssql_field_name',
-                   'mssql_field_seek',
-                   'mssql_field_type',
-                   'mssql_free_result',
-                   'mssql_free_statement',
-                   'mssql_get_last_message',
-                   'mssql_guid_string',
-                   'mssql_init',
-                   'mssql_min_error_severity',
-                   'mssql_min_message_severity',
-                   'mssql_next_result',
-                   'mssql_num_fields',
-                   'mssql_num_rows',
-                   'mssql_pconnect',
-                   'mssql_query',
-                   'mssql_result',
-                   'mssql_rows_affected',
-                   'mssql_select_db'],
+ 'MCVE': ['m_checkstatus',
+          'm_completeauthorizations',
+          'm_connect',
+          'm_connectionerror',
+          'm_deletetrans',
+          'm_destroyconn',
+          'm_destroyengine',
+          'm_getcell',
+          'm_getcellbynum',
+          'm_getcommadelimited',
+          'm_getheader',
+          'm_initconn',
+          'm_initengine',
+          'm_iscommadelimited',
+          'm_maxconntimeout',
+          'm_monitor',
+          'm_numcolumns',
+          'm_numrows',
+          'm_parsecommadelimited',
+          'm_responsekeys'],
  'Mail': ['ezmlm_hash', 'mail'],
+ 'Mailparse': ['mailparse_determine_best_xfer_encoding',
+               'mailparse_msg_create',
+               'mailparse_msg_extract_part_file',
+               'mailparse_msg_extract_part',
+               'mailparse_msg_extract_whole_part_file',
+               'mailparse_msg_free',
+               'mailparse_msg_get_part_data',
+               'mailparse_msg_get_part',
+               'mailparse_msg_get_structure',
+               'mailparse_msg_parse_file',
+               'mailparse_msg_parse',
+               'mailparse_rfc822_parse_addresses',
+               'mailparse_stream_encode',
+               'mailparse_uudecode_all'],
  'Math': ['abs',
           'acos',
           'acosh',
           'asin',
           'asinh',
-          'atan',
           'atan2',
+          'atan',
           'atanh',
           'base_convert',
           'bindec',
@@ -1229,53 +1520,134 @@ MODULES = {'.NET': ['dotnet_load'],
           'decoct',
           'deg2rad',
           'exp',
-          'expm1',
-          'floor',
-          'fmod',
-          'getrandmax',
-          'hexdec',
-          'hypot',
-          'is_finite',
-          'is_infinite',
-          'is_nan',
-          'lcg_value',
-          'log',
-          'log10',
-          'log1p',
-          'max',
-          'min',
-          'mt_getrandmax',
-          'mt_rand',
-          'mt_srand',
-          'octdec',
-          'pi',
-          'pow',
-          'rad2deg',
-          'rand',
-          'round',
-          'sin',
-          'sinh',
-          'sqrt',
-          'srand',
-          'tan',
-          'tanh'],
+          'expm1'],
+ 'MaxDB': ['maxdb_affected_rows',
+           'maxdb_autocommit',
+           'maxdb_bind_param',
+           'maxdb_bind_result',
+           'maxdb_change_user',
+           'maxdb_character_set_name',
+           'maxdb_client_encoding',
+           'maxdb_close_long_data',
+           'maxdb_close',
+           'maxdb_commit',
+           'maxdb_connect_errno',
+           'maxdb_connect_error',
+           'maxdb_connect',
+           'maxdb_data_seek',
+           'maxdb_debug',
+           'maxdb_disable_reads_from_master',
+           'maxdb_disable_rpl_parse',
+           'maxdb_dump_debug_info',
+           'maxdb_embedded_connect',
+           'maxdb_enable_reads_from_master',
+           'maxdb_enable_rpl_parse',
+           'maxdb_errno',
+           'maxdb_error',
+           'maxdb_escape_string',
+           'maxdb_execute',
+           'maxdb_fetch_array',
+           'maxdb_fetch_assoc',
+           'maxdb_fetch_field_direct',
+           'maxdb_fetch_field',
+           'maxdb_fetch_fields',
+           'maxdb_fetch_lengths',
+           'maxdb_fetch_object',
+           'maxdb_fetch_row',
+           'maxdb_fetch',
+           'maxdb_field_count',
+           'maxdb_field_seek',
+           'maxdb_field_tell',
+           'maxdb_free_result',
+           'maxdb_get_client_info',
+           'maxdb_get_client_version',
+           'maxdb_get_host_info',
+           'maxdb_get_metadata',
+           'maxdb_get_proto_info',
+           'maxdb_get_server_info',
+           'maxdb_get_server_version',
+           'maxdb_info',
+           'maxdb_init',
+           'maxdb_insert_id',
+           'maxdb_kill',
+           'maxdb_master_query',
+           'maxdb_more_results',
+           'maxdb_multi_query',
+           'maxdb_next_result',
+           'maxdb_num_fields',
+           'maxdb_num_rows',
+           'maxdb_options',
+           'maxdb_param_count',
+           'maxdb_ping',
+           'maxdb_prepare',
+           'maxdb_query',
+           'maxdb_real_connect',
+           'maxdb_real_escape_string',
+           'maxdb_real_query',
+           'maxdb_report',
+           'maxdb_rollback',
+           'maxdb_rpl_parse_enabled',
+           'maxdb_rpl_probe',
+           'maxdb_rpl_query_type',
+           'maxdb_select_db',
+           'maxdb_send_long_data',
+           'maxdb_send_query',
+           'maxdb_server_end',
+           'maxdb_server_init',
+           'maxdb_set_opt',
+           'maxdb_sqlstate',
+           'maxdb_ssl_set',
+           'maxdb_stat',
+           'maxdb_stmt_affected_rows'],
+ 'Mcrypt': ['mcrypt_cbc',
+            'mcrypt_cfb',
+            'mcrypt_create_iv',
+            'mcrypt_decrypt',
+            'mcrypt_ecb',
+            'mcrypt_enc_get_algorithms_name',
+            'mcrypt_enc_get_block_size',
+            'mcrypt_enc_get_iv_size',
+            'mcrypt_enc_get_key_size',
+            'mcrypt_enc_get_modes_name',
+            'mcrypt_enc_get_supported_key_sizes',
+            'mcrypt_enc_is_block_algorithm_mode',
+            'mcrypt_enc_is_block_algorithm',
+            'mcrypt_enc_is_block_mode',
+            'mcrypt_enc_self_test',
+            'mcrypt_encrypt',
+            'mcrypt_generic_deinit',
+            'mcrypt_generic_end',
+            'mcrypt_generic_init',
+            'mcrypt_generic',
+            'mcrypt_get_block_size',
+            'mcrypt_get_cipher_name',
+            'mcrypt_get_iv_size',
+            'mcrypt_get_key_size',
+            'mcrypt_list_algorithms',
+            'mcrypt_list_modes',
+            'mcrypt_module_close',
+            'mcrypt_module_get_algo_block_size',
+            'mcrypt_module_get_algo_key_size',
+            'mcrypt_module_get_supported_key_sizes',
+            'mcrypt_module_is_block_algorithm_mode',
+            'mcrypt_module_is_block_algorithm',
+            'mcrypt_module_is_block_mode',
+            'mcrypt_module_open',
+            'mcrypt_module_self_test',
+            'mcrypt_ofb',
+            'mdecrypt_generic'],
  'Memcache': ['memcache_debug'],
- 'Mimetype': ['mime_content_type'],
- 'Ming (flash)': ['ming_setcubicthreshold',
-                  'ming_setscale',
-                  'ming_useswfversion',
-                  'swfaction',
-                  'swfbitmap',
-                  'swfbutton',
-                  'swffill',
-                  'swffont',
-                  'swfgradient',
-                  'swfmorph',
-                  'swfmovie',
-                  'swfshape',
-                  'swfsprite',
-                  'swftext',
-                  'swftextfield'],
+ 'Mhash': ['mhash_count',
+           'mhash_get_block_size',
+           'mhash_get_hash_name',
+           'mhash_keygen_s2k',
+           'mhash'],
+ 'Ming': ['ming_keypress',
+          'ming_setcubicthreshold',
+          'ming_setscale',
+          'ming_setswfcompression',
+          'ming_useconstants',
+          'ming_useswfversion'],
  'Misc.': ['connection_aborted',
            'connection_status',
            'connection_timeout',
@@ -1286,6 +1658,7 @@ MODULES = {'.NET': ['dotnet_load'],
            'eval',
            'exit',
            'get_browser',
+           '__halt_compiler',
            'highlight_file',
            'highlight_string',
            'ignore_user_abort',
@@ -1294,32 +1667,66 @@ MODULES = {'.NET': ['dotnet_load'],
            'php_strip_whitespace',
            'show_source',
            'sleep',
+           'sys_getloadavg',
            'time_nanosleep',
+           'time_sleep_until',
            'uniqid',
            'unpack',
            'usleep'],
+ 'Mongo': ['bson_decode', 'bson_encode'],
  'Msession': ['msession_connect',
               'msession_count',
               'msession_create',
               'msession_destroy',
               'msession_disconnect',
               'msession_find',
-              'msession_get',
               'msession_get_array',
               'msession_get_data',
+              'msession_get',
               'msession_inc',
               'msession_list',
               'msession_listvar',
               'msession_lock',
               'msession_plugin',
               'msession_randstr',
-              'msession_set',
               'msession_set_array',
               'msession_set_data',
+              'msession_set',
               'msession_timeout',
               'msession_uniq',
               'msession_unlock'],
- 'Multibyte String': ['mb_convert_case',
+ 'Mssql': ['mssql_bind',
+           'mssql_close',
+           'mssql_connect',
+           'mssql_data_seek',
+           'mssql_execute',
+           'mssql_fetch_array',
+           'mssql_fetch_assoc',
+           'mssql_fetch_batch',
+           'mssql_fetch_field',
+           'mssql_fetch_object',
+           'mssql_fetch_row',
+           'mssql_field_length',
+           'mssql_field_name',
+           'mssql_field_seek',
+           'mssql_field_type',
+           'mssql_free_result',
+           'mssql_free_statement',
+           'mssql_get_last_message',
+           'mssql_guid_string',
+           'mssql_init',
+           'mssql_min_error_severity',
+           'mssql_min_message_severity',
+           'mssql_next_result',
+           'mssql_num_fields',
+           'mssql_num_rows',
+           'mssql_pconnect',
+           'mssql_query',
+           'mssql_result',
+           'mssql_rows_affected',
+           'mssql_select_db'],
+ 'Multibyte String': ['mb_check_encoding',
+                      'mb_convert_case',
                       'mb_convert_encoding',
                       'mb_convert_kana',
                       'mb_convert_variables',
@@ -1329,18 +1736,19 @@ MODULES = {'.NET': ['dotnet_load'],
                       'mb_detect_order',
                       'mb_encode_mimeheader',
                       'mb_encode_numericentity',
-                      'mb_ereg',
+                      'mb_encoding_aliases',
                       'mb_ereg_match',
                       'mb_ereg_replace',
-                      'mb_ereg_search',
                       'mb_ereg_search_getpos',
                       'mb_ereg_search_getregs',
                       'mb_ereg_search_init',
                       'mb_ereg_search_pos',
                       'mb_ereg_search_regs',
                       'mb_ereg_search_setpos',
-                      'mb_eregi',
+                      'mb_ereg_search',
+                      'mb_ereg',
                       'mb_eregi_replace',
+                      'mb_eregi',
                       'mb_get_info',
                       'mb_http_input',
                       'mb_http_output',
@@ -1356,17 +1764,22 @@ MODULES = {'.NET': ['dotnet_load'],
                       'mb_split',
                       'mb_strcut',
                       'mb_strimwidth',
+                      'mb_stripos',
+                      'mb_stristr',
                       'mb_strlen',
                       'mb_strpos',
+                      'mb_strrchr',
+                      'mb_strrichr',
+                      'mb_strripos',
                       'mb_strrpos',
+                      'mb_strstr',
                       'mb_strtolower',
                       'mb_strtoupper',
                       'mb_strwidth',
                       'mb_substitute_character',
-                      'mb_substr',
-                      'mb_substr_count'],
+                      'mb_substr_count',
+                      'mb_substr'],
  'MySQL': ['mysql_affected_rows',
-           'mysql_change_user',
            'mysql_client_encoding',
            'mysql_close',
            'mysql_connect',
@@ -1409,6 +1822,7 @@ MODULES = {'.NET': ['dotnet_load'],
            'mysql_real_escape_string',
            'mysql_result',
            'mysql_select_db',
+           'mysql_set_charset',
            'mysql_stat',
            'mysql_tablename',
            'mysql_thread_id',
@@ -1466,9 +1880,9 @@ MODULES = {'.NET': ['dotnet_load'],
              'ncurses_hide_panel',
              'ncurses_hline',
              'ncurses_inch',
-             'ncurses_init',
              'ncurses_init_color',
              'ncurses_init_pair',
+             'ncurses_init',
              'ncurses_insch',
              'ncurses_insdelln',
              'ncurses_insertln',
@@ -1483,8 +1897,8 @@ MODULES = {'.NET': ['dotnet_load'],
              'ncurses_mouse_trafo',
              'ncurses_mouseinterval',
              'ncurses_mousemask',
-             'ncurses_move',
              'ncurses_move_panel',
+             'ncurses_move',
              'ncurses_mvaddch',
              'ncurses_mvaddchnstr',
              'ncurses_mvaddchstr',
@@ -1576,8 +1990,6 @@ MODULES = {'.NET': ['dotnet_load'],
              'ncurses_wvline'],
  'Network': ['checkdnsrr',
              'closelog',
-             'debugger_off',
-             'debugger_on',
              'define_syslog_variables',
              'dns_check_record',
              'dns_get_mx',
@@ -1585,28 +1997,31 @@ MODULES = {'.NET': ['dotnet_load'],
              'fsockopen',
              'gethostbyaddr',
              'gethostbyname',
-             'gethostbynamel',
-             'getmxrr',
-             'getprotobyname',
-             'getprotobynumber',
-             'getservbyname',
-             'getservbyport',
-             'header',
-             'headers_list',
-             'headers_sent',
-             'inet_ntop',
-             'inet_pton',
-             'ip2long',
-             'long2ip',
-             'openlog',
-             'pfsockopen',
-             'setcookie',
-             'setrawcookie',
-             'socket_get_status',
-             'socket_set_blocking',
-             'socket_set_timeout',
-             'syslog'],
- 'OCI8': ['oci_bind_by_name',
+             'gethostbynamel'],
+ 'Newt': ['newt_bell',
+          'newt_button_bar',
+          'newt_button',
+          'newt_centered_window',
+          'newt_checkbox_get_value',
+          'newt_checkbox_set_flags',
+          'newt_checkbox_set_value',
+          'newt_checkbox_tree_add_item',
+          'newt_checkbox_tree_find_item',
+          'newt_checkbox_tree_get_current',
+          'newt_checkbox_tree_get_entry_value',
+          'newt_checkbox_tree_get_multi_selection',
+          'newt_checkbox_tree_get_selection',
+          'newt_checkbox_tree_multi',
+          'newt_checkbox_tree_set_current',
+          'newt_checkbox_tree_set_entry_value',
+          'newt_checkbox_tree_set_entry',
+          'newt_checkbox_tree_set_width',
+          'newt_checkbox_tree',
+          'newt_checkbox',
+          'newt_clear_key_buffer'],
+ 'OAuth': ['oauth_get_sbs', 'oauth_urlencode'],
+ 'OCI8': ['oci_bind_array_by_name',
+          'oci_bind_by_name',
           'oci_cancel',
           'oci_close',
           'oci_commit',
@@ -1614,19 +2029,19 @@ MODULES = {'.NET': ['dotnet_load'],
           'oci_define_by_name',
           'oci_error',
           'oci_execute',
-          'oci_fetch',
           'oci_fetch_all',
           'oci_fetch_array',
           'oci_fetch_assoc',
           'oci_fetch_object',
           'oci_fetch_row',
+          'oci_fetch',
           'oci_field_is_null',
           'oci_field_name',
           'oci_field_precision',
           'oci_field_scale',
           'oci_field_size',
-          'oci_field_type',
           'oci_field_type_raw',
+          'oci_field_type',
           'oci_free_statement',
           'oci_internal_debug',
           'oci_lob_copy',
@@ -1643,61 +2058,17 @@ MODULES = {'.NET': ['dotnet_load'],
           'oci_result',
           'oci_rollback',
           'oci_server_version',
+          'oci_set_action',
+          'oci_set_client_identifier',
+          'oci_set_client_info',
+          'oci_set_edition',
+          'oci_set_module_name',
           'oci_set_prefetch',
-          'oci_statement_type',
-          'ocibindbyname',
-          'ocicancel',
-          'ocicloselob',
-          'ocicollappend',
-          'ocicollassign',
-          'ocicollassignelem',
-          'ocicollgetelem',
-          'ocicollmax',
-          'ocicollsize',
-          'ocicolltrim',
-          'ocicolumnisnull',
-          'ocicolumnname',
-          'ocicolumnprecision',
-          'ocicolumnscale',
-          'ocicolumnsize',
-          'ocicolumntype',
-          'ocicolumntyperaw',
-          'ocicommit',
-          'ocidefinebyname',
-          'ocierror',
-          'ociexecute',
-          'ocifetch',
-          'ocifetchinto',
-          'ocifetchstatement',
-          'ocifreecollection',
-          'ocifreecursor',
-          'ocifreedesc',
-          'ocifreestatement',
-          'ociinternaldebug',
-          'ociloadlob',
-          'ocilogoff',
-          'ocilogon',
-          'ocinewcollection',
-          'ocinewcursor',
-          'ocinewdescriptor',
-          'ocinlogon',
-          'ocinumcols',
-          'ociparse',
-          'ociplogon',
-          'ociresult',
-          'ocirollback',
-          'ocirowcount',
-          'ocisavelob',
-          'ocisavelobfile',
-          'ociserverversion',
-          'ocisetprefetch',
-          'ocistatementtype',
-          'ociwritelobtofile',
-          'ociwritetemporarylob'],
+          'oci_statement_type'],
  'ODBC': ['odbc_autocommit',
           'odbc_binmode',
-          'odbc_close',
           'odbc_close_all',
+          'odbc_close',
           'odbc_columnprivileges',
           'odbc_columns',
           'odbc_commit',
@@ -1731,40 +2102,69 @@ MODULES = {'.NET': ['dotnet_load'],
           'odbc_primarykeys',
           'odbc_procedurecolumns',
           'odbc_procedures',
-          'odbc_result',
           'odbc_result_all',
+          'odbc_result',
           'odbc_rollback',
           'odbc_setoption',
           'odbc_specialcolumns',
           'odbc_statistics',
           'odbc_tableprivileges',
           'odbc_tables'],
- 'Object Aggregation': ['aggregate',
-                        'aggregate_info',
-                        'aggregate_methods',
+ 'Object Aggregation': ['aggregate_info',
                         'aggregate_methods_by_list',
-                        'aggregate_methods_by_regexp',
-                        'aggregate_properties',
-                        'aggregate_properties_by_list',
-                        'aggregate_properties_by_regexp',
-                        'aggregation_info',
-                        'deaggregate'],
+                        'aggregate_methods_by_regexp'],
  'Object overloading': ['overload'],
- 'OpenSSL': ['openssl_csr_export',
-             'openssl_csr_export_to_file',
+ 'OpenAL': ['openal_buffer_create',
+            'openal_buffer_data',
+            'openal_buffer_destroy',
+            'openal_buffer_get',
+            'openal_buffer_loadwav',
+            'openal_context_create',
+            'openal_context_current',
+            'openal_context_destroy',
+            'openal_context_process',
+            'openal_context_suspend',
+            'openal_device_close',
+            'openal_device_open',
+            'openal_listener_get',
+            'openal_listener_set',
+            'openal_source_create',
+            'openal_source_destroy',
+            'openal_source_get',
+            'openal_source_pause',
+            'openal_source_play',
+            'openal_source_rewind',
+            'openal_source_set',
+            'openal_source_stop',
+            'openal_stream'],
+ 'OpenSSL': ['openssl_csr_export_to_file',
+             'openssl_csr_export',
+             'openssl_csr_get_public_key',
+             'openssl_csr_get_subject',
              'openssl_csr_new',
              'openssl_csr_sign',
+             'openssl_decrypt',
+             'openssl_dh_compute_key',
+             'openssl_digest',
+             'openssl_encrypt',
              'openssl_error_string',
              'openssl_free_key',
+             'openssl_get_cipher_methods',
+             'openssl_get_md_methods',
              'openssl_get_privatekey',
              'openssl_get_publickey',
              'openssl_open',
+             'openssl_pkcs12_export_to_file',
+             'openssl_pkcs12_export',
+             'openssl_pkcs12_read',
              'openssl_pkcs7_decrypt',
              'openssl_pkcs7_encrypt',
              'openssl_pkcs7_sign',
              'openssl_pkcs7_verify',
-             'openssl_pkey_export',
              'openssl_pkey_export_to_file',
+             'openssl_pkey_export',
+             'openssl_pkey_free',
+             'openssl_pkey_get_details',
              'openssl_pkey_get_private',
              'openssl_pkey_get_public',
              'openssl_pkey_new',
@@ -1772,39 +2172,17 @@ MODULES = {'.NET': ['dotnet_load'],
              'openssl_private_encrypt',
              'openssl_public_decrypt',
              'openssl_public_encrypt',
+             'openssl_random_pseudo_bytes',
              'openssl_seal',
              'openssl_sign',
              'openssl_verify',
              'openssl_x509_check_private_key',
              'openssl_x509_checkpurpose',
-             'openssl_x509_export',
              'openssl_x509_export_to_file',
+             'openssl_x509_export',
              'openssl_x509_free',
              'openssl_x509_parse',
              'openssl_x509_read'],
- 'Oracle': ['ora_bind',
-            'ora_close',
-            'ora_columnname',
-            'ora_columnsize',
-            'ora_columntype',
-            'ora_commit',
-            'ora_commitoff',
-            'ora_commiton',
-            'ora_do',
-            'ora_error',
-            'ora_errorcode',
-            'ora_exec',
-            'ora_fetch',
-            'ora_fetch_into',
-            'ora_getcolumn',
-            'ora_logoff',
-            'ora_logon',
-            'ora_numcols',
-            'ora_numrows',
-            'ora_open',
-            'ora_parse',
-            'ora_plogon',
-            'ora_rollback'],
  'Output Control': ['flush',
                     'ob_clean',
                     'ob_end_clean',
@@ -1822,32 +2200,36 @@ MODULES = {'.NET': ['dotnet_load'],
                     'ob_start',
                     'output_add_rewrite_var',
                     'output_reset_rewrite_vars'],
- 'OvrimosSQL': ['ovrimos_close',
-                'ovrimos_commit',
-                'ovrimos_connect',
-                'ovrimos_cursor',
-                'ovrimos_exec',
-                'ovrimos_execute',
-                'ovrimos_fetch_into',
-                'ovrimos_fetch_row',
-                'ovrimos_field_len',
-                'ovrimos_field_name',
-                'ovrimos_field_num',
-                'ovrimos_field_type',
-                'ovrimos_free_result',
-                'ovrimos_longreadlen',
-                'ovrimos_num_fields',
-                'ovrimos_num_rows',
-                'ovrimos_prepare',
-                'ovrimos_result',
-                'ovrimos_result_all',
-                'ovrimos_rollback'],
+ 'Ovrimos SQL': ['ovrimos_close',
+                 'ovrimos_commit',
+                 'ovrimos_connect',
+                 'ovrimos_cursor',
+                 'ovrimos_exec',
+                 'ovrimos_execute',
+                 'ovrimos_fetch_into',
+                 'ovrimos_fetch_row',
+                 'ovrimos_field_len',
+                 'ovrimos_field_name',
+                 'ovrimos_field_num',
+                 'ovrimos_field_type',
+                 'ovrimos_free_result',
+                 'ovrimos_longreadlen',
+                 'ovrimos_num_fields',
+                 'ovrimos_num_rows',
+                 'ovrimos_prepare',
+                 'ovrimos_result_all',
+                 'ovrimos_result',
+                 'ovrimos_rollback'],
  'PCNTL': ['pcntl_alarm',
            'pcntl_exec',
            'pcntl_fork',
            'pcntl_getpriority',
            'pcntl_setpriority',
+           'pcntl_signal_dispatch',
            'pcntl_signal',
+           'pcntl_sigprocmask',
+           'pcntl_sigtimedwait',
+           'pcntl_sigwaitinfo',
            'pcntl_wait',
            'pcntl_waitpid',
            'pcntl_wexitstatus',
@@ -1856,129 +2238,202 @@ MODULES = {'.NET': ['dotnet_load'],
            'pcntl_wifstopped',
            'pcntl_wstopsig',
            'pcntl_wtermsig'],
- 'PCRE': ['preg_grep',
-          'preg_match',
+ 'PCRE': ['preg_filter',
+          'preg_grep',
+          'preg_last_error',
           'preg_match_all',
+          'preg_match',
           'preg_quote',
-          'preg_replace',
           'preg_replace_callback',
+          'preg_replace',
           'preg_split'],
- 'PDF': ['pdf_add_annotation',
-         'pdf_add_bookmark',
-         'pdf_add_launchlink',
-         'pdf_add_locallink',
-         'pdf_add_note',
-         'pdf_add_outline',
-         'pdf_add_pdflink',
-         'pdf_add_thumbnail',
-         'pdf_add_weblink',
-         'pdf_arc',
-         'pdf_arcn',
-         'pdf_attach_file',
-         'pdf_begin_page',
-         'pdf_begin_pattern',
-         'pdf_begin_template',
-         'pdf_circle',
-         'pdf_clip',
-         'pdf_close',
-         'pdf_close_image',
-         'pdf_close_pdi',
-         'pdf_close_pdi_page',
-         'pdf_closepath',
-         'pdf_closepath_fill_stroke',
-         'pdf_closepath_stroke',
-         'pdf_concat',
-         'pdf_continue_text',
-         'pdf_curveto',
-         'pdf_delete',
-         'pdf_end_page',
-         'pdf_end_pattern',
-         'pdf_end_template',
-         'pdf_endpath',
-         'pdf_fill',
-         'pdf_fill_stroke',
-         'pdf_findfont',
-         'pdf_get_buffer',
-         'pdf_get_font',
-         'pdf_get_fontname',
-         'pdf_get_fontsize',
-         'pdf_get_image_height',
-         'pdf_get_image_width',
-         'pdf_get_majorversion',
-         'pdf_get_minorversion',
-         'pdf_get_parameter',
-         'pdf_get_pdi_parameter',
-         'pdf_get_pdi_value',
-         'pdf_get_value',
-         'pdf_initgraphics',
-         'pdf_lineto',
-         'pdf_makespotcolor',
-         'pdf_moveto',
-         'pdf_new',
-         'pdf_open_ccitt',
-         'pdf_open_file',
-         'pdf_open_gif',
-         'pdf_open_image',
-         'pdf_open_image_file',
-         'pdf_open_jpeg',
-         'pdf_open_memory_image',
-         'pdf_open_pdi',
-         'pdf_open_pdi_page',
-         'pdf_open_tiff',
-         'pdf_place_image',
-         'pdf_place_pdi_page',
-         'pdf_rect',
-         'pdf_restore',
-         'pdf_rotate',
-         'pdf_save',
-         'pdf_scale',
-         'pdf_set_border_color',
-         'pdf_set_border_dash',
-         'pdf_set_border_style',
-         'pdf_set_char_spacing',
-         'pdf_set_duration',
-         'pdf_set_horiz_scaling',
-         'pdf_set_info',
-         'pdf_set_info_author',
-         'pdf_set_info_creator',
-         'pdf_set_info_keywords',
-         'pdf_set_info_subject',
-         'pdf_set_info_title',
-         'pdf_set_leading',
-         'pdf_set_parameter',
-         'pdf_set_text_matrix',
-         'pdf_set_text_pos',
-         'pdf_set_text_rendering',
-         'pdf_set_text_rise',
-         'pdf_set_value',
-         'pdf_set_word_spacing',
-         'pdf_setcolor',
-         'pdf_setdash',
-         'pdf_setflat',
-         'pdf_setfont',
-         'pdf_setgray',
-         'pdf_setgray_fill',
-         'pdf_setgray_stroke',
-         'pdf_setlinecap',
-         'pdf_setlinejoin',
-         'pdf_setlinewidth',
-         'pdf_setmatrix',
-         'pdf_setmiterlimit',
-         'pdf_setpolydash',
-         'pdf_setrgbcolor',
-         'pdf_setrgbcolor_fill',
-         'pdf_setrgbcolor_stroke',
-         'pdf_show',
-         'pdf_show_boxed',
-         'pdf_show_xy',
-         'pdf_skew',
-         'pdf_stringwidth',
-         'pdf_stroke',
-         'pdf_translate'],
- 'PHP Options/Info': ['assert',
-                      'assert_options',
+ 'PDF': ['PDF_activate_item',
+         'PDF_add_annotation',
+         'PDF_add_bookmark',
+         'PDF_add_launchlink',
+         'PDF_add_locallink',
+         'PDF_add_nameddest',
+         'PDF_add_note',
+         'PDF_add_outline',
+         'PDF_add_pdflink',
+         'PDF_add_table_cell',
+         'PDF_add_textflow',
+         'PDF_add_thumbnail',
+         'PDF_add_weblink',
+         'PDF_arc',
+         'PDF_arcn',
+         'PDF_attach_file',
+         'PDF_begin_document',
+         'PDF_begin_font',
+         'PDF_begin_glyph',
+         'PDF_begin_item',
+         'PDF_begin_layer',
+         'PDF_begin_page_ext',
+         'PDF_begin_page',
+         'PDF_begin_pattern',
+         'PDF_begin_template_ext',
+         'PDF_begin_template',
+         'PDF_circle',
+         'PDF_clip',
+         'PDF_close_image',
+         'PDF_close_pdi_page',
+         'PDF_close_pdi',
+         'PDF_close',
+         'PDF_closepath_fill_stroke',
+         'PDF_closepath_stroke',
+         'PDF_closepath',
+         'PDF_concat',
+         'PDF_continue_text',
+         'PDF_create_3dview',
+         'PDF_create_action',
+         'PDF_create_annotation',
+         'PDF_create_bookmark',
+         'PDF_create_field',
+         'PDF_create_fieldgroup',
+         'PDF_create_gstate',
+         'PDF_create_pvf',
+         'PDF_create_textflow',
+         'PDF_curveto',
+         'PDF_define_layer',
+         'PDF_delete_pvf',
+         'PDF_delete_table',
+         'PDF_delete_textflow',
+         'PDF_delete',
+         'PDF_encoding_set_char',
+         'PDF_end_document',
+         'PDF_end_font',
+         'PDF_end_glyph',
+         'PDF_end_item',
+         'PDF_end_layer',
+         'PDF_end_page_ext',
+         'PDF_end_page',
+         'PDF_end_pattern',
+         'PDF_end_template',
+         'PDF_endpath',
+         'PDF_fill_imageblock',
+         'PDF_fill_pdfblock',
+         'PDF_fill_stroke',
+         'PDF_fill_textblock',
+         'PDF_fill',
+         'PDF_findfont',
+         'PDF_fit_image',
+         'PDF_fit_pdi_page',
+         'PDF_fit_table',
+         'PDF_fit_textflow',
+         'PDF_fit_textline',
+         'PDF_get_apiname',
+         'PDF_get_buffer',
+         'PDF_get_errmsg',
+         'PDF_get_errnum',
+         'PDF_get_font',
+         'PDF_get_fontname',
+         'PDF_get_fontsize',
+         'PDF_get_image_height',
+         'PDF_get_image_width',
+         'PDF_get_majorversion',
+         'PDF_get_minorversion',
+         'PDF_get_parameter',
+         'PDF_get_pdi_parameter',
+         'PDF_get_pdi_value',
+         'PDF_get_value',
+         'PDF_info_font',
+         'PDF_info_matchbox',
+         'PDF_info_table',
+         'PDF_info_textflow',
+         'PDF_info_textline',
+         'PDF_initgraphics',
+         'PDF_lineto',
+         'PDF_load_3ddata',
+         'PDF_load_font',
+         'PDF_load_iccprofile',
+         'PDF_load_image',
+         'PDF_makespotcolor',
+         'PDF_moveto',
+         'PDF_new',
+         'PDF_open_ccitt',
+         'PDF_open_file',
+         'PDF_open_gif',
+         'PDF_open_image_file',
+         'PDF_open_image',
+         'PDF_open_jpeg',
+         'PDF_open_memory_image',
+         'PDF_open_pdi_document',
+         'PDF_open_pdi_page',
+         'PDF_open_pdi',
+         'PDF_open_tiff',
+         'PDF_pcos_get_number',
+         'PDF_pcos_get_stream',
+         'PDF_pcos_get_string',
+         'PDF_place_image',
+         'PDF_place_pdi_page',
+         'PDF_process_pdi',
+         'PDF_rect',
+         'PDF_restore',
+         'PDF_resume_page',
+         'PDF_rotate',
+         'PDF_save',
+         'PDF_scale',
+         'PDF_set_border_color',
+         'PDF_set_border_dash',
+         'PDF_set_border_style',
+         'PDF_set_char_spacing',
+         'PDF_set_duration',
+         'PDF_set_gstate',
+         'PDF_set_horiz_scaling',
+         'PDF_set_info_author',
+         'PDF_set_info_creator',
+         'PDF_set_info_keywords',
+         'PDF_set_info_subject',
+         'PDF_set_info_title',
+         'PDF_set_info',
+         'PDF_set_layer_dependency',
+         'PDF_set_leading',
+         'PDF_set_parameter',
+         'PDF_set_text_matrix',
+         'PDF_set_text_pos',
+         'PDF_set_text_rendering',
+         'PDF_set_text_rise',
+         'PDF_set_value',
+         'PDF_set_word_spacing',
+         'PDF_setcolor',
+         'PDF_setdash',
+         'PDF_setdashpattern',
+         'PDF_setflat',
+         'PDF_setfont',
+         'PDF_setgray_fill',
+         'PDF_setgray_stroke',
+         'PDF_setgray',
+         'PDF_setlinecap',
+         'PDF_setlinejoin',
+         'PDF_setlinewidth',
+         'PDF_setmatrix',
+         'PDF_setmiterlimit',
+         'PDF_setpolydash',
+         'PDF_setrgbcolor_fill',
+         'PDF_setrgbcolor_stroke',
+         'PDF_setrgbcolor',
+         'PDF_shading_pattern',
+         'PDF_shading',
+         'PDF_shfill',
+         'PDF_show_boxed',
+         'PDF_show_xy',
+         'PDF_show',
+         'PDF_skew',
+         'PDF_stringwidth',
+         'PDF_stroke',
+         'PDF_suspend_page',
+         'PDF_translate',
+         'PDF_utf16_to_utf8',
+         'PDF_utf32_to_utf16',
+         'PDF_utf8_to_utf16'],
+ 'PHP Options/Info': ['assert_options',
+                      'assert',
                       'dl',
                       'extension_loaded',
+                      'gc_collect_cycles',
+                      'gc_disable',
+                      'gc_enable',
+                      'gc_enabled',
                       'get_cfg_var',
                       'get_current_user',
                       'get_defined_constants',
@@ -1998,12 +2453,14 @@ MODULES = {'.NET': ['dotnet_load'],
                       'getopt',
                       'getrusage',
                       'ini_alter',
-                      'ini_get',
                       'ini_get_all',
+                      'ini_get',
                       'ini_restore',
                       'ini_set',
-                      'main',
+                      'magic_quotes_runtime',
+                      'memory_get_peak_usage',
                       'memory_get_usage',
+                      'php_ini_loaded_file',
                       'php_ini_scanned_files',
                       'php_logo_guid',
                       'php_sapi_name',
@@ -2016,10 +2473,14 @@ MODULES = {'.NET': ['dotnet_load'],
                       'set_include_path',
                       'set_magic_quotes_runtime',
                       'set_time_limit',
+                      'sys_get_temp_dir',
                       'version_compare',
                       'zend_logo_guid',
+                      'zend_thread_id',
                       'zend_version'],
- 'POSIX': ['posix_ctermid',
+ 'POSIX': ['posix_access',
+           'posix_ctermid',
+           'posix_errno',
            'posix_get_last_error',
            'posix_getcwd',
            'posix_getegid',
@@ -2038,9 +2499,11 @@ MODULES = {'.NET': ['dotnet_load'],
            'posix_getrlimit',
            'posix_getsid',
            'posix_getuid',
+           'posix_initgroups',
            'posix_isatty',
            'posix_kill',
            'posix_mkfifo',
+           'posix_mknod',
            'posix_setegid',
            'posix_seteuid',
            'posix_setgid',
@@ -2051,13 +2514,116 @@ MODULES = {'.NET': ['dotnet_load'],
            'posix_times',
            'posix_ttyname',
            'posix_uname'],
- 'POSIX Regex': ['ereg',
-                 'ereg_replace',
-                 'eregi',
+ 'POSIX Regex': ['ereg_replace',
+                 'ereg',
                  'eregi_replace',
+                 'eregi',
                  'split',
                  'spliti',
                  'sql_regcase'],
+ 'PS': ['ps_add_bookmark',
+        'ps_add_launchlink',
+        'ps_add_locallink',
+        'ps_add_note',
+        'ps_add_pdflink',
+        'ps_add_weblink',
+        'ps_arc',
+        'ps_arcn',
+        'ps_begin_page',
+        'ps_begin_pattern',
+        'ps_begin_template',
+        'ps_circle',
+        'ps_clip',
+        'ps_close_image',
+        'ps_close',
+        'ps_closepath_stroke',
+        'ps_closepath',
+        'ps_continue_text',
+        'ps_curveto',
+        'ps_delete',
+        'ps_end_page',
+        'ps_end_pattern',
+        'ps_end_template',
+        'ps_fill_stroke',
+        'ps_fill',
+        'ps_findfont',
+        'ps_get_buffer',
+        'ps_get_parameter',
+        'ps_get_value',
+        'ps_hyphenate',
+        'ps_include_file',
+        'ps_lineto',
+        'ps_makespotcolor',
+        'ps_moveto',
+        'ps_new',
+        'ps_open_file',
+        'ps_open_image_file',
+        'ps_open_image',
+        'ps_open_memory_image',
+        'ps_place_image',
+        'ps_rect',
+        'ps_restore',
+        'ps_rotate',
+        'ps_save',
+        'ps_scale',
+        'ps_set_border_color',
+        'ps_set_border_dash',
+        'ps_set_border_style',
+        'ps_set_info',
+        'ps_set_parameter',
+        'ps_set_text_pos',
+        'ps_set_value',
+        'ps_setcolor',
+        'ps_setdash',
+        'ps_setflat',
+        'ps_setfont',
+        'ps_setgray',
+        'ps_setlinecap',
+        'ps_setlinejoin',
+        'ps_setlinewidth',
+        'ps_setmiterlimit',
+        'ps_setoverprintmode',
+        'ps_setpolydash',
+        'ps_shading_pattern',
+        'ps_shading',
+        'ps_shfill',
+        'ps_show_boxed',
+        'ps_show_xy2',
+        'ps_show_xy',
+        'ps_show2',
+        'ps_show',
+        'ps_string_geometry',
+        'ps_stringwidth',
+        'ps_stroke',
+        'ps_symbol_name',
+        'ps_symbol_width',
+        'ps_symbol',
+        'ps_translate'],
+ 'Paradox': ['px_close',
+             'px_create_fp',
+             'px_date2string',
+             'px_delete_record',
+             'px_delete',
+             'px_get_field',
+             'px_get_info',
+             'px_get_parameter',
+             'px_get_record',
+             'px_get_schema',
+             'px_get_value',
+             'px_insert_record',
+             'px_new',
+             'px_numfields',
+             'px_numrecords',
+             'px_open_fp',
+             'px_put_record',
+             'px_retrieve_record',
+             'px_set_blob_file',
+             'px_set_parameter',
+             'px_set_tablename',
+             'px_set_targetencoding',
+             'px_set_value',
+             'px_timestamp2string',
+             'px_update_record'],
  'Parsekit': ['parsekit_compile_file',
               'parsekit_compile_string',
               'parsekit_func_arginfo'],
@@ -2077,6 +2643,8 @@ MODULES = {'.NET': ['dotnet_load'],
                 'pg_end_copy',
                 'pg_escape_bytea',
                 'pg_escape_string',
+                'pg_execute',
+                'pg_fetch_all_columns',
                 'pg_fetch_all',
                 'pg_fetch_array',
                 'pg_fetch_assoc',
@@ -2088,6 +2656,8 @@ MODULES = {'.NET': ['dotnet_load'],
                 'pg_field_num',
                 'pg_field_prtlen',
                 'pg_field_size',
+                'pg_field_table',
+                'pg_field_type_oid',
                 'pg_field_type',
                 'pg_free_result',
                 'pg_get_notify',
@@ -2103,8 +2673,8 @@ MODULES = {'.NET': ['dotnet_load'],
                 'pg_lo_export',
                 'pg_lo_import',
                 'pg_lo_open',
-                'pg_lo_read',
                 'pg_lo_read_all',
+                'pg_lo_read',
                 'pg_lo_seek',
                 'pg_lo_tell',
                 'pg_lo_unlink',
@@ -2117,20 +2687,7 @@ MODULES = {'.NET': ['dotnet_load'],
                 'pg_pconnect',
                 'pg_ping',
                 'pg_port',
-                'pg_put_line',
-                'pg_query',
-                'pg_result_error',
-                'pg_result_seek',
-                'pg_result_status',
-                'pg_select',
-                'pg_send_query',
-                'pg_set_client_encoding',
-                'pg_trace',
-                'pg_tty',
-                'pg_unescape_bytea',
-                'pg_untrace',
-                'pg_update',
-                'pg_version'],
+                'pg_prepare'],
  'Printer': ['printer_abort',
              'printer_close',
              'printer_create_brush',
@@ -2162,7 +2719,7 @@ MODULES = {'.NET': ['dotnet_load'],
              'printer_start_doc',
              'printer_start_page',
              'printer_write'],
- 'Program Execution': ['escapeshellarg',
+ 'Program execution': ['escapeshellarg',
                        'escapeshellcmd',
                        'exec',
                        'passthru',
@@ -2185,16 +2742,51 @@ MODULES = {'.NET': ['dotnet_load'],
             'pspell_config_personal',
             'pspell_config_repl',
             'pspell_config_runtogether',
-            'pspell_config_save_repl',
-            'pspell_new',
-            'pspell_new_config',
-            'pspell_new_personal',
-            'pspell_save_wordlist',
-            'pspell_store_replacement',
-            'pspell_suggest'],
- 'Rar': ['rar_close', 'rar_entry_get', 'rar_list', 'rar_open'],
- 'Readline': ['readline',
-              'readline_add_history',
+            'pspell_config_save_repl'],
+ 'RPM Reader': ['rpm_close',
+                'rpm_get_tag',
+                'rpm_is_valid',
+                'rpm_open',
+                'rpm_version'],
+ 'RRD': ['rrd_create',
+         'rrd_error',
+         'rrd_fetch',
+         'rrd_first',
+         'rrd_graph',
+         'rrd_info',
+         'rrd_last',
+         'rrd_lastupdate',
+         'rrd_restore',
+         'rrd_tune',
+         'rrd_update',
+         'rrd_xport'],
+ 'Radius': ['radius_acct_open',
+            'radius_add_server',
+            'radius_auth_open',
+            'radius_close',
+            'radius_config',
+            'radius_create_request',
+            'radius_cvt_addr',
+            'radius_cvt_int',
+            'radius_cvt_string',
+            'radius_demangle_mppe_key',
+            'radius_demangle',
+            'radius_get_attr',
+            'radius_get_vendor_attr',
+            'radius_put_addr',
+            'radius_put_attr',
+            'radius_put_int',
+            'radius_put_string',
+            'radius_put_vendor_addr',
+            'radius_put_vendor_attr',
+            'radius_put_vendor_int',
+            'radius_put_vendor_string',
+            'radius_request_authenticator',
+            'radius_send_request',
+            'radius_server_secret',
+            'radius_strerror'],
+ 'Rar': ['rar_wrapper_cache_stats'],
+ 'Readline': ['readline_add_history',
               'readline_callback_handler_install',
               'readline_callback_handler_remove',
               'readline_callback_read_char',
@@ -2205,78 +2797,124 @@ MODULES = {'.NET': ['dotnet_load'],
               'readline_on_new_line',
               'readline_read_history',
               'readline_redisplay',
-              'readline_write_history'],
- 'Recode': ['recode', 'recode_file', 'recode_string'],
- 'SESAM': ['sesam_affected_rows',
-           'sesam_commit',
-           'sesam_connect',
-           'sesam_diagnostic',
-           'sesam_disconnect',
-           'sesam_errormsg',
-           'sesam_execimm',
-           'sesam_fetch_array',
-           'sesam_fetch_result',
-           'sesam_fetch_row',
-           'sesam_field_array',
-           'sesam_field_name',
-           'sesam_free_result',
-           'sesam_num_fields',
-           'sesam_query',
-           'sesam_rollback',
-           'sesam_seek_row',
-           'sesam_settransaction'],
+              'readline_write_history',
+              'readline'],
+ 'Recode': ['recode_file', 'recode_string', 'recode'],
  'SNMP': ['snmp_get_quick_print',
           'snmp_get_valueretrieval',
           'snmp_read_mib',
           'snmp_set_enum_print',
           'snmp_set_oid_numeric_print',
+          'snmp_set_oid_output_format',
           'snmp_set_quick_print',
           'snmp_set_valueretrieval',
+          'snmp2_get',
+          'snmp2_getnext',
+          'snmp2_real_walk',
+          'snmp2_set',
+          'snmp2_walk',
+          'snmp3_get',
+          'snmp3_getnext',
+          'snmp3_real_walk',
+          'snmp3_set',
+          'snmp3_walk',
           'snmpget',
           'snmpgetnext',
           'snmprealwalk',
           'snmpset',
           'snmpwalk',
           'snmpwalkoid'],
- 'SOAP': ['is_soap_fault'],
- 'SQLite': ['sqlite_array_query',
-            'sqlite_busy_timeout',
-            'sqlite_changes',
-            'sqlite_close',
-            'sqlite_column',
-            'sqlite_create_aggregate',
-            'sqlite_create_function',
-            'sqlite_current',
-            'sqlite_error_string',
-            'sqlite_escape_string',
-            'sqlite_exec',
-            'sqlite_factory',
-            'sqlite_fetch_all',
-            'sqlite_fetch_array',
-            'sqlite_fetch_column_types',
-            'sqlite_fetch_object',
-            'sqlite_fetch_single',
-            'sqlite_fetch_string',
-            'sqlite_field_name',
-            'sqlite_has_more',
-            'sqlite_has_prev',
-            'sqlite_last_error',
-            'sqlite_last_insert_rowid',
-            'sqlite_libencoding',
-            'sqlite_libversion',
-            'sqlite_next',
-            'sqlite_num_fields',
-            'sqlite_num_rows',
-            'sqlite_open',
-            'sqlite_popen',
-            'sqlite_prev',
-            'sqlite_query',
-            'sqlite_rewind',
-            'sqlite_seek',
-            'sqlite_single_query',
-            'sqlite_udf_decode_binary',
-            'sqlite_udf_encode_binary',
-            'sqlite_unbuffered_query'],
+ 'SOAP': ['is_soap_fault', 'use_soap_error_handler'],
+ 'SPL': ['class_implements',
+         'class_parents',
+         'iterator_apply',
+         'iterator_count',
+         'iterator_to_array',
+         'spl_autoload_call',
+         'spl_autoload_extensions',
+         'spl_autoload_functions',
+         'spl_autoload_register',
+         'spl_autoload_unregister',
+         'spl_autoload',
+         'spl_classes',
+         'spl_object_hash'],
+ 'SPPLUS': ['calcul_hmac', 'calculhmac', 'nthmac', 'signeurlpaiement'],
+ 'SQLite': ['sqlite_array_query', 'sqlite_busy_timeout', 'sqlite_changes'],
+ 'SSH2': ['ssh2_auth_hostbased_file',
+          'ssh2_auth_none',
+          'ssh2_auth_password',
+          'ssh2_auth_pubkey_file',
+          'ssh2_connect',
+          'ssh2_exec',
+          'ssh2_fetch_stream',
+          'ssh2_fingerprint',
+          'ssh2_methods_negotiated',
+          'ssh2_publickey_add',
+          'ssh2_publickey_init',
+          'ssh2_publickey_list',
+          'ssh2_publickey_remove',
+          'ssh2_scp_recv',
+          'ssh2_scp_send',
+          'ssh2_sftp_lstat',
+          'ssh2_sftp_mkdir',
+          'ssh2_sftp_readlink',
+          'ssh2_sftp_realpath',
+          'ssh2_sftp_rename',
+          'ssh2_sftp_rmdir',
+          'ssh2_sftp_stat',
+          'ssh2_sftp_symlink',
+          'ssh2_sftp_unlink',
+          'ssh2_sftp',
+          'ssh2_shell',
+          'ssh2_tunnel'],
+ 'SVN': ['svn_add',
+         'svn_auth_get_parameter',
+         'svn_auth_set_parameter',
+         'svn_blame',
+         'svn_cat',
+         'svn_checkout',
+         'svn_cleanup',
+         'svn_client_version',
+         'svn_commit',
+         'svn_delete',
+         'svn_diff',
+         'svn_export',
+         'svn_fs_abort_txn',
+         'svn_fs_apply_text',
+         'svn_fs_begin_txn2',
+         'svn_fs_change_node_prop',
+         'svn_fs_check_path',
+         'svn_fs_contents_changed',
+         'svn_fs_copy',
+         'svn_fs_delete',
+         'svn_fs_dir_entries',
+         'svn_fs_file_contents',
+         'svn_fs_file_length',
+         'svn_fs_is_dir',
+         'svn_fs_is_file',
+         'svn_fs_make_dir',
+         'svn_fs_make_file',
+         'svn_fs_node_created_rev',
+         'svn_fs_node_prop',
+         'svn_fs_props_changed',
+         'svn_fs_revision_prop',
+         'svn_fs_revision_root',
+         'svn_fs_txn_root',
+         'svn_fs_youngest_rev',
+         'svn_import',
+         'svn_log',
+         'svn_ls',
+         'svn_mkdir',
+         'svn_repos_create',
+         'svn_repos_fs_begin_txn_for_commit',
+         'svn_repos_fs_commit_txn',
+         'svn_repos_fs',
+         'svn_repos_hotcopy',
+         'svn_repos_open',
+         'svn_repos_recover',
+         'svn_revert',
+         'svn_status',
+         'svn_update'],
  'SWF': ['swf_actiongeturl',
          'swf_actiongotoframe',
          'swf_actiongotolabel',
@@ -2313,8 +2951,8 @@ MODULES = {'.NET': ['dotnet_load'],
          'swf_nextid',
          'swf_oncondition',
          'swf_openfile',
-         'swf_ortho',
          'swf_ortho2',
+         'swf_ortho',
          'swf_perspective',
          'swf_placeobject',
          'swf_polarview',
@@ -2327,8 +2965,8 @@ MODULES = {'.NET': ['dotnet_load'],
          'swf_setfont',
          'swf_setframe',
          'swf_shapearc',
-         'swf_shapecurveto',
          'swf_shapecurveto3',
+         'swf_shapecurveto',
          'swf_shapefillbitmapclip',
          'swf_shapefillbitmaptile',
          'swf_shapefilloff',
@@ -2346,6 +2984,7 @@ MODULES = {'.NET': ['dotnet_load'],
          'swf_viewport'],
  'Semaphore': ['ftok',
                'msg_get_queue',
+               'msg_queue_exists',
                'msg_receive',
                'msg_remove_queue',
                'msg_send',
@@ -2358,182 +2997,250 @@ MODULES = {'.NET': ['dotnet_load'],
                'shm_attach',
                'shm_detach',
                'shm_get_var',
+               'shm_has_var',
                'shm_put_var',
-               'shm_remove',
-               'shm_remove_var'],
- 'Sessions': ['session_cache_expire',
-              'session_cache_limiter',
-              'session_commit',
-              'session_decode',
-              'session_destroy',
-              'session_encode',
-              'session_get_cookie_params',
-              'session_id',
-              'session_is_registered',
-              'session_module_name',
-              'session_name',
-              'session_regenerate_id',
-              'session_register',
-              'session_save_path',
-              'session_set_cookie_params',
-              'session_set_save_handler',
-              'session_start',
-              'session_unregister',
-              'session_unset',
-              'session_write_close'],
+               'shm_remove_var',
+               'shm_remove'],
+ 'Session': ['session_cache_expire',
+             'session_cache_limiter',
+             'session_commit',
+             'session_decode',
+             'session_destroy',
+             'session_encode',
+             'session_get_cookie_params',
+             'session_id',
+             'session_is_registered',
+             'session_module_name',
+             'session_name',
+             'session_regenerate_id',
+             'session_register',
+             'session_save_path',
+             'session_set_cookie_params',
+             'session_set_save_handler',
+             'session_start',
+             'session_unregister',
+             'session_unset',
+             'session_write_close'],
+ 'Session PgSQL': ['session_pgsql_add_error',
+                   'session_pgsql_get_error',
+                   'session_pgsql_get_field',
+                   'session_pgsql_reset',
+                   'session_pgsql_set_field',
+                   'session_pgsql_status'],
+ 'Shared Memory': ['shmop_close',
+                   'shmop_delete',
+                   'shmop_open',
+                   'shmop_read',
+                   'shmop_size',
+                   'shmop_write'],
  'SimpleXML': ['simplexml_import_dom',
                'simplexml_load_file',
                'simplexml_load_string'],
- 'Sockets': ['socket_accept',
-             'socket_bind',
-             'socket_clear_error',
-             'socket_close',
-             'socket_connect',
-             'socket_create',
-             'socket_create_listen',
-             'socket_create_pair',
-             'socket_get_option',
-             'socket_getpeername',
-             'socket_getsockname',
-             'socket_last_error',
-             'socket_listen',
-             'socket_read',
-             'socket_recv',
-             'socket_recvfrom',
-             'socket_select',
-             'socket_send',
-             'socket_sendto',
-             'socket_set_block',
-             'socket_set_nonblock',
-             'socket_set_option',
-             'socket_shutdown',
-             'socket_strerror',
-             'socket_write'],
- 'Streams': ['stream_context_create',
-             'stream_context_get_default',
-             'stream_context_get_options',
-             'stream_context_set_option',
-             'stream_context_set_params',
-             'stream_copy_to_stream',
-             'stream_filter_append',
-             'stream_filter_prepend',
-             'stream_filter_register',
-             'stream_filter_remove',
-             'stream_get_contents',
-             'stream_get_filters',
-             'stream_get_line',
-             'stream_get_meta_data',
-             'stream_get_transports',
-             'stream_get_wrappers',
-             'stream_register_wrapper',
-             'stream_select',
-             'stream_set_blocking',
-             'stream_set_timeout',
-             'stream_set_write_buffer',
-             'stream_socket_accept',
-             'stream_socket_client',
-             'stream_socket_enable_crypto',
-             'stream_socket_get_name',
-             'stream_socket_pair',
-             'stream_socket_recvfrom',
-             'stream_socket_sendto',
-             'stream_socket_server',
-             'stream_wrapper_register',
-             'stream_wrapper_restore',
-             'stream_wrapper_unregister'],
- 'Strings': ['addcslashes',
-             'addslashes',
-             'bin2hex',
-             'chop',
-             'chr',
-             'chunk_split',
-             'convert_cyr_string',
-             'convert_uudecode',
-             'convert_uuencode',
-             'count_chars',
-             'crc32',
-             'crypt',
-             'echo',
-             'explode',
-             'fprintf',
-             'get_html_translation_table',
-             'hebrev',
-             'hebrevc',
-             'html_entity_decode',
-             'htmlentities',
-             'htmlspecialchars',
-             'implode',
-             'join',
-             'levenshtein',
-             'localeconv',
-             'ltrim',
-             'md5',
-             'md5_file',
-             'metaphone',
-             'money_format',
-             'nl2br',
-             'nl_langinfo',
-             'number_format',
-             'ord',
-             'parse_str',
-             'print',
-             'printf',
-             'quoted_printable_decode',
-             'quotemeta',
-             'rtrim',
-             'setlocale',
-             'sha1',
-             'sha1_file',
-             'similar_text',
-             'soundex',
-             'sprintf',
-             'sscanf',
-             'str_ireplace',
-             'str_pad',
-             'str_repeat',
-             'str_replace',
-             'str_rot13',
-             'str_shuffle',
-             'str_split',
-             'str_word_count',
-             'strcasecmp',
-             'strchr',
-             'strcmp',
-             'strcoll',
-             'strcspn',
-             'strip_tags',
-             'stripcslashes',
-             'stripos',
-             'stripslashes',
-             'stristr',
-             'strlen',
-             'strnatcasecmp',
-             'strnatcmp',
-             'strncasecmp',
-             'strncmp',
-             'strpbrk',
-             'strpos',
-             'strrchr',
-             'strrev',
-             'strripos',
-             'strrpos',
-             'strspn',
-             'strstr',
-             'strtok',
-             'strtolower',
-             'strtoupper',
-             'strtr',
-             'substr',
-             'substr_compare',
-             'substr_count',
-             'substr_replace',
-             'trim',
-             'ucfirst',
-             'ucwords',
-             'vfprintf',
-             'vprintf',
-             'vsprintf',
-             'wordwrap'],
+ 'Socket': ['socket_accept',
+            'socket_bind',
+            'socket_clear_error',
+            'socket_close',
+            'socket_connect',
+            'socket_create_listen',
+            'socket_create_pair',
+            'socket_create',
+            'socket_get_option',
+            'socket_getpeername',
+            'socket_getsockname',
+            'socket_last_error',
+            'socket_listen',
+            'socket_read',
+            'socket_recv',
+            'socket_recvfrom',
+            'socket_select',
+            'socket_send',
+            'socket_sendto',
+            'socket_set_block',
+            'socket_set_nonblock',
+            'socket_set_option',
+            'socket_shutdown',
+            'socket_strerror',
+            'socket_write'],
+ 'Solr': ['solr_get_version'],
+ 'Statistic': ['stats_absolute_deviation',
+               'stats_cdf_beta',
+               'stats_cdf_binomial',
+               'stats_cdf_cauchy',
+               'stats_cdf_chisquare',
+               'stats_cdf_exponential',
+               'stats_cdf_f',
+               'stats_cdf_gamma',
+               'stats_cdf_laplace',
+               'stats_cdf_logistic',
+               'stats_cdf_negative_binomial',
+               'stats_cdf_noncentral_chisquare',
+               'stats_cdf_noncentral_f',
+               'stats_cdf_poisson',
+               'stats_cdf_t',
+               'stats_cdf_uniform',
+               'stats_cdf_weibull',
+               'stats_covariance',
+               'stats_den_uniform',
+               'stats_dens_beta',
+               'stats_dens_cauchy',
+               'stats_dens_chisquare',
+               'stats_dens_exponential',
+               'stats_dens_f',
+               'stats_dens_gamma',
+               'stats_dens_laplace',
+               'stats_dens_logistic',
+               'stats_dens_negative_binomial',
+               'stats_dens_normal',
+               'stats_dens_pmf_binomial',
+               'stats_dens_pmf_hypergeometric',
+               'stats_dens_pmf_poisson',
+               'stats_dens_t',
+               'stats_dens_weibull',
+               'stats_harmonic_mean',
+               'stats_kurtosis',
+               'stats_rand_gen_beta',
+               'stats_rand_gen_chisquare',
+               'stats_rand_gen_exponential',
+               'stats_rand_gen_f',
+               'stats_rand_gen_funiform',
+               'stats_rand_gen_gamma',
+               'stats_rand_gen_ibinomial_negative',
+               'stats_rand_gen_ibinomial',
+               'stats_rand_gen_int',
+               'stats_rand_gen_ipoisson',
+               'stats_rand_gen_iuniform',
+               'stats_rand_gen_noncenral_chisquare',
+               'stats_rand_gen_noncentral_f',
+               'stats_rand_gen_noncentral_t',
+               'stats_rand_gen_normal',
+               'stats_rand_gen_t',
+               'stats_rand_get_seeds',
+               'stats_rand_phrase_to_seeds',
+               'stats_rand_ranf',
+               'stats_rand_setall',
+               'stats_skew',
+               'stats_standard_deviation',
+               'stats_stat_binomial_coef',
+               'stats_stat_correlation',
+               'stats_stat_gennch',
+               'stats_stat_independent_t',
+               'stats_stat_innerproduct',
+               'stats_stat_noncentral_t',
+               'stats_stat_paired_t',
+               'stats_stat_percentile',
+               'stats_stat_powersum',
+               'stats_variance'],
+ 'Stomp': ['stomp_connect_error', 'stomp_version'],
+ 'Stream': ['set_socket_blocking',
+            'stream_bucket_append',
+            'stream_bucket_make_writeable',
+            'stream_bucket_new',
+            'stream_bucket_prepend',
+            'stream_context_create',
+            'stream_context_get_default',
+            'stream_context_get_options',
+            'stream_context_get_params',
+            'stream_context_set_default',
+            'stream_context_set_option',
+            'stream_context_set_params',
+            'stream_copy_to_stream',
+            'stream_encoding',
+            'stream_filter_append',
+            'stream_filter_prepend',
+            'stream_filter_register',
+            'stream_filter_remove',
+            'stream_get_contents',
+            'stream_get_filters',
+            'stream_get_line',
+            'stream_get_meta_data',
+            'stream_get_transports',
+            'stream_get_wrappers',
+            'stream_is_local',
+            'stream_notification_callback',
+            'stream_register_wrapper',
+            'stream_resolve_include_path',
+            'stream_select'],
+ 'String': ['addcslashes',
+            'addslashes',
+            'bin2hex',
+            'chop',
+            'chr',
+            'chunk_split',
+            'convert_cyr_string',
+            'convert_uudecode',
+            'convert_uuencode',
+            'count_chars',
+            'crc32',
+            'crypt',
+            'echo',
+            'explode',
+            'fprintf',
+            'get_html_translation_table',
+            'hebrev',
+            'hebrevc',
+            'html_entity_decode',
+            'htmlentities',
+            'htmlspecialchars_decode',
+            'htmlspecialchars',
+            'implode',
+            'join',
+            'lcfirst',
+            'levenshtein',
+            'localeconv',
+            'ltrim',
+            'md5_file',
+            'md5',
+            'metaphone',
+            'money_format',
+            'nl_langinfo',
+            'nl2br',
+            'number_format',
+            'ord',
+            'parse_str',
+            'print',
+            'printf',
+            'quoted_printable_decode',
+            'quoted_printable_encode',
+            'quotemeta',
+            'rtrim',
+            'setlocale',
+            'sha1_file',
+            'sha1',
+            'similar_text',
+            'soundex',
+            'sprintf',
+            'sscanf',
+            'str_getcsv',
+            'str_ireplace',
+            'str_pad',
+            'str_repeat',
+            'str_replace',
+            'str_rot13',
+            'str_shuffle',
+            'str_split',
+            'str_word_count',
+            'strcasecmp',
+            'strchr',
+            'strcmp',
+            'strcoll',
+            'strcspn',
+            'strip_tags',
+            'stripcslashes',
+            'stripos',
+            'stripslashes',
+            'stristr',
+            'strlen',
+            'strnatcasecmp',
+            'strnatcmp',
+            'strncasecmp',
+            'strncmp',
+            'strpbrk',
+            'strpos',
+            'strrchr',
+            'strrev',
+            'strripos',
+            'strrpos',
+            'strspn'],
  'Sybase': ['sybase_affected_rows',
             'sybase_close',
             'sybase_connect',
@@ -2559,56 +3266,63 @@ MODULES = {'.NET': ['dotnet_load'],
             'sybase_select_db',
             'sybase_set_message_handler',
             'sybase_unbuffered_query'],
- 'TCP Wrappers': ['tcpwrap_check'],
+ 'TCP': ['tcpwrap_check'],
+ 'Tidy': ['ob_tidyhandler',
+          'tidy_access_count',
+          'tidy_config_count',
+          'tidy_error_count',
+          'tidy_get_error_buffer',
+          'tidy_get_output',
+          'tidy_load_config',
+          'tidy_reset_config',
+          'tidy_save_config',
+          'tidy_set_encoding',
+          'tidy_setopt',
+          'tidy_warning_count'],
  'Tokenizer': ['token_get_all', 'token_name'],
- 'URLs': ['base64_decode',
-          'base64_encode',
-          'get_headers',
-          'get_meta_tags',
-          'http_build_query',
-          'parse_url',
-          'rawurldecode',
-          'rawurlencode',
-          'urldecode',
-          'urlencode'],
- 'Variables handling': ['debug_zval_dump',
-                        'doubleval',
-                        'empty',
-                        'floatval',
-                        'get_defined_vars',
-                        'get_resource_type',
-                        'gettype',
-                        'import_request_variables',
-                        'intval',
-                        'is_array',
-                        'is_bool',
-                        'is_callable',
-                        'is_double',
-                        'is_float',
-                        'is_int',
-                        'is_integer',
-                        'is_long',
-                        'is_null',
-                        'is_numeric',
-                        'is_object',
-                        'is_real',
-                        'is_resource',
-                        'is_scalar',
-                        'is_string',
-                        'isset',
-                        'print_r',
-                        'serialize',
-                        'settype',
-                        'strval',
-                        'unserialize',
-                        'unset',
-                        'var_dump',
-                        'var_export'],
- 'Verisign Payflow Pro': ['pfpro_cleanup',
-                          'pfpro_init',
-                          'pfpro_process',
-                          'pfpro_process_raw',
-                          'pfpro_version'],
+ 'URL': ['base64_decode',
+         'base64_encode',
+         'get_headers',
+         'get_meta_tags',
+         'http_build_query',
+         'parse_url',
+         'rawurldecode',
+         'rawurlencode',
+         'urldecode',
+         'urlencode'],
+ 'Variable handling': ['debug_zval_dump',
+                       'doubleval',
+                       'empty',
+                       'floatval',
+                       'get_defined_vars',
+                       'get_resource_type',
+                       'gettype',
+                       'import_request_variables',
+                       'intval',
+                       'is_array',
+                       'is_bool',
+                       'is_callable',
+                       'is_double',
+                       'is_float',
+                       'is_int',
+                       'is_integer',
+                       'is_long',
+                       'is_null',
+                       'is_numeric',
+                       'is_object',
+                       'is_real',
+                       'is_resource',
+                       'is_scalar',
+                       'is_string',
+                       'isset',
+                       'print_r',
+                       'serialize',
+                       'settype',
+                       'strval',
+                       'unserialize',
+                       'unset',
+                       'var_dump',
+                       'var_export'],
  'W32api': ['w32api_deftype',
             'w32api_init_dtype',
             'w32api_invoke_function',
@@ -2619,35 +3333,35 @@ MODULES = {'.NET': ['dotnet_load'],
           'wddx_packet_end',
           'wddx_packet_start',
           'wddx_serialize_value',
-          'wddx_serialize_vars'],
- 'XML': ['utf8_decode',
-         'utf8_encode',
-         'xml_error_string',
-         'xml_get_current_byte_index',
-         'xml_get_current_column_number',
-         'xml_get_current_line_number',
-         'xml_get_error_code',
-         'xml_parse',
-         'xml_parse_into_struct',
-         'xml_parser_create',
-         'xml_parser_create_ns',
-         'xml_parser_free',
-         'xml_parser_get_option',
-         'xml_parser_set_option',
-         'xml_set_character_data_handler',
-         'xml_set_default_handler',
-         'xml_set_element_handler',
-         'xml_set_end_namespace_decl_handler',
-         'xml_set_external_entity_ref_handler',
-         'xml_set_notation_decl_handler',
-         'xml_set_object',
-         'xml_set_processing_instruction_handler',
-         'xml_set_start_namespace_decl_handler',
-         'xml_set_unparsed_entity_decl_handler'],
- 'XML-RPC': ['xmlrpc_decode',
-             'xmlrpc_decode_request',
-             'xmlrpc_encode',
+          'wddx_serialize_vars',
+          'wddx_unserialize'],
+ 'WinCache': ['wincache_fcache_fileinfo',
+              'wincache_fcache_meminfo',
+              'wincache_lock',
+              'wincache_ocache_fileinfo',
+              'wincache_ocache_meminfo',
+              'wincache_refresh_if_changed',
+              'wincache_rplist_fileinfo',
+              'wincache_rplist_meminfo',
+              'wincache_scache_info',
+              'wincache_scache_meminfo',
+              'wincache_ucache_add',
+              'wincache_ucache_cas',
+              'wincache_ucache_clear',
+              'wincache_ucache_dec',
+              'wincache_ucache_delete',
+              'wincache_ucache_exists',
+              'wincache_ucache_get',
+              'wincache_ucache_inc',
+              'wincache_ucache_info',
+              'wincache_ucache_meminfo',
+              'wincache_ucache_set',
+              'wincache_unlock'],
+ 'XML Parser': ['utf8_decode'],
+ 'XML-RPC': ['xmlrpc_decode_request',
+             'xmlrpc_decode',
              'xmlrpc_encode_request',
+             'xmlrpc_encode',
              'xmlrpc_get_type',
              'xmlrpc_is_fault',
              'xmlrpc_parse_method_descriptions',
@@ -2658,34 +3372,25 @@ MODULES = {'.NET': ['dotnet_load'],
              'xmlrpc_server_register_introspection_callback',
              'xmlrpc_server_register_method',
              'xmlrpc_set_type'],
- 'XSL': ['xsl_xsltprocessor_get_parameter',
-         'xsl_xsltprocessor_has_exslt_support',
-         'xsl_xsltprocessor_import_stylesheet',
-         'xsl_xsltprocessor_register_php_functions',
-         'xsl_xsltprocessor_remove_parameter',
-         'xsl_xsltprocessor_set_parameter',
-         'xsl_xsltprocessor_transform_to_doc',
-         'xsl_xsltprocessor_transform_to_uri',
-         'xsl_xsltprocessor_transform_to_xml'],
- 'XSLT': ['xslt_backend_info',
-          'xslt_backend_name',
-          'xslt_backend_version',
-          'xslt_create',
-          'xslt_errno',
-          'xslt_error',
-          'xslt_free',
-          'xslt_getopt',
-          'xslt_process',
-          'xslt_set_base',
-          'xslt_set_encoding',
-          'xslt_set_error_handler',
-          'xslt_set_log',
-          'xslt_set_object',
-          'xslt_set_sax_handler',
-          'xslt_set_sax_handlers',
-          'xslt_set_scheme_handler',
-          'xslt_set_scheme_handlers',
-          'xslt_setopt'],
+ 'XSLT (PHP4)': ['xslt_backend_info',
+                 'xslt_backend_name',
+                 'xslt_backend_version',
+                 'xslt_create',
+                 'xslt_errno',
+                 'xslt_error',
+                 'xslt_free',
+                 'xslt_getopt',
+                 'xslt_process',
+                 'xslt_set_base',
+                 'xslt_set_encoding',
+                 'xslt_set_error_handler',
+                 'xslt_set_log',
+                 'xslt_set_object',
+                 'xslt_set_sax_handler',
+                 'xslt_set_sax_handlers',
+                 'xslt_set_scheme_handler',
+                 'xslt_set_scheme_handlers',
+                 'xslt_setopt'],
  'YAZ': ['yaz_addinfo',
          'yaz_ccl_conf',
          'yaz_ccl_parse',
@@ -2696,14 +3401,15 @@ MODULES = {'.NET': ['dotnet_load'],
          'yaz_errno',
          'yaz_error',
          'yaz_es_result',
+         'yaz_es',
          'yaz_get_option',
          'yaz_hits',
          'yaz_itemorder',
          'yaz_present',
          'yaz_range',
          'yaz_record',
-         'yaz_scan',
          'yaz_scan_result',
+         'yaz_scan',
          'yaz_schema',
          'yaz_search',
          'yaz_set_option',
@@ -2720,6 +3426,11 @@ MODULES = {'.NET': ['dotnet_load'],
             'yp_match',
             'yp_next',
             'yp_order'],
+ 'Yaml': ['yaml_emit_file',
+          'yaml_emit',
+          'yaml_parse_file',
+          'yaml_parse_url',
+          'yaml_parse'],
  'Zip': ['zip_close',
          'zip_entry_close',
          'zip_entry_compressedsize',
@@ -2732,6 +3443,7 @@ MODULES = {'.NET': ['dotnet_load'],
          'zip_read'],
  'Zlib': ['gzclose',
           'gzcompress',
+          'gzdecode',
           'gzdeflate',
           'gzencode',
           'gzeof',
@@ -2751,111 +3463,86 @@ MODULES = {'.NET': ['dotnet_load'],
           'gzwrite',
           'readgzfile',
           'zlib_get_coding_type'],
- 'bcompiler': ['bcompiler_load',
-               'bcompiler_load_exe',
+ 'bcompiler': ['bcompiler_load_exe',
+               'bcompiler_load',
                'bcompiler_parse_class',
                'bcompiler_read',
                'bcompiler_write_class',
                'bcompiler_write_constant',
                'bcompiler_write_exe_footer',
+               'bcompiler_write_file',
                'bcompiler_write_footer',
                'bcompiler_write_function',
                'bcompiler_write_functions_from_file',
-               'bcompiler_write_header'],
- 'ctype': ['ctype_alnum',
-           'ctype_alpha',
-           'ctype_cntrl',
-           'ctype_digit',
-           'ctype_graph',
-           'ctype_lower',
-           'ctype_print',
-           'ctype_punct',
-           'ctype_space',
-           'ctype_upper',
-           'ctype_xdigit'],
+               'bcompiler_write_header',
+               'bcompiler_write_included_filename'],
+ 'cURL': ['curl_close',
+          'curl_copy_handle',
+          'curl_errno',
+          'curl_error',
+          'curl_exec',
+          'curl_getinfo',
+          'curl_init',
+          'curl_multi_add_handle',
+          'curl_multi_close',
+          'curl_multi_exec',
+          'curl_multi_getcontent',
+          'curl_multi_info_read',
+          'curl_multi_init',
+          'curl_multi_remove_handle',
+          'curl_multi_select',
+          'curl_setopt_array',
+          'curl_setopt',
+          'curl_version'],
+ 'chdb': ['chdb_create'],
  'dBase': ['dbase_add_record',
            'dbase_close',
            'dbase_create',
            'dbase_delete_record',
            'dbase_get_header_info',
-           'dbase_get_record',
            'dbase_get_record_with_names',
+           'dbase_get_record',
            'dbase_numfields',
            'dbase_numrecords',
            'dbase_open',
            'dbase_pack',
            'dbase_replace_record'],
- 'dba': ['dba_close',
-         'dba_delete',
-         'dba_exists',
-         'dba_fetch',
-         'dba_firstkey',
-         'dba_handlers',
-         'dba_insert',
-         'dba_key_split',
-         'dba_list',
-         'dba_nextkey',
-         'dba_open',
-         'dba_optimize',
-         'dba_popen',
-         'dba_replace',
-         'dba_sync'],
  'dbx': ['dbx_close',
          'dbx_compare',
          'dbx_connect',
          'dbx_error',
          'dbx_escape_string',
-         'dbx_fetch_row',
-         'dbx_query',
-         'dbx_sort'],
- 'fam': ['fam_cancel_monitor',
-         'fam_close',
-         'fam_monitor_collection',
-         'fam_monitor_directory',
-         'fam_monitor_file',
-         'fam_next_event',
-         'fam_open',
-         'fam_pending',
-         'fam_resume_monitor',
-         'fam_suspend_monitor'],
- 'filePro': ['filepro',
-             'filepro_fieldcount',
+         'dbx_fetch_row'],
+ 'filePro': ['filepro_fieldcount',
              'filepro_fieldname',
              'filepro_fieldtype',
              'filepro_fieldwidth',
              'filepro_retrieve',
-             'filepro_rowcount'],
- 'gettext': ['bind_textdomain_codeset',
-             'bindtextdomain',
-             'dcgettext',
-             'dcngettext',
-             'dgettext',
-             'dngettext',
-             'gettext',
-             'ngettext',
-             'textdomain'],
- 'iconv': ['iconv',
-           'iconv_get_encoding',
-           'iconv_mime_decode',
+             'filepro_rowcount',
+             'filepro'],
+ 'iconv': ['iconv_get_encoding',
            'iconv_mime_decode_headers',
+           'iconv_mime_decode',
            'iconv_mime_encode',
            'iconv_set_encoding',
            'iconv_strlen',
            'iconv_strpos',
            'iconv_strrpos',
            'iconv_substr',
+           'iconv',
            'ob_iconv_handler'],
- 'id3': ['id3_get_frame_long_name',
-         'id3_get_frame_short_name',
-         'id3_get_genre_id',
-         'id3_get_genre_list',
-         'id3_get_genre_name',
-         'id3_get_tag',
-         'id3_get_version',
-         'id3_remove_tag',
-         'id3_set_tag'],
- 'mSQL': ['msql',
-          'msql_affected_rows',
+ 'inclued': ['inclued_get_data'],
+ 'intl': ['intl_error_name',
+          'intl_get_error_code',
+          'intl_get_error_message',
+          'intl_is_failure'],
+ 'libxml': ['libxml_clear_errors',
+            'libxml_disable_entity_loader',
+            'libxml_get_errors',
+            'libxml_get_last_error',
+            'libxml_set_streams_context',
+            'libxml_use_internal_errors'],
+ 'mSQL': ['msql_affected_rows',
           'msql_close',
           'msql_connect',
           'msql_create_db',
@@ -2893,65 +3580,11 @@ MODULES = {'.NET': ['dotnet_load'],
           'msql_regcase',
           'msql_result',
           'msql_select_db',
-          'msql_tablename'],
- 'mailparse': ['mailparse_determine_best_xfer_encoding',
-               'mailparse_msg_create',
-               'mailparse_msg_extract_part',
-               'mailparse_msg_extract_part_file',
-               'mailparse_msg_free',
-               'mailparse_msg_get_part',
-               'mailparse_msg_get_part_data',
-               'mailparse_msg_get_structure',
-               'mailparse_msg_parse',
-               'mailparse_msg_parse_file',
-               'mailparse_rfc822_parse_addresses',
-               'mailparse_stream_encode',
-               'mailparse_uudecode_all'],
- 'mcrypt': ['mcrypt_cbc',
-            'mcrypt_cfb',
-            'mcrypt_create_iv',
-            'mcrypt_decrypt',
-            'mcrypt_ecb',
-            'mcrypt_enc_get_algorithms_name',
-            'mcrypt_enc_get_block_size',
-            'mcrypt_enc_get_iv_size',
-            'mcrypt_enc_get_key_size',
-            'mcrypt_enc_get_modes_name',
-            'mcrypt_enc_get_supported_key_sizes',
-            'mcrypt_enc_is_block_algorithm',
-            'mcrypt_enc_is_block_algorithm_mode',
-            'mcrypt_enc_is_block_mode',
-            'mcrypt_enc_self_test',
-            'mcrypt_encrypt',
-            'mcrypt_generic',
-            'mcrypt_generic_deinit',
-            'mcrypt_generic_end',
-            'mcrypt_generic_init',
-            'mcrypt_get_block_size',
-            'mcrypt_get_cipher_name',
-            'mcrypt_get_iv_size',
-            'mcrypt_get_key_size',
-            'mcrypt_list_algorithms',
-            'mcrypt_list_modes',
-            'mcrypt_module_close',
-            'mcrypt_module_get_algo_block_size',
-            'mcrypt_module_get_algo_key_size',
-            'mcrypt_module_get_supported_key_sizes',
-            'mcrypt_module_is_block_algorithm',
-            'mcrypt_module_is_block_algorithm_mode',
-            'mcrypt_module_is_block_mode',
-            'mcrypt_module_open',
-            'mcrypt_module_self_test',
-            'mcrypt_ofb',
-            'mdecrypt_generic'],
- 'mhash': ['mhash',
-           'mhash_count',
-           'mhash_get_block_size',
-           'mhash_get_hash_name',
-           'mhash_keygen_s2k'],
+          'msql_tablename',
+          'msql'],
  'mnoGoSearch': ['udm_add_search_limit',
-                 'udm_alloc_agent',
                  'udm_alloc_agent_array',
+                 'udm_alloc_agent',
                  'udm_api_version',
                  'udm_cat_list',
                  'udm_cat_path',
@@ -2973,417 +3606,182 @@ MODULES = {'.NET': ['dotnet_load'],
                  'udm_load_ispell_data',
                  'udm_open_stored',
                  'udm_set_agent_param'],
- 'muscat': ['muscat_close',
-            'muscat_get',
-            'muscat_give',
-            'muscat_setup',
-            'muscat_setup_net'],
- 'mysqli': ['mysqli_affected_rows',
-            'mysqli_autocommit',
-            'mysqli_bind_param',
-            'mysqli_bind_result',
-            'mysqli_change_user',
-            'mysqli_character_set_name',
-            'mysqli_client_encoding',
-            'mysqli_close',
-            'mysqli_commit',
-            'mysqli_connect',
-            'mysqli_connect_errno',
-            'mysqli_connect_error',
-            'mysqli_data_seek',
-            'mysqli_debug',
-            'mysqli_disable_reads_from_master',
-            'mysqli_disable_rpl_parse',
-            'mysqli_dump_debug_info',
-            'mysqli_embedded_connect',
-            'mysqli_enable_reads_from_master',
-            'mysqli_enable_rpl_parse',
-            'mysqli_errno',
-            'mysqli_error',
-            'mysqli_escape_string',
-            'mysqli_execute',
-            'mysqli_fetch',
-            'mysqli_fetch_array',
-            'mysqli_fetch_assoc',
-            'mysqli_fetch_field',
-            'mysqli_fetch_field_direct',
-            'mysqli_fetch_fields',
-            'mysqli_fetch_lengths',
-            'mysqli_fetch_object',
-            'mysqli_fetch_row',
-            'mysqli_field_count',
-            'mysqli_field_seek',
-            'mysqli_field_tell',
-            'mysqli_free_result',
-            'mysqli_get_client_info',
-            'mysqli_get_client_version',
-            'mysqli_get_host_info',
-            'mysqli_get_metadata',
-            'mysqli_get_proto_info',
-            'mysqli_get_server_info',
-            'mysqli_get_server_version',
-            'mysqli_info',
-            'mysqli_init',
-            'mysqli_insert_id',
-            'mysqli_kill',
-            'mysqli_master_query',
-            'mysqli_more_results',
-            'mysqli_multi_query',
-            'mysqli_next_result',
-            'mysqli_num_fields',
-            'mysqli_num_rows',
-            'mysqli_options',
-            'mysqli_param_count',
-            'mysqli_ping',
-            'mysqli_prepare',
-            'mysqli_query',
-            'mysqli_real_connect',
-            'mysqli_real_escape_string',
-            'mysqli_real_query',
-            'mysqli_report',
-            'mysqli_rollback',
-            'mysqli_rpl_parse_enabled',
-            'mysqli_rpl_probe',
-            'mysqli_rpl_query_type',
-            'mysqli_select_db',
-            'mysqli_send_long_data',
-            'mysqli_send_query',
-            'mysqli_server_end',
-            'mysqli_server_init',
-            'mysqli_set_opt',
-            'mysqli_sqlstate',
-            'mysqli_ssl_set',
-            'mysqli_stat',
-            'mysqli_stmt_affected_rows',
-            'mysqli_stmt_bind_param',
-            'mysqli_stmt_bind_result',
-            'mysqli_stmt_close',
-            'mysqli_stmt_data_seek',
-            'mysqli_stmt_errno',
-            'mysqli_stmt_error',
-            'mysqli_stmt_execute',
-            'mysqli_stmt_fetch',
-            'mysqli_stmt_free_result',
-            'mysqli_stmt_init',
-            'mysqli_stmt_num_rows',
-            'mysqli_stmt_param_count',
-            'mysqli_stmt_prepare',
-            'mysqli_stmt_reset',
-            'mysqli_stmt_result_metadata',
-            'mysqli_stmt_send_long_data',
-            'mysqli_stmt_sqlstate',
-            'mysqli_stmt_store_result',
-            'mysqli_store_result',
-            'mysqli_thread_id',
-            'mysqli_thread_safe',
-            'mysqli_use_result',
-            'mysqli_warning_count'],
- 'openal': ['openal_buffer_create',
-            'openal_buffer_data',
-            'openal_buffer_destroy',
-            'openal_buffer_get',
-            'openal_buffer_loadwav',
-            'openal_context_create',
-            'openal_context_current',
-            'openal_context_destroy',
-            'openal_context_process',
-            'openal_context_suspend',
-            'openal_device_close',
-            'openal_device_open',
-            'openal_listener_get',
-            'openal_listener_set',
-            'openal_source_create',
-            'openal_source_destroy',
-            'openal_source_get',
-            'openal_source_pause',
-            'openal_source_play',
-            'openal_source_rewind',
-            'openal_source_set',
-            'openal_source_stop',
-            'openal_stream'],
+ 'mqseries': ['mqseries_back',
+              'mqseries_begin',
+              'mqseries_close',
+              'mqseries_cmit',
+              'mqseries_conn',
+              'mqseries_connx',
+              'mqseries_disc',
+              'mqseries_get',
+              'mqseries_inq',
+              'mqseries_open',
+              'mqseries_put1',
+              'mqseries_put',
+              'mqseries_set',
+              'mqseries_strerror'],
+ 'mysqlnd_qc': ['mysqlnd_qc_change_handler',
+                'mysqlnd_qc_clear_cache',
+                'mysqlnd_qc_get_cache_info',
+                'mysqlnd_qc_get_core_stats',
+                'mysqlnd_qc_get_handler',
+                'mysqlnd_qc_get_query_trace_log',
+                'mysqlnd_qc_set_user_handlers'],
  'qtdom': ['qdom_error', 'qdom_tree'],
- 'shmop': ['shmop_close',
-           'shmop_delete',
-           'shmop_open',
-           'shmop_read',
-           'shmop_size',
-           'shmop_write'],
- 'spl': ['class_implements',
-         'class_parents',
-         'iterator-to-array',
-         'iterator_count',
-         'spl_classes'],
- 'ssh2': ['ssh2_auth_none',
-          'ssh2_auth_password',
-          'ssh2_auth_pubkey_file',
-          'ssh2_connect',
-          'ssh2_exec',
-          'ssh2_fetch_stream',
-          'ssh2_fingerprint',
-          'ssh2_methods_negotiated',
-          'ssh2_scp_recv',
-          'ssh2_scp_send',
-          'ssh2_sftp',
-          'ssh2_sftp_lstat',
-          'ssh2_sftp_mkdir',
-          'ssh2_sftp_readlink',
-          'ssh2_sftp_realpath',
-          'ssh2_sftp_rename',
-          'ssh2_sftp_rmdir',
-          'ssh2_sftp_stat',
-          'ssh2_sftp_symlink',
-          'ssh2_sftp_unlink',
-          'ssh2_shell',
-          'ssh2_tunnel'],
- 'tidy': ['ob_tidyhandler',
-          'tidy_access_count',
-          'tidy_clean_repair',
-          'tidy_config_count',
-          'tidy_diagnose',
-          'tidy_error_count',
-          'tidy_get_body',
-          'tidy_get_config',
-          'tidy_get_error_buffer',
-          'tidy_get_head',
-          'tidy_get_html',
-          'tidy_get_html_ver',
-          'tidy_get_output',
-          'tidy_get_release',
-          'tidy_get_root',
-          'tidy_get_status',
-          'tidy_getopt',
-          'tidy_is_xhtml',
-          'tidy_is_xml',
-          'tidy_load_config',
-          'tidy_parse_file',
-          'tidy_parse_string',
-          'tidy_repair_file',
-          'tidy_repair_string',
-          'tidy_reset_config',
-          'tidy_save_config',
-          'tidy_set_encoding',
-          'tidy_setopt',
-          'tidy_warning_count'],
- 'unknown': ['bcompile_write_file',
-             'com',
-             'dir',
-             'dotnet',
-             'hw_api_attribute',
-             'hw_api_content',
-             'hw_api_object',
-             'imagepscopyfont',
-             'mcve_adduser',
-             'mcve_adduserarg',
-             'mcve_bt',
-             'mcve_checkstatus',
-             'mcve_chkpwd',
-             'mcve_chngpwd',
-             'mcve_completeauthorizations',
-             'mcve_connect',
-             'mcve_connectionerror',
-             'mcve_deleteresponse',
-             'mcve_deletetrans',
-             'mcve_deleteusersetup',
-             'mcve_deluser',
-             'mcve_destroyconn',
-             'mcve_destroyengine',
-             'mcve_disableuser',
-             'mcve_edituser',
-             'mcve_enableuser',
-             'mcve_force',
-             'mcve_getcell',
-             'mcve_getcellbynum',
-             'mcve_getcommadelimited',
-             'mcve_getheader',
-             'mcve_getuserarg',
-             'mcve_getuserparam',
-             'mcve_gft',
-             'mcve_gl',
-             'mcve_gut',
-             'mcve_initconn',
-             'mcve_initengine',
-             'mcve_initusersetup',
-             'mcve_iscommadelimited',
-             'mcve_liststats',
-             'mcve_listusers',
-             'mcve_maxconntimeout',
-             'mcve_monitor',
-             'mcve_numcolumns',
-             'mcve_numrows',
-             'mcve_override',
-             'mcve_parsecommadelimited',
-             'mcve_ping',
-             'mcve_preauth',
-             'mcve_preauthcompletion',
-             'mcve_qc',
-             'mcve_responseparam',
-             'mcve_return',
-             'mcve_returncode',
-             'mcve_returnstatus',
-             'mcve_sale',
-             'mcve_setblocking',
-             'mcve_setdropfile',
-             'mcve_setip',
-             'mcve_setssl',
-             'mcve_setssl_files',
-             'mcve_settimeout',
-             'mcve_settle',
-             'mcve_text_avs',
-             'mcve_text_code',
-             'mcve_text_cv',
-             'mcve_transactionauth',
-             'mcve_transactionavs',
-             'mcve_transactionbatch',
-             'mcve_transactioncv',
-             'mcve_transactionid',
-             'mcve_transactionitem',
-             'mcve_transactionssent',
-             'mcve_transactiontext',
-             'mcve_transinqueue',
-             'mcve_transnew',
-             'mcve_transparam',
-             'mcve_transsend',
-             'mcve_ub',
-             'mcve_uwait',
-             'mcve_verifyconnection',
-             'mcve_verifysslcert',
-             'mcve_void',
-             'mysqli()',
-             'pdf_open',
-             'pdf_open_png',
-             'pdf_set_font',
-             'php_register_url_stream_wrapper',
-             'php_stream_can_cast',
-             'php_stream_cast',
-             'php_stream_close',
-             'php_stream_closedir',
-             'php_stream_copy_to_mem',
-             'php_stream_copy_to_stream',
-             'php_stream_eof',
-             'php_stream_filter_register_factory',
-             'php_stream_filter_unregister_factory',
-             'php_stream_flush',
-             'php_stream_fopen_from_file',
-             'php_stream_fopen_temporary_file',
-             'php_stream_fopen_tmpfile',
-             'php_stream_getc',
-             'php_stream_gets',
-             'php_stream_is',
-             'php_stream_is_persistent',
-             'php_stream_make_seekable',
-             'php_stream_open_wrapper',
-             'php_stream_open_wrapper_as_file',
-             'php_stream_open_wrapper_ex',
-             'php_stream_opendir',
-             'php_stream_passthru',
-             'php_stream_read',
-             'php_stream_readdir',
-             'php_stream_rewinddir',
-             'php_stream_seek',
-             'php_stream_sock_open_from_socket',
-             'php_stream_sock_open_host',
-             'php_stream_sock_open_unix',
-             'php_stream_stat',
-             'php_stream_stat_path',
-             'php_stream_tell',
-             'php_stream_write',
-             'php_unregister_url_stream_wrapper',
-             'swfbutton_keypress',
-             'swfdisplayitem',
-             'variant'],
- 'vpopmail': ['vpopmail_add_alias_domain',
-              'vpopmail_add_alias_domain_ex',
-              'vpopmail_add_domain',
+ 'runkit': ['runkit_class_adopt',
+            'runkit_class_emancipate',
+            'runkit_constant_add',
+            'runkit_constant_redefine',
+            'runkit_constant_remove',
+            'runkit_function_add',
+            'runkit_function_copy',
+            'runkit_function_redefine',
+            'runkit_function_remove',
+            'runkit_function_rename',
+            'runkit_import',
+            'runkit_lint_file',
+            'runkit_lint',
+            'runkit_method_add',
+            'runkit_method_copy',
+            'runkit_method_redefine',
+            'runkit_method_remove',
+            'runkit_method_rename',
+            'runkit_return_value_used',
+            'runkit_sandbox_output_handler',
+            'runkit_superglobals'],
+ 'ssdeep': ['ssdeep_fuzzy_compare',
+            'ssdeep_fuzzy_hash_filename',
+            'ssdeep_fuzzy_hash'],
+ 'vpopmail': ['vpopmail_add_alias_domain_ex',
+              'vpopmail_add_alias_domain',
               'vpopmail_add_domain_ex',
+              'vpopmail_add_domain',
               'vpopmail_add_user',
               'vpopmail_alias_add',
-              'vpopmail_alias_del',
               'vpopmail_alias_del_domain',
-              'vpopmail_alias_get',
+              'vpopmail_alias_del',
               'vpopmail_alias_get_all',
+              'vpopmail_alias_get',
               'vpopmail_auth_user',
-              'vpopmail_del_domain',
               'vpopmail_del_domain_ex',
+              'vpopmail_del_domain',
               'vpopmail_del_user',
               'vpopmail_error',
               'vpopmail_passwd',
               'vpopmail_set_user_quota'],
+ 'win32ps': ['win32_ps_list_procs', 'win32_ps_stat_mem', 'win32_ps_stat_proc'],
+ 'win32service': ['win32_continue_service',
+                  'win32_create_service',
+                  'win32_delete_service',
+                  'win32_get_last_control_message',
+                  'win32_pause_service',
+                  'win32_query_service_status',
+                  'win32_set_service_status',
+                  'win32_start_service_ctrl_dispatcher',
+                  'win32_start_service',
+                  'win32_stop_service'],
  'xattr': ['xattr_get',
            'xattr_list',
            'xattr_remove',
            'xattr_set',
            'xattr_supported'],
- 'xdiff': ['xdiff_file_diff',
+ 'xdiff': ['xdiff_file_bdiff_size',
+           'xdiff_file_bdiff',
+           'xdiff_file_bpatch',
            'xdiff_file_diff_binary',
+           'xdiff_file_diff',
            'xdiff_file_merge3',
-           'xdiff_file_patch',
            'xdiff_file_patch_binary',
-           'xdiff_string_diff',
+           'xdiff_file_patch',
+           'xdiff_file_rabdiff',
+           'xdiff_string_bdiff_size',
+           'xdiff_string_bdiff',
+           'xdiff_string_bpatch',
            'xdiff_string_diff_binary',
+           'xdiff_string_diff',
            'xdiff_string_merge3',
+           'xdiff_string_patch_binary',
            'xdiff_string_patch',
-           'xdiff_string_patch_binary']}
-
+           'xdiff_string_rabdiff']}
 
 if __name__ == '__main__':
+    import glob
+    import os
     import pprint
     import re
+    import shutil
+    import tarfile
     import urllib
-    _function_re = re.compile('<B\s+CLASS="function"\s*>(.*?)\(\)</B\s*>(?uism)')
+
+    PHP_MANUAL_URL     = 'http://us3.php.net/distributions/manual/php_manual_en.tar.gz'
+    PHP_MANUAL_DIR     = './php-chunked-xhtml/'
+    PHP_REFERENCE_GLOB = 'ref.*'
+    PHP_FUNCTION_RE    = '<a href="function\..*?\.html">(.*?)</a>'
+    PHP_MODULE_RE      = '<title>(.*?) Functions</title>'
 
     def get_php_functions():
-        uf = urllib.urlopen('http://de.php.net/manual/en/index.functions.php')
-        data = uf.read()
-        uf.close()
-        results = set()
-        for match in _function_re.finditer(data):
-            fn = match.group(1)
-            if '-&#62;' not in fn and '::' not in fn:
-                results.add(fn)
-        # PY24: use sorted()
-        results = list(results)
-        results.sort()
-        return results
+        function_re = re.compile(PHP_FUNCTION_RE)
+        module_re   = re.compile(PHP_MODULE_RE)
+        modules     = {}
+
+        for file in get_php_references():
+            module = ''
+            for line in open(file):
+                if not module:
+                    search = module_re.search(line)
+                    if search:
+                        module = search.group(1)
+                        modules[module] = []
 
-    def get_function_module(func_name):
-        fn = func_name.replace('_', '-')
-        uf = urllib.urlopen('http://de.php.net/manual/en/function.%s.php' % fn)
-        regex = re.compile('<li class="header up">'
-                           '<a href="ref\..*?\.php">([a-zA-Z0-9\s]+)</a></li>')
-        for line in uf:
-            match = regex.search(line)
-            if match:
-                return match.group(1)
+                elif '<h2>Table of Contents</h2>' in line:
+                    for match in function_re.finditer(line):
+                        fn = match.group(1)
+                        if '-&gt;' not in fn and '::' not in fn:
+                            modules[module].append(fn)
 
-    print '>> Downloading Function Index'
-    functions = get_php_functions()
-    total = len(functions)
-    print '%d functions found' % total
-    modules = {}
-    idx = 1
-    for function_name in get_php_functions():
-        print '>> %r (%d/%d)' % (function_name, idx, total)
-        m = get_function_module(function_name)
-        if m is None:
-            print 'NOT_FOUND'
-            m = 'unknown'
-        else:
-            print repr(m)
-        modules.setdefault(m, []).append(function_name)
-        idx += 1
+                    # These are dummy manual pages, not actual functions
+                    if module == 'PHP Options/Info':
+                        modules[module].remove('main')
+                    elif module == 'Filesystem':
+                        modules[module].remove('delete')
 
-    # extract useful sourcecode from this file
-    f = open(__file__)
-    try:
-        content = f.read()
-    finally:
+                    if not modules[module]:
+                        del modules[module]
+
+                    break
+        return modules
+
+    def get_php_references():
+        download = urllib.urlretrieve(PHP_MANUAL_URL)
+        tar = tarfile.open(download[0])
+        tar.extractall()
+        tar.close()
+        for file in glob.glob("%s%s" % (PHP_MANUAL_DIR, PHP_REFERENCE_GLOB)):
+            yield file
+        os.remove(download[0])
+
+    def regenerate(filename, modules):
+        f = open(filename)
+        try:
+            content = f.read()
+        finally:
+            f.close()
+
+        header = content[:content.find('MODULES = {')]
+        footer = content[content.find("if __name__ == '__main__':"):]
+
+        f = open(filename, 'w')
+        f.write(header)
+        f.write('MODULES = %s\n\n' % pprint.pformat(modules))
+        f.write(footer)
         f.close()
-    header = content[:content.find('MODULES = {')]
-    footer = content[content.find("if __name__ == '__main__':"):]
 
-    # write new file
-    f = open(__file__, 'w')
-    f.write(header)
-    f.write('MODULES = %s\n\n' % pprint.pformat(modules))
-    f.write(footer)
-    f.close()
+    def run():
+        print '>> Downloading Function Index'
+        modules = get_php_functions()
+        total = sum(len(v) for v in modules.itervalues())
+        print '%d functions found' % total
+        regenerate(__file__, modules)
+        shutil.rmtree(PHP_MANUAL_DIR)
+
+    run()
\ No newline at end of file
diff --git a/pygments/lexers/_postgres_builtins.py b/pygments/lexers/_postgres_builtins.py
new file mode 100644 (file)
index 0000000..0cea1c2
--- /dev/null
@@ -0,0 +1,231 @@
+"""
+    pygments.lexers._postgres_builtins
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    Self-updating data files for PostgreSQL lexer.
+
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+import re
+import urllib
+
+# One man's constant is another man's variable.
+SOURCE_URL = 'https://github.com/postgres/postgres/raw/master'
+KEYWORDS_URL = SOURCE_URL + '/doc/src/sgml/keywords.sgml'
+DATATYPES_URL = SOURCE_URL + '/doc/src/sgml/datatype.sgml'
+
+def update_myself():
+    data_file = list(fetch(DATATYPES_URL))
+    datatypes = parse_datatypes(data_file)
+    pseudos = parse_pseudos(data_file)
+
+    keywords = parse_keywords(fetch(KEYWORDS_URL))
+    update_consts(__file__, 'DATATYPES', datatypes)
+    update_consts(__file__, 'PSEUDO_TYPES', pseudos)
+    update_consts(__file__, 'KEYWORDS', keywords)
+
+def parse_keywords(f):
+    kw = []
+    for m in re.finditer(
+            r'\s*<entry><token>([^<]+)</token></entry>\s*'
+            r'<entry>([^<]+)</entry>', f.read()):
+        kw.append(m.group(1))
+
+    if not kw:
+        raise ValueError('no keyword found')
+
+    kw.sort()
+    return kw
+
+def parse_datatypes(f):
+    dt = set()
+    re_entry = re.compile('\s*<entry><type>([^<]+)</type></entry>')
+    for line in f:
+        if '<sect1' in line:
+            break
+        if '<entry><type>' not in line:
+            continue
+
+        # Parse a string such as
+        # time [ (<replaceable>p</replaceable>) ] [ without time zone ]
+        # into types "time" and "without time zone"
+
+        # remove all the tags
+        line = re.sub("<replaceable>[^<]+</replaceable>", "", line)
+        line = re.sub("<[^>]+>", "", line)
+
+        # Drop the parts containing braces
+        for tmp in [ t for tmp in line.split('[') for t in tmp.split(']') if "(" not in t ]:
+            for t in tmp.split(','):
+                t = t.strip()
+                if not t: continue
+                dt.add(" ".join(t.split()))
+
+    dt = list(dt)
+    dt.sort()
+    return dt
+
+def parse_pseudos(f):
+    dt = []
+    re_start = re.compile(r'\s*<table id="datatype-pseudotypes-table">')
+    re_entry = re.compile(r'\s*<entry><type>([^<]+)</></entry>')
+    re_end = re.compile(r'\s*</table>')
+
+    f = iter(f)
+    for line in f:
+        if re_start.match(line) is not None:
+            break
+    else:
+        raise ValueError('pseudo datatypes table not found')
+
+    for line in f:
+        m = re_entry.match(line)
+        if m is not None:
+            dt.append(m.group(1))
+
+        if re_end.match(line) is not None:
+            break
+    else:
+        raise ValueError('end of pseudo datatypes table not found')
+
+    if not dt:
+        raise ValueError('pseudo datatypes not found')
+
+    return dt
+
+def fetch(url):
+    return urllib.urlopen(url)
+
+def update_consts(filename, constname, content):
+    f = open(filename)
+    lines = f.readlines()
+    f.close()
+
+    # Line to start/end inserting
+    re_start = re.compile(r'^%s\s*=\s*\[\s*$' % constname)
+    re_end = re.compile(r'^\s*\]\s*$')
+    start = [ n for n, l in enumerate(lines) if re_start.match(l) ]
+    if not start:
+        raise ValueError("couldn't find line containing '%s = ['" % constname)
+    if len(start) > 1:
+        raise ValueError("too many lines containing '%s = ['" % constname)
+    start = start[0] + 1
+
+    end = [ n for n, l in enumerate(lines) if n >= start and re_end.match(l) ]
+    if not end:
+        raise ValueError("couldn't find line containing ']' after %s " % constname)
+    end = end[0]
+
+    # Pack the new content in lines not too long
+    content = [repr(item) for item in content ]
+    new_lines = [[]]
+    for item in content:
+        if sum(map(len, new_lines[-1])) + 2 * len(new_lines[-1]) + len(item) + 4 > 75:
+            new_lines.append([])
+        new_lines[-1].append(item)
+
+    lines[start:end] = [ "    %s,\n" % ", ".join(items) for items in new_lines ]
+
+    f = open(filename, 'w')
+    f.write(''.join(lines))
+    f.close()
+
+
+# Autogenerated: please edit them if you like wasting your time.
+
+KEYWORDS = [
+    'ABORT', 'ABSOLUTE', 'ACCESS', 'ACTION', 'ADD', 'ADMIN', 'AFTER',
+    'AGGREGATE', 'ALL', 'ALSO', 'ALTER', 'ALWAYS', 'ANALYSE', 'ANALYZE',
+    'AND', 'ANY', 'ARRAY', 'AS', 'ASC', 'ASSERTION', 'ASSIGNMENT',
+    'ASYMMETRIC', 'AT', 'ATTRIBUTE', 'AUTHORIZATION', 'BACKWARD', 'BEFORE',
+    'BEGIN', 'BETWEEN', 'BIGINT', 'BINARY', 'BIT', 'BOOLEAN', 'BOTH', 'BY',
+    'CACHE', 'CALLED', 'CASCADE', 'CASCADED', 'CASE', 'CAST', 'CATALOG',
+    'CHAIN', 'CHAR', 'CHARACTER', 'CHARACTERISTICS', 'CHECK', 'CHECKPOINT',
+    'CLASS', 'CLOSE', 'CLUSTER', 'COALESCE', 'COLLATE', 'COLLATION',
+    'COLUMN', 'COMMENT', 'COMMENTS', 'COMMIT', 'COMMITTED', 'CONCURRENTLY',
+    'CONFIGURATION', 'CONNECTION', 'CONSTRAINT', 'CONSTRAINTS', 'CONTENT',
+    'CONTINUE', 'CONVERSION', 'COPY', 'COST', 'CREATE', 'CROSS', 'CSV',
+    'CURRENT', 'CURRENT_CATALOG', 'CURRENT_DATE', 'CURRENT_ROLE',
+    'CURRENT_SCHEMA', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER',
+    'CURSOR', 'CYCLE', 'DATA', 'DATABASE', 'DAY', 'DEALLOCATE', 'DEC',
+    'DECIMAL', 'DECLARE', 'DEFAULT', 'DEFAULTS', 'DEFERRABLE', 'DEFERRED',
+    'DEFINER', 'DELETE', 'DELIMITER', 'DELIMITERS', 'DESC', 'DICTIONARY',
+    'DISABLE', 'DISCARD', 'DISTINCT', 'DO', 'DOCUMENT', 'DOMAIN', 'DOUBLE',
+    'DROP', 'EACH', 'ELSE', 'ENABLE', 'ENCODING', 'ENCRYPTED', 'END',
+    'ENUM', 'ESCAPE', 'EXCEPT', 'EXCLUDE', 'EXCLUDING', 'EXCLUSIVE',
+    'EXECUTE', 'EXISTS', 'EXPLAIN', 'EXTENSION', 'EXTERNAL', 'EXTRACT',
+    'FALSE', 'FAMILY', 'FETCH', 'FIRST', 'FLOAT', 'FOLLOWING', 'FOR',
+    'FORCE', 'FOREIGN', 'FORWARD', 'FREEZE', 'FROM', 'FULL', 'FUNCTION',
+    'FUNCTIONS', 'GLOBAL', 'GRANT', 'GRANTED', 'GREATEST', 'GROUP',
+    'HANDLER', 'HAVING', 'HEADER', 'HOLD', 'HOUR', 'IDENTITY', 'IF',
+    'ILIKE', 'IMMEDIATE', 'IMMUTABLE', 'IMPLICIT', 'IN', 'INCLUDING',
+    'INCREMENT', 'INDEX', 'INDEXES', 'INHERIT', 'INHERITS', 'INITIALLY',
+    'INLINE', 'INNER', 'INOUT', 'INPUT', 'INSENSITIVE', 'INSERT', 'INSTEAD',
+    'INT', 'INTEGER', 'INTERSECT', 'INTERVAL', 'INTO', 'INVOKER', 'IS',
+    'ISNULL', 'ISOLATION', 'JOIN', 'KEY', 'LABEL', 'LANGUAGE', 'LARGE',
+    'LAST', 'LC_COLLATE', 'LC_CTYPE', 'LEADING', 'LEAST', 'LEFT', 'LEVEL',
+    'LIKE', 'LIMIT', 'LISTEN', 'LOAD', 'LOCAL', 'LOCALTIME',
+    'LOCALTIMESTAMP', 'LOCATION', 'LOCK', 'MAPPING', 'MATCH', 'MAXVALUE',
+    'MINUTE', 'MINVALUE', 'MODE', 'MONTH', 'MOVE', 'NAME', 'NAMES',
+    'NATIONAL', 'NATURAL', 'NCHAR', 'NEXT', 'NO', 'NONE', 'NOT', 'NOTHING',
+    'NOTIFY', 'NOTNULL', 'NOWAIT', 'NULL', 'NULLIF', 'NULLS', 'NUMERIC',
+    'OBJECT', 'OF', 'OFF', 'OFFSET', 'OIDS', 'ON', 'ONLY', 'OPERATOR',
+    'OPTION', 'OPTIONS', 'OR', 'ORDER', 'OUT', 'OUTER', 'OVER', 'OVERLAPS',
+    'OVERLAY', 'OWNED', 'OWNER', 'PARSER', 'PARTIAL', 'PARTITION',
+    'PASSING', 'PASSWORD', 'PLACING', 'PLANS', 'POSITION', 'PRECEDING',
+    'PRECISION', 'PREPARE', 'PREPARED', 'PRESERVE', 'PRIMARY', 'PRIOR',
+    'PRIVILEGES', 'PROCEDURAL', 'PROCEDURE', 'QUOTE', 'RANGE', 'READ',
+    'REAL', 'REASSIGN', 'RECHECK', 'RECURSIVE', 'REF', 'REFERENCES',
+    'REINDEX', 'RELATIVE', 'RELEASE', 'RENAME', 'REPEATABLE', 'REPLACE',
+    'REPLICA', 'RESET', 'RESTART', 'RESTRICT', 'RETURNING', 'RETURNS',
+    'REVOKE', 'RIGHT', 'ROLE', 'ROLLBACK', 'ROW', 'ROWS', 'RULE',
+    'SAVEPOINT', 'SCHEMA', 'SCROLL', 'SEARCH', 'SECOND', 'SECURITY',
+    'SELECT', 'SEQUENCE', 'SEQUENCES', 'SERIALIZABLE', 'SERVER', 'SESSION',
+    'SESSION_USER', 'SET', 'SETOF', 'SHARE', 'SHOW', 'SIMILAR', 'SIMPLE',
+    'SMALLINT', 'SOME', 'STABLE', 'STANDALONE', 'START', 'STATEMENT',
+    'STATISTICS', 'STDIN', 'STDOUT', 'STORAGE', 'STRICT', 'STRIP',
+    'SUBSTRING', 'SYMMETRIC', 'SYSID', 'SYSTEM', 'TABLE', 'TABLES',
+    'TABLESPACE', 'TEMP', 'TEMPLATE', 'TEMPORARY', 'TEXT', 'THEN', 'TIME',
+    'TIMESTAMP', 'TO', 'TRAILING', 'TRANSACTION', 'TREAT', 'TRIGGER',
+    'TRIM', 'TRUE', 'TRUNCATE', 'TRUSTED', 'TYPE', 'UNBOUNDED',
+    'UNCOMMITTED', 'UNENCRYPTED', 'UNION', 'UNIQUE', 'UNKNOWN', 'UNLISTEN',
+    'UNLOGGED', 'UNTIL', 'UPDATE', 'USER', 'USING', 'VACUUM', 'VALID',
+    'VALIDATE', 'VALIDATOR', 'VALUE', 'VALUES', 'VARCHAR', 'VARIADIC',
+    'VARYING', 'VERBOSE', 'VERSION', 'VIEW', 'VOLATILE', 'WHEN', 'WHERE',
+    'WHITESPACE', 'WINDOW', 'WITH', 'WITHOUT', 'WORK', 'WRAPPER', 'WRITE',
+    'XML', 'XMLATTRIBUTES', 'XMLCONCAT', 'XMLELEMENT', 'XMLEXISTS',
+    'XMLFOREST', 'XMLPARSE', 'XMLPI', 'XMLROOT', 'XMLSERIALIZE', 'YEAR',
+    'YES', 'ZONE',
+    ]
+
+DATATYPES = [
+    'bigint', 'bigserial', 'bit', 'bit varying', 'bool', 'boolean', 'box',
+    'bytea', 'char', 'character', 'character varying', 'cidr', 'circle',
+    'date', 'decimal', 'double precision', 'float4', 'float8', 'inet',
+    'int', 'int2', 'int4', 'int8', 'integer', 'interval', 'line', 'lseg',
+    'macaddr', 'money', 'numeric', 'path', 'point', 'polygon', 'real',
+    'serial', 'serial4', 'serial8', 'smallint', 'text', 'time', 'timestamp',
+    'timestamptz', 'timetz', 'tsquery', 'tsvector', 'txid_snapshot', 'uuid',
+    'varbit', 'varchar', 'with time zone', 'without time zone', 'xml',
+    ]
+
+PSEUDO_TYPES = [
+    'any', 'anyarray', 'anyelement', 'anyenum', 'anynonarray', 'cstring',
+    'internal', 'language_handler', 'fdw_handler', 'record', 'trigger',
+    'void', 'opaque',
+    ]
+
+# Remove 'trigger' from types
+PSEUDO_TYPES = sorted(set(PSEUDO_TYPES) - set(map(str.lower, KEYWORDS)))
+
+PLPGSQL_KEYWORDS = [
+    'ALIAS', 'CONSTANT', 'DIAGNOSTICS', 'ELSIF', 'EXCEPTION', 'EXIT',
+    'FOREACH', 'GET', 'LOOP', 'NOTICE', 'OPEN', 'PERFORM', 'QUERY', 'RAISE',
+    'RETURN', 'REVERSE', 'SQLSTATE', 'WHILE',
+    ]
+
+if __name__ == '__main__':
+    update_myself()
+
diff --git a/pygments/lexers/_scilab_builtins.py b/pygments/lexers/_scilab_builtins.py
new file mode 100644 (file)
index 0000000..7e5530d
--- /dev/null
@@ -0,0 +1,29 @@
+# These lists are generated automatically.
+# Run the following in a Scilab script:
+#
+# varType=["functions", "commands", "macros", "variables" ];
+# fd = mopen('list.txt','wt');
+#
+# for j=1:size(varType,"*")
+#     myStr="";
+#     a=completion("",varType(j));
+#     myStr=varType(j)+"_kw = [";
+#     for i=1:size(a,"*")
+#         myStr = myStr + """" + a(i) + """";
+#         if size(a,"*") <> i then
+#            myStr = myStr + ","; end
+#         end
+#     myStr = myStr + "]";
+#     mputl(myStr,fd);
+# end
+# mclose(fd);
+#
+# Then replace "$" by "\\$" manually.
+
+functions_kw = ["%XMLAttr_6","%XMLAttr_e","%XMLAttr_i_XMLElem","%XMLAttr_length","%XMLAttr_p","%XMLAttr_size","%XMLDoc_6","%XMLDoc_e","%XMLDoc_i_XMLList","%XMLDoc_p","%XMLElem_6","%XMLElem_e","%XMLElem_i_XMLDoc","%XMLElem_i_XMLElem","%XMLElem_i_XMLList","%XMLElem_p","%XMLList_6","%XMLList_e","%XMLList_i_XMLElem","%XMLList_i_XMLList","%XMLList_length","%XMLList_p","%XMLList_size","%XMLNs_6","%XMLNs_e","%XMLNs_i_XMLElem","%XMLNs_p","%XMLSet_6","%XMLSet_e","%XMLSet_length","%XMLSet_p","%XMLSet_size","%XMLValid_p","%b_i_XMLList","%c_i_XMLAttr","%c_i_XMLDoc","%c_i_XMLElem","%c_i_XMLList","%ce_i_XMLList","%fptr_i_XMLList","%h_i_XMLList","%hm_i_XMLList","%i_abs","%i_cumprod","%i_cumsum","%i_diag","%i_i_XMLList","%i_matrix","%i_max","%i_maxi","%i_min","%i_mini","%i_mput","%i_p","%i_prod","%i_sum","%i_tril","%i_triu","%ip_i_XMLList","%l_i_XMLList","%lss_i_XMLList","%mc_i_XMLList","%msp_full","%msp_i_XMLList","%msp_spget","%p_i_XMLList","%ptr_i_XMLList","%r_i_XMLList","%s_i_XMLList","%sp_i_XMLList","%spb_i_XMLList","%st_i_XMLList","Calendar","ClipBoard","Matplot","Matplot1","PlaySound","TCL_DeleteInterp","TCL_DoOneEvent","TCL_EvalFile","TCL_EvalStr","TCL_ExistArray","TCL_ExistInterp","TCL_ExistVar","TCL_GetVar","TCL_GetVersion","TCL_SetVar","TCL_UnsetVar","TCL_UpVar","_","_code2str","_str2code","about","abs","acos","addcb","addf","addhistory","addinter","amell","and","argn","arl2_ius","ascii","asin","atan","backslash","balanc","banner","base2dec","basename","bdiag","beep","besselh","besseli","besselj","besselk","bessely","beta","bezout","bfinit","blkfc1i","blkslvi","bool2s","browsehistory","browsevar","bsplin3val","buildDocv2","buildouttb","bvode","c_link","calerf","call","callblk","captions","cd","cdfbet","cdfbin","cdfchi","cdfchn","cdff","cdffnc","cdfgam","cdfnbn","cdfnor","cdfpoi","cdft","ceil","champ","champ1","chdir","chol","clc","clean","clear","clear_pixmap","clearfun","clearglobal","closeEditor","closeXcos","code2str","coeff","comp","completion","conj","contour2di","contr","conv2","convstr","copy","copyfile","corr","cos","coserror","createdir","cshep2d","ctree2","ctree3","ctree4","cumprod","cumsum","curblock","curblockc","dasrt","dassl","data2sig","debug","dec2base","deff","definedfields","degree","delbpt","delete","deletefile","delip","delmenu","det","dgettext","dhinf","diag","diary","diffobjs","disp","dispbpt","displayhistory","disposefftwlibrary","dlgamma","dnaupd","dneupd","double","draw","drawaxis","drawlater","drawnow","dsaupd","dsearch","dseupd","duplicate","editor","editvar","emptystr","end_scicosim","ereduc","errcatch","errclear","error","eval_cshep2d","exec","execstr","exists","exit","exp","expm","exportUI","export_to_hdf5","eye","fadj2sp","fec","feval","fft","fftw","fftw_flags","fftw_forget_wisdom","fftwlibraryisloaded","file","filebrowser","fileext","fileinfo","fileparts","filesep","find","findBD","findfiles","floor","format","fort","fprintfMat","freq","frexp","fromc","fromjava","fscanfMat","fsolve","fstair","full","fullpath","funcprot","funptr","gamma","gammaln","geom3d","get","get_absolute_file_path","get_fftw_wisdom","getblocklabel","getcallbackobject","getdate","getdebuginfo","getdefaultlanguage","getdrives","getdynlibext","getenv","getfield","gethistory","gethistoryfile","getinstalledlookandfeels","getio","getlanguage","getlongpathname","getlookandfeel","getmd5","getmemory","getmodules","getos","getpid","getrelativefilename","getscicosvars","getscilabmode","getshortpathname","gettext","getvariablesonstack","getversion","glist","global","glue","grand","grayplot","grep","gsort","gstacksize","havewindow","helpbrowser","hess","hinf","historymanager","historysize","host","iconvert","iconvert","ieee","ilib_verbose","imag","impl","import_from_hdf5","imult","inpnvi","int","int16","int2d","int32","int3d","int8","interp","interp2d","interp3d","intg","intppty","inttype","inv","is_handle_valid","isalphanum","isascii","isdef","isdigit","isdir","isequal","isequalbitwise","iserror","isfile","isglobal","isletter","isreal","iswaitingforinput","javaclasspath","javalibrarypath","kron","lasterror","ldiv","ldivf","legendre","length","lib","librarieslist","libraryinfo","linear_interpn","lines","link","linmeq","list","load","loadScicos","loadfftwlibrary","loadhistory","log","log1p","lsq","lsq_splin","lsqrsolve","lsslist","lstcat","lstsize","ltitr","lu","ludel","lufact","luget","lusolve","macr2lst","macr2tree","matfile_close","matfile_listvar","matfile_open","matfile_varreadnext","matfile_varwrite","matrix","max","maxfiles","mclearerr","mclose","meof","merror","messagebox","mfprintf","mfscanf","mget","mgeti","mgetl","mgetstr","min","mlist","mode","model2blk","mopen","move","movefile","mprintf","mput","mputl","mputstr","mscanf","mseek","msprintf","msscanf","mtell","mtlb_mode","mtlb_sparse","mucomp","mulf","nearfloat","newaxes","newest","newfun","nnz","notify","number_properties","ode","odedc","ones","opentk","optim","or","ordmmd","parallel_concurrency","parallel_run","param3d","param3d1","part","pathconvert","pathsep","phase_simulation","plot2d","plot2d1","plot2d2","plot2d3","plot2d4","plot3d","plot3d1","pointer_xproperty","poly","ppol","pppdiv","predef","print","printf","printfigure","printsetupbox","prod","progressionbar","prompt","pwd","qld","qp_solve","qr","raise_window","rand","rankqr","rat","rcond","rdivf","read","read4b","readb","readgateway","readmps","real","realtime","realtimeinit","regexp","relocate_handle","remez","removedir","removelinehistory","res_with_prec","resethistory","residu","resume","return","ricc","ricc_old","rlist","roots","rotate_axes","round","rpem","rtitr","rubberbox","save","saveafterncommands","saveconsecutivecommands","savehistory","schur","sci_haltscicos","sci_tree2","sci_tree3","sci_tree4","sciargs","scicos_debug","scicos_debug_count","scicos_time","scicosim","scinotes","sctree","semidef","set","set_blockerror","set_fftw_wisdom","set_xproperty","setbpt","setdefaultlanguage","setenv","setfield","sethistoryfile","setlanguage","setlookandfeel","setmenu","sfact","sfinit","show_pixmap","show_window","showalluimenushandles","sident","sig2data","sign","simp","simp_mode","sin","size","slash","sleep","sorder","sparse","spchol","spcompack","spec","spget","splin","splin2d","splin3d","spones","sprintf","sqrt","stacksize","str2code","strcat","strchr","strcmp","strcspn","strindex","string","stringbox","stripblanks","strncpy","strrchr","strrev","strsplit","strspn","strstr","strsubst","strtod","strtok","subf","sum","svd","swap_handles","symfcti","syredi","system_getproperty","system_setproperty","ta2lpd","tan","taucs_chdel","taucs_chfact","taucs_chget","taucs_chinfo","taucs_chsolve","tempname","testmatrix","timer","tlist","tohome","tokens","toolbar","toprint","tr_zer","tril","triu","type","typename","uiDisplayTree","uicontextmenu","uicontrol","uigetcolor","uigetdir","uigetfile","uigetfont","uimenu","uint16","uint32","uint8","uipopup","uiputfile","uiwait","ulink","umf_ludel","umf_lufact","umf_luget","umf_luinfo","umf_lusolve","umfpack","unglue","unix","unsetmenu","unzoom","updatebrowsevar","usecanvas","user","var2vec","varn","vec2var","waitbar","warnBlockByUID","warning","what","where","whereis","who","winsid","with_embedded_jre","with_module","writb","write","write4b","x_choose","x_choose_modeless","x_dialog","x_mdialog","xarc","xarcs","xarrows","xchange","xchoicesi","xclick","xcos","xcosAddToolsMenu","xcosConfigureXmlFile","xcosDiagramToScilab","xcosPalCategoryAdd","xcosPalDelete","xcosPalDisable","xcosPalEnable","xcosPalGenerateIcon","xcosPalLoad","xcosPalMove","xcosUpdateBlock","xdel","xfarc","xfarcs","xfpoly","xfpolys","xfrect","xget","xgetech","xgetmouse","xgraduate","xgrid","xlfont","xls_open","xls_read","xmlAddNs","xmlAsNumber","xmlAsText","xmlDTD","xmlDelete","xmlDocument","xmlDump","xmlElement","xmlFormat","xmlGetNsByHref","xmlGetNsByPrefix","xmlGetOpenDocs","xmlIsValidObject","xmlNs","xmlRead","xmlReadStr","xmlRelaxNG","xmlRemove","xmlSchema","xmlSetAttributes","xmlValidate","xmlWrite","xmlXPath","xname","xpause","xpoly","xpolys","xrect","xrects","xs2bmp","xs2eps","xs2gif","xs2jpg","xs2pdf","xs2png","xs2ppm","xs2ps","xs2svg","xsegs","xset","xsetech","xstring","xstringb","xtitle","zeros","znaupd","zneupd","zoom_rect"]
+
+commands_kw = ["abort","apropos","break","case","catch","clc","clear","continue","do","else","elseif","end","endfunction","exit","for","function","help","if","pause","pwd","quit","resume","return","select","then","try","what","while","who"]
+
+macros_kw = ["%0_i_st","%3d_i_h","%Block_xcosUpdateBlock","%TNELDER_p","%TNELDER_string","%TNMPLOT_p","%TNMPLOT_string","%TOPTIM_p","%TOPTIM_string","%TSIMPLEX_p","%TSIMPLEX_string","%_gsort","%_strsplit","%ar_p","%asn","%b_a_b","%b_a_s","%b_c_s","%b_c_spb","%b_cumprod","%b_cumsum","%b_d_s","%b_diag","%b_e","%b_f_s","%b_f_spb","%b_g_s","%b_g_spb","%b_h_s","%b_h_spb","%b_i_b","%b_i_ce","%b_i_h","%b_i_hm","%b_i_s","%b_i_sp","%b_i_spb","%b_i_st","%b_iconvert","%b_l_b","%b_l_s","%b_m_b","%b_m_s","%b_matrix","%b_n_hm","%b_o_hm","%b_p_s","%b_prod","%b_r_b","%b_r_s","%b_s_b","%b_s_s","%b_string","%b_sum","%b_tril","%b_triu","%b_x_b","%b_x_s","%c_a_c","%c_b_c","%c_b_s","%c_diag","%c_e","%c_eye","%c_f_s","%c_i_c","%c_i_ce","%c_i_h","%c_i_hm","%c_i_lss","%c_i_r","%c_i_s","%c_i_st","%c_matrix","%c_n_l","%c_n_st","%c_o_l","%c_o_st","%c_ones","%c_rand","%c_tril","%c_triu","%cblock_c_cblock","%cblock_c_s","%cblock_e","%cblock_f_cblock","%cblock_p","%cblock_size","%ce_6","%ce_c_ce","%ce_e","%ce_f_ce","%ce_i_ce","%ce_i_s","%ce_i_st","%ce_matrix","%ce_p","%ce_size","%ce_string","%ce_t","%champdat_i_h","%choose","%diagram_xcos","%dir_p","%fptr_i_st","%grayplot_i_h","%h_i_st","%hm_1_hm","%hm_1_s","%hm_2_hm","%hm_2_s","%hm_3_hm","%hm_3_s","%hm_4_hm","%hm_4_s","%hm_5","%hm_a_hm","%hm_a_r","%hm_a_s","%hm_abs","%hm_and","%hm_bool2s","%hm_c_hm","%hm_ceil","%hm_conj","%hm_cos","%hm_cumprod","%hm_cumsum","%hm_d_hm","%hm_d_s","%hm_degree","%hm_e","%hm_exp","%hm_f_hm","%hm_fft","%hm_find","%hm_floor","%hm_g_hm","%hm_h_hm","%hm_i_b","%hm_i_ce","%hm_i_hm","%hm_i_i","%hm_i_p","%hm_i_r","%hm_i_s","%hm_i_st","%hm_iconvert","%hm_imag","%hm_int","%hm_isnan","%hm_isreal","%hm_j_hm","%hm_j_s","%hm_k_hm","%hm_k_s","%hm_log","%hm_m_p","%hm_m_r","%hm_m_s","%hm_matrix","%hm_maxi","%hm_mean","%hm_median","%hm_mini","%hm_n_b","%hm_n_c","%hm_n_hm","%hm_n_i","%hm_n_p","%hm_n_s","%hm_o_b","%hm_o_c","%hm_o_hm","%hm_o_i","%hm_o_p","%hm_o_s","%hm_ones","%hm_or","%hm_p","%hm_prod","%hm_q_hm","%hm_r_s","%hm_rand","%hm_real","%hm_round","%hm_s","%hm_s_hm","%hm_s_r","%hm_s_s","%hm_sign","%hm_sin","%hm_size","%hm_sqrt","%hm_st_deviation","%hm_string","%hm_sum","%hm_x_hm","%hm_x_p","%hm_x_s","%hm_zeros","%i_1_s","%i_2_s","%i_3_s","%i_4_s","%i_Matplot","%i_a_i","%i_a_s","%i_and","%i_ascii","%i_b_s","%i_bezout","%i_champ","%i_champ1","%i_contour","%i_contour2d","%i_d_i","%i_d_s","%i_e","%i_fft","%i_g_i","%i_gcd","%i_h_i","%i_i_ce","%i_i_h","%i_i_hm","%i_i_i","%i_i_s","%i_i_st","%i_j_i","%i_j_s","%i_l_s","%i_lcm","%i_length","%i_m_i","%i_m_s","%i_mfprintf","%i_mprintf","%i_msprintf","%i_n_s","%i_o_s","%i_or","%i_p_i","%i_p_s","%i_plot2d","%i_plot2d1","%i_plot2d2","%i_q_s","%i_r_i","%i_r_s","%i_round","%i_s_i","%i_s_s","%i_sign","%i_string","%i_x_i","%i_x_s","%ip_a_s","%ip_i_st","%ip_m_s","%ip_n_ip","%ip_o_ip","%ip_p","%ip_s_s","%ip_string","%k","%l_i_h","%l_i_s","%l_i_st","%l_isequal","%l_n_c","%l_n_l","%l_n_m","%l_n_p","%l_n_s","%l_n_st","%l_o_c","%l_o_l","%l_o_m","%l_o_p","%l_o_s","%l_o_st","%lss_a_lss","%lss_a_p","%lss_a_r","%lss_a_s","%lss_c_lss","%lss_c_p","%lss_c_r","%lss_c_s","%lss_e","%lss_eye","%lss_f_lss","%lss_f_p","%lss_f_r","%lss_f_s","%lss_i_ce","%lss_i_lss","%lss_i_p","%lss_i_r","%lss_i_s","%lss_i_st","%lss_inv","%lss_l_lss","%lss_l_p","%lss_l_r","%lss_l_s","%lss_m_lss","%lss_m_p","%lss_m_r","%lss_m_s","%lss_n_lss","%lss_n_p","%lss_n_r","%lss_n_s","%lss_norm","%lss_o_lss","%lss_o_p","%lss_o_r","%lss_o_s","%lss_ones","%lss_r_lss","%lss_r_p","%lss_r_r","%lss_r_s","%lss_rand","%lss_s","%lss_s_lss","%lss_s_p","%lss_s_r","%lss_s_s","%lss_size","%lss_t","%lss_v_lss","%lss_v_p","%lss_v_r","%lss_v_s","%lt_i_s","%m_n_l","%m_o_l","%mc_i_h","%mc_i_s","%mc_i_st","%mc_n_st","%mc_o_st","%mc_string","%mps_p","%mps_string","%msp_a_s","%msp_abs","%msp_e","%msp_find","%msp_i_s","%msp_i_st","%msp_length","%msp_m_s","%msp_maxi","%msp_n_msp","%msp_nnz","%msp_o_msp","%msp_p","%msp_sparse","%msp_spones","%msp_t","%p_a_lss","%p_a_r","%p_c_lss","%p_c_r","%p_cumprod","%p_cumsum","%p_d_p","%p_d_r","%p_d_s","%p_det","%p_e","%p_f_lss","%p_f_r","%p_i_ce","%p_i_h","%p_i_hm","%p_i_lss","%p_i_p","%p_i_r","%p_i_s","%p_i_st","%p_inv","%p_j_s","%p_k_p","%p_k_r","%p_k_s","%p_l_lss","%p_l_p","%p_l_r","%p_l_s","%p_m_hm","%p_m_lss","%p_m_r","%p_matrix","%p_n_l","%p_n_lss","%p_n_r","%p_o_l","%p_o_lss","%p_o_r","%p_o_sp","%p_p_s","%p_prod","%p_q_p","%p_q_r","%p_q_s","%p_r_lss","%p_r_p","%p_r_r","%p_r_s","%p_s_lss","%p_s_r","%p_simp","%p_string","%p_sum","%p_v_lss","%p_v_p","%p_v_r","%p_v_s","%p_x_hm","%p_x_r","%p_y_p","%p_y_r","%p_y_s","%p_z_p","%p_z_r","%p_z_s","%r_a_hm","%r_a_lss","%r_a_p","%r_a_r","%r_a_s","%r_c_lss","%r_c_p","%r_c_r","%r_c_s","%r_clean","%r_cumprod","%r_d_p","%r_d_r","%r_d_s","%r_det","%r_diag","%r_e","%r_eye","%r_f_lss","%r_f_p","%r_f_r","%r_f_s","%r_i_ce","%r_i_hm","%r_i_lss","%r_i_p","%r_i_r","%r_i_s","%r_i_st","%r_inv","%r_j_s","%r_k_p","%r_k_r","%r_k_s","%r_l_lss","%r_l_p","%r_l_r","%r_l_s","%r_m_hm","%r_m_lss","%r_m_p","%r_m_r","%r_m_s","%r_matrix","%r_n_lss","%r_n_p","%r_n_r","%r_n_s","%r_norm","%r_o_lss","%r_o_p","%r_o_r","%r_o_s","%r_ones","%r_p","%r_p_s","%r_prod","%r_q_p","%r_q_r","%r_q_s","%r_r_lss","%r_r_p","%r_r_r","%r_r_s","%r_rand","%r_s","%r_s_hm","%r_s_lss","%r_s_p","%r_s_r","%r_s_s","%r_simp","%r_size","%r_string","%r_sum","%r_t","%r_tril","%r_triu","%r_v_lss","%r_v_p","%r_v_r","%r_v_s","%r_x_p","%r_x_r","%r_x_s","%r_y_p","%r_y_r","%r_y_s","%r_z_p","%r_z_r","%r_z_s","%s_1_hm","%s_1_i","%s_2_hm","%s_2_i","%s_3_hm","%s_3_i","%s_4_hm","%s_4_i","%s_5","%s_a_b","%s_a_hm","%s_a_i","%s_a_ip","%s_a_lss","%s_a_msp","%s_a_r","%s_a_sp","%s_and","%s_b_i","%s_b_s","%s_c_b","%s_c_cblock","%s_c_lss","%s_c_r","%s_c_sp","%s_d_b","%s_d_i","%s_d_p","%s_d_r","%s_d_sp","%s_e","%s_f_b","%s_f_cblock","%s_f_lss","%s_f_r","%s_f_sp","%s_g_b","%s_g_s","%s_h_b","%s_h_s","%s_i_b","%s_i_c","%s_i_ce","%s_i_h","%s_i_hm","%s_i_i","%s_i_lss","%s_i_p","%s_i_r","%s_i_s","%s_i_sp","%s_i_spb","%s_i_st","%s_j_i","%s_k_hm","%s_k_p","%s_k_r","%s_k_sp","%s_l_b","%s_l_hm","%s_l_i","%s_l_lss","%s_l_p","%s_l_r","%s_l_s","%s_l_sp","%s_m_b","%s_m_hm","%s_m_i","%s_m_ip","%s_m_lss","%s_m_msp","%s_m_r","%s_matrix","%s_n_hm","%s_n_i","%s_n_l","%s_n_lss","%s_n_r","%s_n_st","%s_o_hm","%s_o_i","%s_o_l","%s_o_lss","%s_o_r","%s_o_st","%s_or","%s_p_b","%s_p_i","%s_pow","%s_q_hm","%s_q_i","%s_q_p","%s_q_r","%s_q_sp","%s_r_b","%s_r_i","%s_r_lss","%s_r_p","%s_r_r","%s_r_s","%s_r_sp","%s_s_b","%s_s_hm","%s_s_i","%s_s_ip","%s_s_lss","%s_s_r","%s_s_sp","%s_simp","%s_v_lss","%s_v_p","%s_v_r","%s_v_s","%s_x_b","%s_x_hm","%s_x_i","%s_x_r","%s_y_p","%s_y_r","%s_y_sp","%s_z_p","%s_z_r","%s_z_sp","%sn","%sp_a_s","%sp_a_sp","%sp_and","%sp_c_s","%sp_ceil","%sp_cos","%sp_cumprod","%sp_cumsum","%sp_d_s","%sp_d_sp","%sp_diag","%sp_e","%sp_exp","%sp_f_s","%sp_floor","%sp_gsort","%sp_i_ce","%sp_i_h","%sp_i_s","%sp_i_sp","%sp_i_st","%sp_int","%sp_inv","%sp_k_s","%sp_k_sp","%sp_l_s","%sp_l_sp","%sp_length","%sp_norm","%sp_or","%sp_p_s","%sp_prod","%sp_q_s","%sp_q_sp","%sp_r_s","%sp_r_sp","%sp_round","%sp_s_s","%sp_s_sp","%sp_sin","%sp_sqrt","%sp_string","%sp_sum","%sp_tril","%sp_triu","%sp_y_s","%sp_y_sp","%sp_z_s","%sp_z_sp","%spb_and","%spb_c_b","%spb_cumprod","%spb_cumsum","%spb_diag","%spb_e","%spb_f_b","%spb_g_b","%spb_g_spb","%spb_h_b","%spb_h_spb","%spb_i_b","%spb_i_ce","%spb_i_h","%spb_i_st","%spb_or","%spb_prod","%spb_sum","%spb_tril","%spb_triu","%st_6","%st_c_st","%st_e","%st_f_st","%st_i_b","%st_i_c","%st_i_fptr","%st_i_h","%st_i_i","%st_i_ip","%st_i_lss","%st_i_msp","%st_i_p","%st_i_r","%st_i_s","%st_i_sp","%st_i_spb","%st_i_st","%st_matrix","%st_n_c","%st_n_l","%st_n_mc","%st_n_p","%st_n_s","%st_o_c","%st_o_l","%st_o_mc","%st_o_p","%st_o_s","%st_o_tl","%st_p","%st_size","%st_string","%st_t","%ticks_i_h","%xls_e","%xls_p","%xlssheet_e","%xlssheet_p","%xlssheet_size","%xlssheet_string","DominationRank","G_make","IsAScalar","NDcost","OS_Version","PlotSparse","ReadHBSparse","ReadmiMatrix","TCL_CreateSlave","WritemiMatrix","abcd","abinv","accept_func_default","accept_func_vfsa","acf","acosd","acosh","acoshm","acosm","acot","acotd","acoth","acsc","acscd","acsch","add_demo","add_help_chapter","add_module_help_chapter","add_param","add_profiling","adj2sp","aff2ab","ana_style","analpf","analyze","aplat","apropos","arhnk","arl2","arma2p","armac","armax","armax1","arobasestring2strings","arsimul","ascii2string","asciimat","asec","asecd","asech","asind","asinh","asinhm","asinm","assert_checkalmostequal","assert_checkequal","assert_checkerror","assert_checkfalse","assert_checkfilesequal","assert_checktrue","assert_comparecomplex","assert_computedigits","assert_cond2reltol","assert_cond2reqdigits","assert_generror","atand","atanh","atanhm","atanm","atomsAutoload","atomsAutoloadAdd","atomsAutoloadDel","atomsAutoloadList","atomsCategoryList","atomsCheckModule","atomsDepTreeShow","atomsGetConfig","atomsGetInstalled","atomsGetLoaded","atomsGetLoadedPath","atomsInstall","atomsIsInstalled","atomsIsLoaded","atomsList","atomsLoad","atomsRemove","atomsRepositoryAdd","atomsRepositoryDel","atomsRepositoryList","atomsRestoreConfig","atomsSaveConfig","atomsSearch","atomsSetConfig","atomsShow","atomsSystemInit","atomsSystemUpdate","atomsTest","atomsUpdate","atomsVersion","augment","auread","auwrite","balreal","bench_run","bilin","bilt","bin2dec","binomial","bitand","bitcmp","bitget","bitor","bitset","bitxor","black","blanks","bloc2exp","bloc2ss","block_parameter_error","bode","bstap","buttmag","bvodeS","bytecode","bytecodewalk","cainv","calendar","calfrq","canon","casc","cat","cat_code","cb_m2sci_gui","ccontrg","cell","cell2mat","cellstr","center","cepstrum","cfspec","char","chart","cheb1mag","cheb2mag","check_gateways","check_help","check_modules_xml","check_versions","chepol","chfact","chsolve","classmarkov","clean_help","clock","cls2dls","cmb_lin","cmndred","cmoment","coding_ga_binary","coding_ga_identity","coff","coffg","colcomp","colcompr","colinout","colregul","companion","complex","compute_initial_temp","cond","cond2sp","condestsp","config","configure_msifort","configure_msvc","cont_frm","cont_mat","contrss","conv","convert_to_float","convertindex","convol","convol2d","copfac","correl","cosd","cosh","coshm","cosm","cotd","cotg","coth","cothm","covar","createfun","createstruct","crossover_ga_binary","crossover_ga_default","csc","cscd","csch","csgn","csim","cspect","ctr_gram","czt","dae","daeoptions","damp","datafit","date","datenum","datevec","dbphi","dcf","ddp","dec2bin","dec2hex","dec2oct","del_help_chapter","del_module_help_chapter","demo_begin","demo_choose","demo_compiler","demo_end","demo_file_choice","demo_folder_choice","demo_function_choice","demo_gui","demo_mdialog","demo_message","demo_run","demo_viewCode","denom","derivat","derivative","des2ss","des2tf","detectmsifort64tools","detectmsvc64tools","determ","detr","detrend","devtools_run_builder","dft","dhnorm","diff","diophant","dir","dirname","dispfiles","dllinfo","dscr","dsimul","dt_ility","dtsi","edit","edit_error","eigenmarkov","ell1mag","enlarge_shape","entropy","eomday","epred","eqfir","eqiir","equil","equil1","erf","erfc","erfcx","erfinv","etime","eval","evans","evstr","expression2code","extract_help_examples","factor","factorial","factors","faurre","ffilt","fft2","fftshift","fieldnames","filt_sinc","filter","findABCD","findAC","findBDK","findR","find_freq","find_links","find_scicos_version","findm","findmsifortcompiler","findmsvccompiler","findx0BD","firstnonsingleton","fit_dat","fix","fixedpointgcd","flipdim","flts","fminsearch","format_txt","fourplan","fprintf","frep2tf","freson","frfit","frmag","fscanf","fseek_origin","fsfirlin","fspec","fspecg","fstabst","ftest","ftuneq","fullfile","fullrf","fullrfk","fun2string","g_margin","gainplot","gamitg","gcare","gcd","gencompilationflags_unix","generateBlockImage","generateBlockImages","generic_i_ce","generic_i_h","generic_i_hm","generic_i_s","generic_i_st","genlib","genlib_old","genmarkov","geomean","getDiagramVersion","getModelicaPath","get_file_path","get_function_path","get_param","get_profile","get_scicos_version","getd","getscilabkeywords","getshell","gettklib","gfare","gfrancis","givens","glever","gmres","group","gschur","gspec","gtild","h2norm","h_cl","h_inf","h_inf_st","h_norm","hallchart","halt","hank","hankelsv","harmean","haveacompiler","head_comments","help","help_from_sci","help_skeleton","hermit","hex2dec","hilb","hilbert","horner","householder","hrmt","htrianr","hypermat","ifft","iir","iirgroup","iirlp","iirmod","ilib_build","ilib_compile","ilib_for_link","ilib_gen_Make","ilib_gen_Make_unix","ilib_gen_cleaner","ilib_gen_gateway","ilib_gen_loader","ilib_include_flag","ilib_mex_build","im_inv","importScicosDiagram","importScicosPal","importXcosDiagram","imrep2ss","ind2sub","inistate","init_ga_default","init_param","initial_scicos_tables","input","instruction2code","intc","intdec","integrate","interp1","interpln","intersect","intl","intsplin","inttrap","inv_coeff","invr","invrs","invsyslin","iqr","isLeapYear","is_absolute_path","is_param","iscell","iscellstr","isempty","isfield","isinf","isnan","isnum","issparse","isstruct","isvector","jmat","justify","kalm","karmarkar","kernel","kpure","krac2","kroneck","lattn","launchtest","lcf","lcm","lcmdiag","leastsq","leqe","leqr","lev","levin","lex_sort","lft","lin","lin2mu","lincos","lindquist","linf","linfn","linsolve","linspace","list2vec","list_param","listfiles","listfunctions","listvarinfile","lmisolver","lmitool","loadXcosLibs","loadmatfile","loadwave","log10","log2","logm","logspace","lqe","lqg","lqg2stan","lqg_ltr","lqr","ls","lyap","m2sci_gui","m_circle","macglov","macrovar","mad","makecell","manedit","mapsound","markp2ss","matfile2sci","mdelete","mean","meanf","median","mese","meshgrid","mfft","mfile2sci","minreal","minss","mkdir","modulo","moment","mrfit","msd","mstr2sci","mtlb","mtlb_0","mtlb_a","mtlb_all","mtlb_any","mtlb_axes","mtlb_axis","mtlb_beta","mtlb_box","mtlb_choices","mtlb_close","mtlb_colordef","mtlb_cond","mtlb_conv","mtlb_cov","mtlb_cumprod","mtlb_cumsum","mtlb_dec2hex","mtlb_delete","mtlb_diag","mtlb_diff","mtlb_dir","mtlb_double","mtlb_e","mtlb_echo","mtlb_error","mtlb_eval","mtlb_exist","mtlb_eye","mtlb_false","mtlb_fft","mtlb_fftshift","mtlb_filter","mtlb_find","mtlb_findstr","mtlb_fliplr","mtlb_fopen","mtlb_format","mtlb_fprintf","mtlb_fread","mtlb_fscanf","mtlb_full","mtlb_fwrite","mtlb_get","mtlb_grid","mtlb_hold","mtlb_i","mtlb_ifft","mtlb_image","mtlb_imp","mtlb_int16","mtlb_int32","mtlb_int8","mtlb_is","mtlb_isa","mtlb_isfield","mtlb_isletter","mtlb_isspace","mtlb_l","mtlb_legendre","mtlb_linspace","mtlb_logic","mtlb_logical","mtlb_loglog","mtlb_lower","mtlb_max","mtlb_mean","mtlb_median","mtlb_mesh","mtlb_meshdom","mtlb_min","mtlb_more","mtlb_num2str","mtlb_ones","mtlb_pcolor","mtlb_plot","mtlb_prod","mtlb_qr","mtlb_qz","mtlb_rand","mtlb_randn","mtlb_rcond","mtlb_realmax","mtlb_realmin","mtlb_repmat","mtlb_s","mtlb_semilogx","mtlb_semilogy","mtlb_setstr","mtlb_size","mtlb_sort","mtlb_sortrows","mtlb_sprintf","mtlb_sscanf","mtlb_std","mtlb_strcmp","mtlb_strcmpi","mtlb_strfind","mtlb_strrep","mtlb_subplot","mtlb_sum","mtlb_t","mtlb_toeplitz","mtlb_tril","mtlb_triu","mtlb_true","mtlb_type","mtlb_uint16","mtlb_uint32","mtlb_uint8","mtlb_upper","mtlb_var","mtlb_zeros","mu2lin","mutation_ga_binary","mutation_ga_default","mvcorrel","mvvacov","nancumsum","nand2mean","nanmax","nanmean","nanmeanf","nanmedian","nanmin","nanstdev","nansum","narsimul","ndgrid","ndims","nehari","neigh_func_csa","neigh_func_default","neigh_func_fsa","neigh_func_vfsa","neldermead_cget","neldermead_configure","neldermead_costf","neldermead_defaultoutput","neldermead_destroy","neldermead_display","neldermead_function","neldermead_get","neldermead_log","neldermead_new","neldermead_restart","neldermead_search","neldermead_updatesimp","nextpow2","nfreq","nicholschart","nlev","nmplot_cget","nmplot_configure","nmplot_contour","nmplot_destroy","nmplot_display","nmplot_function","nmplot_get","nmplot_historyplot","nmplot_log","nmplot_new","nmplot_outputcmd","nmplot_restart","nmplot_search","nmplot_simplexhistory","noisegen","nonreg_test_run","norm","now","null","num2cell","numdiff","numer","nyquist","nyquistfrequencybounds","obs_gram","obscont","observer","obsv_mat","obsvss","oct2dec","odeoptions","optim_ga","optim_moga","optim_nsga","optim_nsga2","optim_sa","optimbase_cget","optimbase_checkbounds","optimbase_checkcostfun","optimbase_checkx0","optimbase_configure","optimbase_destroy","optimbase_display","optimbase_function","optimbase_get","optimbase_hasbounds","optimbase_hasconstraints","optimbase_hasnlcons","optimbase_histget","optimbase_histset","optimbase_incriter","optimbase_isfeasible","optimbase_isinbounds","optimbase_isinnonlincons","optimbase_log","optimbase_logshutdown","optimbase_logstartup","optimbase_new","optimbase_outputcmd","optimbase_outstruct","optimbase_proj2bnds","optimbase_set","optimbase_stoplog","optimbase_terminate","optimget","optimplotfunccount","optimplotfval","optimplotx","optimset","optimsimplex_center","optimsimplex_check","optimsimplex_compsomefv","optimsimplex_computefv","optimsimplex_deltafv","optimsimplex_deltafvmax","optimsimplex_destroy","optimsimplex_dirmat","optimsimplex_fvmean","optimsimplex_fvstdev","optimsimplex_fvvariance","optimsimplex_getall","optimsimplex_getallfv","optimsimplex_getallx","optimsimplex_getfv","optimsimplex_getn","optimsimplex_getnbve","optimsimplex_getve","optimsimplex_getx","optimsimplex_gradientfv","optimsimplex_log","optimsimplex_new","optimsimplex_print","optimsimplex_reflect","optimsimplex_setall","optimsimplex_setallfv","optimsimplex_setallx","optimsimplex_setfv","optimsimplex_setn","optimsimplex_setnbve","optimsimplex_setve","optimsimplex_setx","optimsimplex_shrink","optimsimplex_size","optimsimplex_sort","optimsimplex_tostring","optimsimplex_xbar","orth","p_margin","pack","pareto_filter","parrot","pbig","pca","pcg","pdiv","pen2ea","pencan","pencost","penlaur","perctl","perl","perms","permute","pertrans","pfactors","pfss","phasemag","phaseplot","phc","pinv","playsnd","plotprofile","plzr","pmodulo","pol2des","pol2str","polar","polfact","prbs_a","prettyprint","primes","princomp","profile","proj","projsl","projspec","psmall","pspect","qmr","qpsolve","quart","quaskro","rafiter","randpencil","range","rank","read_csv","readxls","recompilefunction","recons","reglin","regress","remezb","remove_param","remove_profiling","repfreq","replace_Ix_by_Fx","repmat","reset_profiling","resize_matrix","returntoscilab","rhs2code","ric_desc","riccati","rmdir","routh_t","rowcomp","rowcompr","rowinout","rowregul","rowshuff","rref","sample","samplef","samwr","savematfile","savewave","scanf","sci2exp","sciGUI_init","sci_sparse","scicos_getvalue","scicos_simulate","scicos_workspace_init","scisptdemo","scitest","sdiff","sec","secd","sech","selection_ga_elitist","selection_ga_random","sensi","set_param","setdiff","sgrid","show_margins","show_pca","showprofile","signm","sinc","sincd","sind","sinh","sinhm","sinm","sm2des","sm2ss","smga","smooth","solve","sound","soundsec","sp2adj","spaninter","spanplus","spantwo","specfact","speye","sprand","spzeros","sqroot","sqrtm","squarewave","squeeze","srfaur","srkf","ss2des","ss2ss","ss2tf","sscanf","sskf","ssprint","ssrand","st_deviation","st_i_generic","st_ility","stabil","statgain","stdev","stdevf","steadycos","strange","strcmpi","struct","sub2ind","sva","svplot","sylm","sylv","sysconv","sysdiag","sysfact","syslin","syssize","system","systmat","tabul","tand","tanh","tanhm","tanm","tbx_build_blocks","tbx_build_cleaner","tbx_build_gateway","tbx_build_gateway_clean","tbx_build_gateway_loader","tbx_build_help","tbx_build_help_loader","tbx_build_loader","tbx_build_macros","tbx_build_src","tbx_builder","tbx_builder_gateway","tbx_builder_gateway_lang","tbx_builder_help","tbx_builder_help_lang","tbx_builder_macros","tbx_builder_src","tbx_builder_src_lang","temp_law_csa","temp_law_default","temp_law_fsa","temp_law_huang","temp_law_vfsa","test_clean","test_on_columns","test_run","test_run_level","testexamples","tf2des","tf2ss","thrownan","tic","time_id","toc","toeplitz","tokenpos","toolboxes","trace","trans","translatepaths","tree2code","trfmod","trianfml","trimmean","trisolve","trzeros","typeof","ui_observer","union","unique","unit_test_run","unix_g","unix_s","unix_w","unix_x","unobs","unpack","variance","variancef","vec2list","vectorfind","ver","warnobsolete","wavread","wavwrite","wcenter","weekday","wfir","wfir_gui","whereami","who_user","whos","wiener","wigner","winclose","window","winlist","with_javasci","with_macros_source","with_modelica_compiler","with_pvm","with_texmacs","with_tk","write_csv","xcosBlockEval","xcosBlockInterface","xcosCodeGeneration","xcosConfigureModelica","xcosPal","xcosPalAdd","xcosPalAddBlock","xcosPalExport","xcosShowBlockWarning","xcosValidateBlockSet","xcosValidateCompareBlock","xcos_compile","xcos_run","xcos_simulate","xcos_workspace_init","xmltochm","xmltoformat","xmltohtml","xmltojar","xmltopdf","xmltops","xmltoweb","yulewalk","zeropen","zgrid","zpbutt","zpch1","zpch2","zpell"]
+
+builtin_consts = ["\\$","%F","%T","%e","%eps","%f","%fftw","%gui","%i","%inf","%io","%modalWarning","%nan","%pi","%s","%t","%tk","%toolboxes","%toolboxes_dir","%z","PWD","SCI","SCIHOME","TMPDIR","a","ans","assertlib","atomslib","cacsdlib","compatibility_functilib","corelib","data_structureslib","demo_toolslib","development_toolslib","differential_equationlib","dynamic_linklib","elementary_functionslib","fd","fileiolib","functionslib","genetic_algorithmslib","helptoolslib","home","i","integerlib","interpolationlib","iolib","j","linear_algebralib","m2scilib","matiolib","modules_managerlib","myStr","neldermeadlib","optimbaselib","optimizationlib","optimsimplexlib","output_streamlib","overloadinglib","parameterslib","polynomialslib","scicos_autolib","scicos_utilslib","scinoteslib","signal_processinglib","simulated_annealinglib","soundlib","sparselib","special_functionslib","spreadsheetlib","statisticslib","stringlib","tclscilib","timelib","umfpacklib","varType","xcoslib"]
index 71487fb17e1e47c3b9136adffc41fc9eb1968069..1ba5245a936c95ac58d7a1fc25e9c7841ecd396e 100644 (file)
@@ -1,3 +1,3 @@
-auto=[('BufAdd', 'BufAdd'), ('BufCreate', 'BufCreate'), ('BufDelete', 'BufDelete'), ('BufEnter', 'BufEnter'), ('BufFilePost', 'BufFilePost'), ('BufFilePre', 'BufFilePre'), ('BufHidden', 'BufHidden'), ('BufLeave', 'BufLeave'), ('BufNew', 'BufNew'), ('BufNewFile', 'BufNewFile'), ('BufRead', 'BufRead'), ('BufReadCmd', 'BufReadCmd'), ('BufReadPost', 'BufReadPost'), ('BufReadPre', 'BufReadPre'), ('BufUnload', 'BufUnload'), ('BufWinEnter', 'BufWinEnter'), ('BufWinLeave', 'BufWinLeave'), ('BufWipeout', 'BufWipeout'), ('BufWrite', 'BufWrite'), ('BufWriteCmd', 'BufWriteCmd'), ('BufWritePost', 'BufWritePost'), ('BufWritePre', 'BufWritePre'), ('Cmd', 'Cmd'), ('CmdwinEnter', 'CmdwinEnter'), ('CmdwinLeave', 'CmdwinLeave'), ('ColorScheme', 'ColorScheme'), ('CursorHold', 'CursorHold'), ('CursorHoldI', 'CursorHoldI'), ('CursorMoved', 'CursorMoved'), ('CursorMovedI', 'CursorMovedI'), ('EncodingChanged', 'EncodingChanged'), ('FileAppendCmd', 'FileAppendCmd'), ('FileAppendPost', 'FileAppendPost'), ('FileAppendPre', 'FileAppendPre'), ('FileChangedRO', 'FileChangedRO'), ('FileChangedShell', 'FileChangedShell'), ('FileChangedShellPost', 'FileChangedShellPost'), ('FileEncoding', 'FileEncoding'), ('FileReadCmd', 'FileReadCmd'), ('FileReadPost', 'FileReadPost'), ('FileReadPre', 'FileReadPre'), ('FileType', 'FileType'), ('FileWriteCmd', 'FileWriteCmd'), ('FileWritePost', 'FileWritePost'), ('FileWritePre', 'FileWritePre'), ('FilterReadPost', 'FilterReadPost'), ('FilterReadPre', 'FilterReadPre'), ('FilterWritePost', 'FilterWritePost'), ('FilterWritePre', 'FilterWritePre'), ('FocusGained', 'FocusGained'), ('FocusLost', 'FocusLost'), ('FuncUndefined', 'FuncUndefined'), ('GUIEnter', 'GUIEnter'), ('InsertChange', 'InsertChange'), ('InsertEnter', 'InsertEnter'), ('InsertLeave', 'InsertLeave'), ('MenuPopup', 'MenuPopup'), ('QuickFixCmdPost', 'QuickFixCmdPost'), ('QuickFixCmdPre', 'QuickFixCmdPre'), ('RemoteReply', 'RemoteReply'), ('SessionLoadPost', 'SessionLoadPost'), ('ShellCmdPost', 'ShellCmdPost'), ('ShellFilterPost', 'ShellFilterPost'), ('SourcePre', 'SourcePre'), ('SpellFileMissing', 'SpellFileMissing'), ('StdinReadPost', 'StdinReadPost'), ('StdinReadPre', 'StdinReadPre'), ('SwapExists', 'SwapExists'), ('Syntax', 'Syntax'), ('TabEnter', 'TabEnter'), ('TabLeave', 'TabLeave'), ('TermChanged', 'TermChanged'), ('TermResponse', 'TermResponse'), ('User', 'User'), ('UserGettingBored', 'UserGettingBored'), ('VimEnter', 'VimEnter'), ('VimLeave', 'VimLeave'), ('VimLeavePre', 'VimLeavePre'), ('VimResized', 'VimResized'), ('WinEnter', 'WinEnter'), ('WinLeave', 'WinLeave'), ('event', 'event')]
-command=[('DeleteFirst', 'DeleteFirst'), ('Explore', 'Explore'), ('Hexplore', 'Hexplore'), ('I', 'I'), ('N', 'Next'), ('NetrwSettings', 'NetrwSettings'), ('Nread', 'Nread'), ('Nw', 'Nw'), ('P', 'Print'), ('Sexplore', 'Sexplore'), ('Vexplore', 'Vexplore'), ('X', 'X'), ('XMLent', 'XMLent'), ('XMLns', 'XMLns'), ('ab', 'abbreviate'), ('abc', 'abclear'), ('abo', 'aboveleft'), ('al', 'all'), ('ar', 'args'), ('arga', 'argadd'), ('argd', 'argdelete'), ('argdo', 'argdo'), ('arge', 'argedit'), ('argg', 'argglobal'), ('argl', 'arglocal'), ('argu', 'argument'), ('as', 'ascii'), ('b', 'buffer'), ('bN', 'bNext'), ('ba', 'ball'), ('bad', 'badd'), ('bd', 'bdelete'), ('be', 'be'), ('bel', 'belowright'), ('bf', 'bfirst'), ('bl', 'blast'), ('bm', 'bmodified'), ('bn', 'bnext'), ('bo', 'botright'), ('bp', 'bprevious'), ('br', 'brewind'), ('brea', 'break'), ('breaka', 'breakadd'), ('breakd', 'breakdel'), ('breakl', 'breaklist'), ('bro', 'browse'), ('bufdo', 'bufdo'), ('buffers', 'buffers'), ('bun', 'bunload'), ('bw', 'bwipeout'), ('c', 'change'), ('cN', 'cNext'), ('cNf', 'cNfile'), ('ca', 'cabbrev'), ('cabc', 'cabclear'), ('cad', 'caddexpr'), ('caddb', 'caddbuffer'), ('caddf', 'caddfile'), ('cal', 'call'), ('cat', 'catch'), ('cb', 'cbuffer'), ('cc', 'cc'), ('ccl', 'cclose'), ('cd', 'cd'), ('ce', 'center'), ('cex', 'cexpr'), ('cf', 'cfile'), ('cfir', 'cfirst'), ('cg', 'cgetfile'), ('cgetb', 'cgetbuffer'), ('cgete', 'cgetexpr'), ('changes', 'changes'), ('chd', 'chdir'), ('che', 'checkpath'), ('checkt', 'checktime'), ('cl', 'clist'), ('cla', 'clast'), ('clo', 'close'), ('cmapc', 'cmapclear'), ('cn', 'cnext'), ('cnew', 'cnewer'), ('cnf', 'cnfile'), ('cnorea', 'cnoreabbrev'), ('co', 'copy'), ('col', 'colder'), ('colo', 'colorscheme'), ('comc', 'comclear'), ('comp', 'compiler'), ('con', 'continue'), ('conf', 'confirm'), ('cope', 'copen'), ('cp', 'cprevious'), ('cpf', 'cpfile'), ('cq', 'cquit'), ('cr', 'crewind'), ('cu', 'cunmap'), ('cuna', 'cunabbrev'), ('cw', 'cwindow'), ('d', 'delete'), ('debugg', 'debuggreedy'), ('delc', 'delcommand'), ('delf', 'delfunction'), ('delm', 'delmarks'), ('di', 'display'), ('diffg', 'diffget'), ('diffoff', 'diffoff'), ('diffpatch', 'diffpatch'), ('diffpu', 'diffput'), ('diffsplit', 'diffsplit'), ('diffthis', 'diffthis'), ('diffu', 'diffupdate'), ('dig', 'digraphs'), ('dj', 'djump'), ('dl', 'dlist'), ('dr', 'drop'), ('ds', 'dsearch'), ('dsp', 'dsplit'), ('e', 'edit'), ('earlier', 'earlier'), ('echoe', 'echoerr'), ('echom', 'echomsg'), ('echon', 'echon'), ('el', 'else'), ('elsei', 'elseif'), ('em', 'emenu'), ('emenu', 'emenu'), ('en', 'endif'), ('endf', 'endfunction'), ('endfo', 'endfor'), ('endt', 'endtry'), ('endw', 'endwhile'), ('ene', 'enew'), ('ex', 'ex'), ('exi', 'exit'), ('exu', 'exusage'), ('f', 'file'), ('files', 'files'), ('filetype', 'filetype'), ('fin', 'find'), ('fina', 'finally'), ('fini', 'finish'), ('fir', 'first'), ('fix', 'fixdel'), ('fo', 'fold'), ('foldc', 'foldclose'), ('foldd', 'folddoopen'), ('folddoc', 'folddoclosed'), ('foldo', 'foldopen'), ('for', 'for'), ('fu', 'function'), ('go', 'goto'), ('gr', 'grep'), ('grepa', 'grepadd'), ('h', 'help'), ('ha', 'hardcopy'), ('helpf', 'helpfind'), ('helpg', 'helpgrep'), ('helpt', 'helptags'), ('hid', 'hide'), ('his', 'history'), ('ia', 'iabbrev'), ('iabc', 'iabclear'), ('if', 'if'), ('ij', 'ijump'), ('il', 'ilist'), ('imapc', 'imapclear'), ('in', 'in'), ('inorea', 'inoreabbrev'), ('is', 'isearch'), ('isp', 'isplit'), ('iu', 'iunmap'), ('iuna', 'iunabbrev'), ('j', 'join'), ('ju', 'jumps'), ('k', 'k'), ('kee', 'keepmarks'), ('keepalt', 'keepalt'), ('keepj', 'keepjumps'), ('l', 'list'), ('lN', 'lNext'), ('lNf', 'lNfile'), ('la', 'last'), ('lad', 'laddexpr'), ('laddb', 'laddbuffer'), ('laddf', 'laddfile'), ('lan', 'language'), ('later', 'later'), ('lb', 'lbuffer'), ('lc', 'lcd'), ('lch', 'lchdir'), ('lcl', 'lclose'), ('le', 'left'), ('lefta', 'leftabove'), ('lex', 'lexpr'), ('lf', 'lfile'), ('lfir', 'lfirst'), ('lg', 'lgetfile'), ('lgetb', 'lgetbuffer'), ('lgete', 'lgetexpr'), ('lgr', 'lgrep'), ('lgrepa', 'lgrepadd'), ('lh', 'lhelpgrep'), ('ll', 'll'), ('lla', 'llast'), ('lli', 'llist'), ('lm', 'lmap'), ('lmak', 'lmake'), ('lmapc', 'lmapclear'), ('ln', 'lnoremap'), ('lne', 'lnext'), ('lnew', 'lnewer'), ('lnf', 'lnfile'), ('lo', 'loadview'), ('loc', 'lockmarks'), ('lockv', 'lockvar'), ('lol', 'lolder'), ('lop', 'lopen'), ('lp', 'lprevious'), ('lpf', 'lpfile'), ('lr', 'lrewind'), ('ls', 'ls'), ('lt', 'ltag'), ('lu', 'lunmap'), ('lv', 'lvimgrep'), ('lvimgrepa', 'lvimgrepadd'), ('lw', 'lwindow'), ('m', 'move'), ('ma', 'mark'), ('mak', 'make'), ('marks', 'marks'), ('mat', 'match'), ('menut', 'menutranslate'), ('mk', 'mkexrc'), ('mks', 'mksession'), ('mksp', 'mkspell'), ('mkv', 'mkvimrc'), ('mkvie', 'mkview'), ('mod', 'mode'), ('mz', 'mzscheme'), ('mzf', 'mzfile'), ('n', 'next'), ('nbkey', 'nbkey'), ('new', 'new'), ('nmapc', 'nmapclear'), ('noh', 'nohlsearch'), ('norea', 'noreabbrev'), ('nu', 'number'), ('nun', 'nunmap'), ('o', 'open'), ('omapc', 'omapclear'), ('on', 'only'), ('opt', 'options'), ('ou', 'ounmap'), ('p', 'print'), ('pc', 'pclose'), ('pe', 'perl'), ('ped', 'pedit'), ('perld', 'perldo'), ('po', 'pop'), ('popu', 'popu'), ('popu', 'popup'), ('pp', 'ppop'), ('pre', 'preserve'), ('prev', 'previous'), ('prof', 'profile'), ('profd', 'profdel'), ('prompt', 'prompt'), ('promptf', 'promptfind'), ('promptr', 'promptrepl'), ('ps', 'psearch'), ('ptN', 'ptNext'), ('pta', 'ptag'), ('ptf', 'ptfirst'), ('ptj', 'ptjump'), ('ptl', 'ptlast'), ('ptn', 'ptnext'), ('ptp', 'ptprevious'), ('ptr', 'ptrewind'), ('pts', 'ptselect'), ('pu', 'put'), ('pw', 'pwd'), ('py', 'python'), ('pyf', 'pyfile'), ('q', 'quit'), ('qa', 'qall'), ('quita', 'quitall'), ('r', 'read'), ('rec', 'recover'), ('red', 'redo'), ('redi', 'redir'), ('redr', 'redraw'), ('redraws', 'redrawstatus'), ('reg', 'registers'), ('res', 'resize'), ('ret', 'retab'), ('retu', 'return'), ('rew', 'rewind'), ('ri', 'right'), ('rightb', 'rightbelow'), ('ru', 'runtime'), ('rub', 'ruby'), ('rubyd', 'rubydo'), ('rubyf', 'rubyfile'), ('rv', 'rviminfo'), ('sN', 'sNext'), ('sa', 'sargument'), ('sal', 'sall'), ('san', 'sandbox'), ('sav', 'saveas'), ('sb', 'sbuffer'), ('sbN', 'sbNext'), ('sba', 'sball'), ('sbf', 'sbfirst'), ('sbl', 'sblast'), ('sbm', 'sbmodified'), ('sbn', 'sbnext'), ('sbp', 'sbprevious'), ('sbr', 'sbrewind'), ('scrip', 'scriptnames'), ('scripte', 'scriptencoding'), ('se', 'set'), ('setf', 'setfiletype'), ('setg', 'setglobal'), ('setl', 'setlocal'), ('sf', 'sfind'), ('sfir', 'sfirst'), ('sh', 'shell'), ('sign', 'sign'), ('sil', 'silent'), ('sim', 'simalt'), ('sl', 'sleep'), ('sla', 'slast'), ('sm', 'smagic'), ('sm', 'smap'), ('smapc', 'smapclear'), ('sme', 'sme'), ('smenu', 'smenu'), ('sn', 'snext'), ('sni', 'sniff'), ('sno', 'snomagic'), ('snor', 'snoremap'), ('snoreme', 'snoreme'), ('snoremenu', 'snoremenu'), ('so', 'source'), ('sor', 'sort'), ('sp', 'split'), ('spe', 'spellgood'), ('spelld', 'spelldump'), ('spelli', 'spellinfo'), ('spellr', 'spellrepall'), ('spellu', 'spellundo'), ('spellw', 'spellwrong'), ('spr', 'sprevious'), ('sre', 'srewind'), ('st', 'stop'), ('sta', 'stag'), ('star', 'startinsert'), ('startg', 'startgreplace'), ('startr', 'startreplace'), ('stj', 'stjump'), ('stopi', 'stopinsert'), ('sts', 'stselect'), ('sun', 'sunhide'), ('sunm', 'sunmap'), ('sus', 'suspend'), ('sv', 'sview'), ('syncbind', 'syncbind'), ('t', 't'), ('tN', 'tNext'), ('ta', 'tag'), ('tab', 'tab'), ('tabN', 'tabNext'), ('tabc', 'tabclose'), ('tabd', 'tabdo'), ('tabe', 'tabedit'), ('tabf', 'tabfind'), ('tabfir', 'tabfirst'), ('tabl', 'tablast'), ('tabmove', 'tabmove'), ('tabn', 'tabnext'), ('tabnew', 'tabnew'), ('tabo', 'tabonly'), ('tabp', 'tabprevious'), ('tabr', 'tabrewind'), ('tabs', 'tabs'), ('tags', 'tags'), ('tc', 'tcl'), ('tcld', 'tcldo'), ('tclf', 'tclfile'), ('te', 'tearoff'), ('tf', 'tfirst'), ('th', 'throw'), ('the', 'the'), ('tj', 'tjump'), ('tl', 'tlast'), ('tm', 'tm'), ('tm', 'tmenu'), ('tn', 'tnext'), ('to', 'topleft'), ('tp', 'tprevious'), ('tr', 'trewind'), ('try', 'try'), ('ts', 'tselect'), ('tu', 'tu'), ('tu', 'tunmenu'), ('u', 'undo'), ('una', 'unabbreviate'), ('undoj', 'undojoin'), ('undol', 'undolist'), ('unh', 'unhide'), ('unlo', 'unlockvar'), ('unm', 'unmap'), ('up', 'update'), ('ve', 'version'), ('verb', 'verbose'), ('vert', 'vertical'), ('vi', 'visual'), ('vie', 'view'), ('vim', 'vimgrep'), ('vimgrepa', 'vimgrepadd'), ('viu', 'viusage'), ('vmapc', 'vmapclear'), ('vne', 'vnew'), ('vs', 'vsplit'), ('vu', 'vunmap'), ('w', 'write'), ('wN', 'wNext'), ('wa', 'wall'), ('wh', 'while'), ('win', 'winsize'), ('winc', 'wincmd'), ('windo', 'windo'), ('winp', 'winpos'), ('wn', 'wnext'), ('wp', 'wprevious'), ('wq', 'wq'), ('wqa', 'wqall'), ('ws', 'wsverb'), ('wv', 'wviminfo'), ('x', 'xit'), ('xa', 'xall'), ('xm', 'xmap'), ('xmapc', 'xmapclear'), ('xme', 'xme'), ('xmenu', 'xmenu'), ('xn', 'xnoremap'), ('xnoreme', 'xnoreme'), ('xnoremenu', 'xnoremenu'), ('xu', 'xunmap'), ('y', 'yank')]
-option=[('acd', 'acd'), ('ai', 'ai'), ('akm', 'akm'), ('al', 'al'), ('aleph', 'aleph'), ('allowrevins', 'allowrevins'), ('altkeymap', 'altkeymap'), ('ambiwidth', 'ambiwidth'), ('ambw', 'ambw'), ('anti', 'anti'), ('antialias', 'antialias'), ('ar', 'ar'), ('arab', 'arab'), ('arabic', 'arabic'), ('arabicshape', 'arabicshape'), ('ari', 'ari'), ('arshape', 'arshape'), ('autochdir', 'autochdir'), ('autoindent', 'autoindent'), ('autoread', 'autoread'), ('autowrite', 'autowrite'), ('autowriteall', 'autowriteall'), ('aw', 'aw'), ('awa', 'awa'), ('background', 'background'), ('backspace', 'backspace'), ('backup', 'backup'), ('backupcopy', 'backupcopy'), ('backupdir', 'backupdir'), ('backupext', 'backupext'), ('backupskip', 'backupskip'), ('balloondelay', 'balloondelay'), ('ballooneval', 'ballooneval'), ('balloonexpr', 'balloonexpr'), ('bar', 'bar'), ('bdir', 'bdir'), ('bdlay', 'bdlay'), ('beval', 'beval'), ('bex', 'bex'), ('bexpr', 'bexpr'), ('bg', 'bg'), ('bh', 'bh'), ('bin', 'bin'), ('binary', 'binary'), ('biosk', 'biosk'), ('bioskey', 'bioskey'), ('bk', 'bk'), ('bkc', 'bkc'), ('bl', 'bl'), ('block', 'block'), ('bomb', 'bomb'), ('breakat', 'breakat'), ('brk', 'brk'), ('browsedir', 'browsedir'), ('bs', 'bs'), ('bsdir', 'bsdir'), ('bsk', 'bsk'), ('bt', 'bt'), ('bufhidden', 'bufhidden'), ('buflisted', 'buflisted'), ('buftype', 'buftype'), ('casemap', 'casemap'), ('cb', 'cb'), ('ccv', 'ccv'), ('cd', 'cd'), ('cdpath', 'cdpath'), ('cedit', 'cedit'), ('cf', 'cf'), ('cfu', 'cfu'), ('ch', 'ch'), ('charconvert', 'charconvert'), ('ci', 'ci'), ('cin', 'cin'), ('cindent', 'cindent'), ('cink', 'cink'), ('cinkeys', 'cinkeys'), ('cino', 'cino'), ('cinoptions', 'cinoptions'), ('cinw', 'cinw'), ('cinwords', 'cinwords'), ('clipboard', 'clipboard'), ('cmdheight', 'cmdheight'), ('cmdwinheight', 'cmdwinheight'), ('cmp', 'cmp'), ('cms', 'cms'), ('co', 'co'), ('columns', 'columns'), ('com', 'com'), ('comments', 'comments'), ('commentstring', 'commentstring'), ('compatible', 'compatible'), ('complete', 'complete'), ('completefunc', 'completefunc'), ('completeopt', 'completeopt'), ('confirm', 'confirm'), ('consk', 'consk'), ('conskey', 'conskey'), ('copyindent', 'copyindent'), ('cot', 'cot'), ('cp', 'cp'), ('cpo', 'cpo'), ('cpoptions', 'cpoptions'), ('cpt', 'cpt'), ('cscopepathcomp', 'cscopepathcomp'), ('cscopeprg', 'cscopeprg'), ('cscopequickfix', 'cscopequickfix'), ('cscopetag', 'cscopetag'), ('cscopetagorder', 'cscopetagorder'), ('cscopeverbose', 'cscopeverbose'), ('cspc', 'cspc'), ('csprg', 'csprg'), ('csqf', 'csqf'), ('cst', 'cst'), ('csto', 'csto'), ('csverb', 'csverb'), ('cuc', 'cuc'), ('cul', 'cul'), ('cursor', 'cursor'), ('cursor', 'cursor'), ('cursorcolumn', 'cursorcolumn'), ('cursorline', 'cursorline'), ('cwh', 'cwh'), ('debug', 'debug'), ('deco', 'deco'), ('def', 'def'), ('define', 'define'), ('delcombine', 'delcombine'), ('dex', 'dex'), ('dg', 'dg'), ('dict', 'dict'), ('dictionary', 'dictionary'), ('diff', 'diff'), ('diffexpr', 'diffexpr'), ('diffopt', 'diffopt'), ('digraph', 'digraph'), ('dip', 'dip'), ('dir', 'dir'), ('directory', 'directory'), ('display', 'display'), ('dy', 'dy'), ('ea', 'ea'), ('ead', 'ead'), ('eadirection', 'eadirection'), ('eb', 'eb'), ('ed', 'ed'), ('edcompatible', 'edcompatible'), ('ef', 'ef'), ('efm', 'efm'), ('ei', 'ei'), ('ek', 'ek'), ('enc', 'enc'), ('encoding', 'encoding'), ('end', 'end'), ('endofline', 'endofline'), ('eol', 'eol'), ('ep', 'ep'), ('equalalways', 'equalalways'), ('equalprg', 'equalprg'), ('errorbells', 'errorbells'), ('errorfile', 'errorfile'), ('errorformat', 'errorformat'), ('esckeys', 'esckeys'), ('et', 'et'), ('eventignore', 'eventignore'), ('ex', 'ex'), ('expandtab', 'expandtab'), ('exrc', 'exrc'), ('fcl', 'fcl'), ('fcs', 'fcs'), ('fdc', 'fdc'), ('fde', 'fde'), ('fdi', 'fdi'), ('fdl', 'fdl'), ('fdls', 'fdls'), ('fdm', 'fdm'), ('fdn', 'fdn'), ('fdo', 'fdo'), ('fdt', 'fdt'), ('fen', 'fen'), ('fenc', 'fenc'), ('fencs', 'fencs'), ('fex', 'fex'), ('ff', 'ff'), ('ffs', 'ffs'), ('fileencoding', 'fileencoding'), ('fileencodings', 'fileencodings'), ('fileformat', 'fileformat'), ('fileformats', 'fileformats'), ('filetype', 'filetype'), ('fillchars', 'fillchars'), ('fk', 'fk'), ('fkmap', 'fkmap'), ('flp', 'flp'), ('fml', 'fml'), ('fmr', 'fmr'), ('fo', 'fo'), ('foldclose', 'foldclose'), ('foldcolumn', 'foldcolumn'), ('foldenable', 'foldenable'), ('foldexpr', 'foldexpr'), ('foldignore', 'foldignore'), ('foldlevel', 'foldlevel'), ('foldlevelstart', 'foldlevelstart'), ('foldmarker', 'foldmarker'), ('foldmethod', 'foldmethod'), ('foldminlines', 'foldminlines'), ('foldnestmax', 'foldnestmax'), ('foldopen', 'foldopen'), ('foldtext', 'foldtext'), ('formatexpr', 'formatexpr'), ('formatlistpat', 'formatlistpat'), ('formatoptions', 'formatoptions'), ('formatprg', 'formatprg'), ('fp', 'fp'), ('fs', 'fs'), ('fsync', 'fsync'), ('ft', 'ft'), ('gcr', 'gcr'), ('gd', 'gd'), ('gdefault', 'gdefault'), ('gfm', 'gfm'), ('gfn', 'gfn'), ('gfs', 'gfs'), ('gfw', 'gfw'), ('ghr', 'ghr'), ('go', 'go'), ('gp', 'gp'), ('grepformat', 'grepformat'), ('grepprg', 'grepprg'), ('gtl', 'gtl'), ('gtt', 'gtt'), ('guicursor', 'guicursor'), ('guifont', 'guifont'), ('guifontset', 'guifontset'), ('guifontwide', 'guifontwide'), ('guiheadroom', 'guiheadroom'), ('guioptions', 'guioptions'), ('guipty', 'guipty'), ('guitablabel', 'guitablabel'), ('guitabtooltip', 'guitabtooltip'), ('helpfile', 'helpfile'), ('helpheight', 'helpheight'), ('helplang', 'helplang'), ('hf', 'hf'), ('hh', 'hh'), ('hi', 'hi'), ('hid', 'hid'), ('hidden', 'hidden'), ('highlight', 'highlight'), ('history', 'history'), ('hk', 'hk'), ('hkmap', 'hkmap'), ('hkmapp', 'hkmapp'), ('hkp', 'hkp'), ('hl', 'hl'), ('hlg', 'hlg'), ('hls', 'hls'), ('hlsearch', 'hlsearch'), ('ic', 'ic'), ('icon', 'icon'), ('iconstring', 'iconstring'), ('ignorecase', 'ignorecase'), ('im', 'im'), ('imactivatekey', 'imactivatekey'), ('imak', 'imak'), ('imc', 'imc'), ('imcmdline', 'imcmdline'), ('imd', 'imd'), ('imdisable', 'imdisable'), ('imi', 'imi'), ('iminsert', 'iminsert'), ('ims', 'ims'), ('imsearch', 'imsearch'), ('inc', 'inc'), ('include', 'include'), ('includeexpr', 'includeexpr'), ('incsearch', 'incsearch'), ('inde', 'inde'), ('indentexpr', 'indentexpr'), ('indentkeys', 'indentkeys'), ('indk', 'indk'), ('inex', 'inex'), ('inf', 'inf'), ('infercase', 'infercase'), ('insert', 'insert'), ('insert', 'insert'), ('insertmode', 'insertmode'), ('invacd', 'invacd'), ('invai', 'invai'), ('invakm', 'invakm'), ('invallowrevins', 'invallowrevins'), ('invaltkeymap', 'invaltkeymap'), ('invanti', 'invanti'), ('invantialias', 'invantialias'), ('invar', 'invar'), ('invarab', 'invarab'), ('invarabic', 'invarabic'), ('invarabicshape', 'invarabicshape'), ('invari', 'invari'), ('invarshape', 'invarshape'), ('invautochdir', 'invautochdir'), ('invautoindent', 'invautoindent'), ('invautoread', 'invautoread'), ('invautowrite', 'invautowrite'), ('invautowriteall', 'invautowriteall'), ('invaw', 'invaw'), ('invawa', 'invawa'), ('invbackup', 'invbackup'), ('invballooneval', 'invballooneval'), ('invbeval', 'invbeval'), ('invbin', 'invbin'), ('invbinary', 'invbinary'), ('invbiosk', 'invbiosk'), ('invbioskey', 'invbioskey'), ('invbk', 'invbk'), ('invbl', 'invbl'), ('invbomb', 'invbomb'), ('invbuflisted', 'invbuflisted'), ('invcf', 'invcf'), ('invci', 'invci'), ('invcin', 'invcin'), ('invcindent', 'invcindent'), ('invcompatible', 'invcompatible'), ('invconfirm', 'invconfirm'), ('invconsk', 'invconsk'), ('invconskey', 'invconskey'), ('invcopyindent', 'invcopyindent'), ('invcp', 'invcp'), ('invcscopetag', 'invcscopetag'), ('invcscopeverbose', 'invcscopeverbose'), ('invcst', 'invcst'), ('invcsverb', 'invcsverb'), ('invcuc', 'invcuc'), ('invcul', 'invcul'), ('invcursorcolumn', 'invcursorcolumn'), ('invcursorline', 'invcursorline'), ('invdeco', 'invdeco'), ('invdelcombine', 'invdelcombine'), ('invdg', 'invdg'), ('invdiff', 'invdiff'), ('invdigraph', 'invdigraph'), ('invdisable', 'invdisable'), ('invea', 'invea'), ('inveb', 'inveb'), ('inved', 'inved'), ('invedcompatible', 'invedcompatible'), ('invek', 'invek'), ('invendofline', 'invendofline'), ('inveol', 'inveol'), ('invequalalways', 'invequalalways'), ('inverrorbells', 'inverrorbells'), ('invesckeys', 'invesckeys'), ('invet', 'invet'), ('invex', 'invex'), ('invexpandtab', 'invexpandtab'), ('invexrc', 'invexrc'), ('invfen', 'invfen'), ('invfk', 'invfk'), ('invfkmap', 'invfkmap'), ('invfoldenable', 'invfoldenable'), ('invgd', 'invgd'), ('invgdefault', 'invgdefault'), ('invguipty', 'invguipty'), ('invhid', 'invhid'), ('invhidden', 'invhidden'), ('invhk', 'invhk'), ('invhkmap', 'invhkmap'), ('invhkmapp', 'invhkmapp'), ('invhkp', 'invhkp'), ('invhls', 'invhls'), ('invhlsearch', 'invhlsearch'), ('invic', 'invic'), ('invicon', 'invicon'), ('invignorecase', 'invignorecase'), ('invim', 'invim'), ('invimc', 'invimc'), ('invimcmdline', 'invimcmdline'), ('invimd', 'invimd'), ('invincsearch', 'invincsearch'), ('invinf', 'invinf'), ('invinfercase', 'invinfercase'), ('invinsertmode', 'invinsertmode'), ('invis', 'invis'), ('invjoinspaces', 'invjoinspaces'), ('invjs', 'invjs'), ('invlazyredraw', 'invlazyredraw'), ('invlbr', 'invlbr'), ('invlinebreak', 'invlinebreak'), ('invlisp', 'invlisp'), ('invlist', 'invlist'), ('invloadplugins', 'invloadplugins'), ('invlpl', 'invlpl'), ('invlz', 'invlz'), ('invma', 'invma'), ('invmacatsui', 'invmacatsui'), ('invmagic', 'invmagic'), ('invmh', 'invmh'), ('invml', 'invml'), ('invmod', 'invmod'), ('invmodeline', 'invmodeline'), ('invmodifiable', 'invmodifiable'), ('invmodified', 'invmodified'), ('invmore', 'invmore'), ('invmousef', 'invmousef'), ('invmousefocus', 'invmousefocus'), ('invmousehide', 'invmousehide'), ('invnu', 'invnu'), ('invnumber', 'invnumber'), ('invpaste', 'invpaste'), ('invpi', 'invpi'), ('invpreserveindent', 'invpreserveindent'), ('invpreviewwindow', 'invpreviewwindow'), ('invprompt', 'invprompt'), ('invpvw', 'invpvw'), ('invreadonly', 'invreadonly'), ('invremap', 'invremap'), ('invrestorescreen', 'invrestorescreen'), ('invrevins', 'invrevins'), ('invri', 'invri'), ('invrightleft', 'invrightleft'), ('invrightleftcmd', 'invrightleftcmd'), ('invrl', 'invrl'), ('invrlc', 'invrlc'), ('invro', 'invro'), ('invrs', 'invrs'), ('invru', 'invru'), ('invruler', 'invruler'), ('invsb', 'invsb'), ('invsc', 'invsc'), ('invscb', 'invscb'), ('invscrollbind', 'invscrollbind'), ('invscs', 'invscs'), ('invsecure', 'invsecure'), ('invsft', 'invsft'), ('invshellslash', 'invshellslash'), ('invshelltemp', 'invshelltemp'), ('invshiftround', 'invshiftround'), ('invshortname', 'invshortname'), ('invshowcmd', 'invshowcmd'), ('invshowfulltag', 'invshowfulltag'), ('invshowmatch', 'invshowmatch'), ('invshowmode', 'invshowmode'), ('invsi', 'invsi'), ('invsm', 'invsm'), ('invsmartcase', 'invsmartcase'), ('invsmartindent', 'invsmartindent'), ('invsmarttab', 'invsmarttab'), ('invsmd', 'invsmd'), ('invsn', 'invsn'), ('invsol', 'invsol'), ('invspell', 'invspell'), ('invsplitbelow', 'invsplitbelow'), ('invsplitright', 'invsplitright'), ('invspr', 'invspr'), ('invsr', 'invsr'), ('invssl', 'invssl'), ('invsta', 'invsta'), ('invstartofline', 'invstartofline'), ('invstmp', 'invstmp'), ('invswapfile', 'invswapfile'), ('invswf', 'invswf'), ('invta', 'invta'), ('invtagbsearch', 'invtagbsearch'), ('invtagrelative', 'invtagrelative'), ('invtagstack', 'invtagstack'), ('invtbi', 'invtbi'), ('invtbidi', 'invtbidi'), ('invtbs', 'invtbs'), ('invtermbidi', 'invtermbidi'), ('invterse', 'invterse'), ('invtextauto', 'invtextauto'), ('invtextmode', 'invtextmode'), ('invtf', 'invtf'), ('invtgst', 'invtgst'), ('invtildeop', 'invtildeop'), ('invtimeout', 'invtimeout'), ('invtitle', 'invtitle'), ('invto', 'invto'), ('invtop', 'invtop'), ('invtr', 'invtr'), ('invttimeout', 'invttimeout'), ('invttybuiltin', 'invttybuiltin'), ('invttyfast', 'invttyfast'), ('invtx', 'invtx'), ('invvb', 'invvb'), ('invvisualbell', 'invvisualbell'), ('invwa', 'invwa'), ('invwarn', 'invwarn'), ('invwb', 'invwb'), ('invweirdinvert', 'invweirdinvert'), ('invwfh', 'invwfh'), ('invwfw', 'invwfw'), ('invwildmenu', 'invwildmenu'), ('invwinfixheight', 'invwinfixheight'), ('invwinfixwidth', 'invwinfixwidth'), ('invwiv', 'invwiv'), ('invwmnu', 'invwmnu'), ('invwrap', 'invwrap'), ('invwrapscan', 'invwrapscan'), ('invwrite', 'invwrite'), ('invwriteany', 'invwriteany'), ('invwritebackup', 'invwritebackup'), ('invws', 'invws'), ('is', 'is'), ('isf', 'isf'), ('isfname', 'isfname'), ('isi', 'isi'), ('isident', 'isident'), ('isk', 'isk'), ('iskeyword', 'iskeyword'), ('isp', 'isp'), ('isprint', 'isprint'), ('joinspaces', 'joinspaces'), ('js', 'js'), ('key', 'key'), ('keymap', 'keymap'), ('keymodel', 'keymodel'), ('keywordprg', 'keywordprg'), ('km', 'km'), ('kmp', 'kmp'), ('kp', 'kp'), ('langmap', 'langmap'), ('langmenu', 'langmenu'), ('laststatus', 'laststatus'), ('lazyredraw', 'lazyredraw'), ('lbr', 'lbr'), ('lcs', 'lcs'), ('linebreak', 'linebreak'), ('lines', 'lines'), ('linespace', 'linespace'), ('lisp', 'lisp'), ('lispwords', 'lispwords'), ('list', 'list'), ('listchars', 'listchars'), ('lm', 'lm'), ('lmap', 'lmap'), ('loadplugins', 'loadplugins'), ('lpl', 'lpl'), ('ls', 'ls'), ('lsp', 'lsp'), ('lw', 'lw'), ('lz', 'lz'), ('ma', 'ma'), ('macatsui', 'macatsui'), ('magic', 'magic'), ('makeef', 'makeef'), ('makeprg', 'makeprg'), ('mat', 'mat'), ('matchpairs', 'matchpairs'), ('matchtime', 'matchtime'), ('maxcombine', 'maxcombine'), ('maxfuncdepth', 'maxfuncdepth'), ('maxmapdepth', 'maxmapdepth'), ('maxmem', 'maxmem'), ('maxmempattern', 'maxmempattern'), ('maxmemtot', 'maxmemtot'), ('mco', 'mco'), ('mef', 'mef'), ('menuitems', 'menuitems'), ('mfd', 'mfd'), ('mh', 'mh'), ('mis', 'mis'), ('mkspellmem', 'mkspellmem'), ('ml', 'ml'), ('mls', 'mls'), ('mm', 'mm'), ('mmd', 'mmd'), ('mmp', 'mmp'), ('mmt', 'mmt'), ('mod', 'mod'), ('mode', 'mode'), ('mode', 'mode'), ('modeline', 'modeline'), ('modelines', 'modelines'), ('modifiable', 'modifiable'), ('modified', 'modified'), ('more', 'more'), ('mouse', 'mouse'), ('mousef', 'mousef'), ('mousefocus', 'mousefocus'), ('mousehide', 'mousehide'), ('mousem', 'mousem'), ('mousemodel', 'mousemodel'), ('mouses', 'mouses'), ('mouseshape', 'mouseshape'), ('mouset', 'mouset'), ('mousetime', 'mousetime'), ('mp', 'mp'), ('mps', 'mps'), ('msm', 'msm'), ('mzq', 'mzq'), ('mzquantum', 'mzquantum'), ('nf', 'nf'), ('noacd', 'noacd'), ('noai', 'noai'), ('noakm', 'noakm'), ('noallowrevins', 'noallowrevins'), ('noaltkeymap', 'noaltkeymap'), ('noanti', 'noanti'), ('noantialias', 'noantialias'), ('noar', 'noar'), ('noarab', 'noarab'), ('noarabic', 'noarabic'), ('noarabicshape', 'noarabicshape'), ('noari', 'noari'), ('noarshape', 'noarshape'), ('noautochdir', 'noautochdir'), ('noautoindent', 'noautoindent'), ('noautoread', 'noautoread'), ('noautowrite', 'noautowrite'), ('noautowriteall', 'noautowriteall'), ('noaw', 'noaw'), ('noawa', 'noawa'), ('nobackup', 'nobackup'), ('noballooneval', 'noballooneval'), ('nobeval', 'nobeval'), ('nobin', 'nobin'), ('nobinary', 'nobinary'), ('nobiosk', 'nobiosk'), ('nobioskey', 'nobioskey'), ('nobk', 'nobk'), ('nobl', 'nobl'), ('nobomb', 'nobomb'), ('nobuflisted', 'nobuflisted'), ('nocf', 'nocf'), ('noci', 'noci'), ('nocin', 'nocin'), ('nocindent', 'nocindent'), ('nocompatible', 'nocompatible'), ('noconfirm', 'noconfirm'), ('noconsk', 'noconsk'), ('noconskey', 'noconskey'), ('nocopyindent', 'nocopyindent'), ('nocp', 'nocp'), ('nocscopetag', 'nocscopetag'), ('nocscopeverbose', 'nocscopeverbose'), ('nocst', 'nocst'), ('nocsverb', 'nocsverb'), ('nocuc', 'nocuc'), ('nocul', 'nocul'), ('nocursorcolumn', 'nocursorcolumn'), ('nocursorline', 'nocursorline'), ('nodeco', 'nodeco'), ('nodelcombine', 'nodelcombine'), ('nodg', 'nodg'), ('nodiff', 'nodiff'), ('nodigraph', 'nodigraph'), ('nodisable', 'nodisable'), ('noea', 'noea'), ('noeb', 'noeb'), ('noed', 'noed'), ('noedcompatible', 'noedcompatible'), ('noek', 'noek'), ('noendofline', 'noendofline'), ('noeol', 'noeol'), ('noequalalways', 'noequalalways'), ('noerrorbells', 'noerrorbells'), ('noesckeys', 'noesckeys'), ('noet', 'noet'), ('noex', 'noex'), ('noexpandtab', 'noexpandtab'), ('noexrc', 'noexrc'), ('nofen', 'nofen'), ('nofk', 'nofk'), ('nofkmap', 'nofkmap'), ('nofoldenable', 'nofoldenable'), ('nogd', 'nogd'), ('nogdefault', 'nogdefault'), ('noguipty', 'noguipty'), ('nohid', 'nohid'), ('nohidden', 'nohidden'), ('nohk', 'nohk'), ('nohkmap', 'nohkmap'), ('nohkmapp', 'nohkmapp'), ('nohkp', 'nohkp'), ('nohls', 'nohls'), ('nohlsearch', 'nohlsearch'), ('noic', 'noic'), ('noicon', 'noicon'), ('noignorecase', 'noignorecase'), ('noim', 'noim'), ('noimc', 'noimc'), ('noimcmdline', 'noimcmdline'), ('noimd', 'noimd'), ('noincsearch', 'noincsearch'), ('noinf', 'noinf'), ('noinfercase', 'noinfercase'), ('noinsertmode', 'noinsertmode'), ('nois', 'nois'), ('nojoinspaces', 'nojoinspaces'), ('nojs', 'nojs'), ('nolazyredraw', 'nolazyredraw'), ('nolbr', 'nolbr'), ('nolinebreak', 'nolinebreak'), ('nolisp', 'nolisp'), ('nolist', 'nolist'), ('noloadplugins', 'noloadplugins'), ('nolpl', 'nolpl'), ('nolz', 'nolz'), ('noma', 'noma'), ('nomacatsui', 'nomacatsui'), ('nomagic', 'nomagic'), ('nomh', 'nomh'), ('noml', 'noml'), ('nomod', 'nomod'), ('nomodeline', 'nomodeline'), ('nomodifiable', 'nomodifiable'), ('nomodified', 'nomodified'), ('nomore', 'nomore'), ('nomousef', 'nomousef'), ('nomousefocus', 'nomousefocus'), ('nomousehide', 'nomousehide'), ('nonu', 'nonu'), ('nonumber', 'nonumber'), ('nopaste', 'nopaste'), ('nopi', 'nopi'), ('nopreserveindent', 'nopreserveindent'), ('nopreviewwindow', 'nopreviewwindow'), ('noprompt', 'noprompt'), ('nopvw', 'nopvw'), ('noreadonly', 'noreadonly'), ('noremap', 'noremap'), ('norestorescreen', 'norestorescreen'), ('norevins', 'norevins'), ('nori', 'nori'), ('norightleft', 'norightleft'), ('norightleftcmd', 'norightleftcmd'), ('norl', 'norl'), ('norlc', 'norlc'), ('noro', 'noro'), ('nors', 'nors'), ('noru', 'noru'), ('noruler', 'noruler'), ('nosb', 'nosb'), ('nosc', 'nosc'), ('noscb', 'noscb'), ('noscrollbind', 'noscrollbind'), ('noscs', 'noscs'), ('nosecure', 'nosecure'), ('nosft', 'nosft'), ('noshellslash', 'noshellslash'), ('noshelltemp', 'noshelltemp'), ('noshiftround', 'noshiftround'), ('noshortname', 'noshortname'), ('noshowcmd', 'noshowcmd'), ('noshowfulltag', 'noshowfulltag'), ('noshowmatch', 'noshowmatch'), ('noshowmode', 'noshowmode'), ('nosi', 'nosi'), ('nosm', 'nosm'), ('nosmartcase', 'nosmartcase'), ('nosmartindent', 'nosmartindent'), ('nosmarttab', 'nosmarttab'), ('nosmd', 'nosmd'), ('nosn', 'nosn'), ('nosol', 'nosol'), ('nospell', 'nospell'), ('nosplitbelow', 'nosplitbelow'), ('nosplitright', 'nosplitright'), ('nospr', 'nospr'), ('nosr', 'nosr'), ('nossl', 'nossl'), ('nosta', 'nosta'), ('nostartofline', 'nostartofline'), ('nostmp', 'nostmp'), ('noswapfile', 'noswapfile'), ('noswf', 'noswf'), ('nota', 'nota'), ('notagbsearch', 'notagbsearch'), ('notagrelative', 'notagrelative'), ('notagstack', 'notagstack'), ('notbi', 'notbi'), ('notbidi', 'notbidi'), ('notbs', 'notbs'), ('notermbidi', 'notermbidi'), ('noterse', 'noterse'), ('notextauto', 'notextauto'), ('notextmode', 'notextmode'), ('notf', 'notf'), ('notgst', 'notgst'), ('notildeop', 'notildeop'), ('notimeout', 'notimeout'), ('notitle', 'notitle'), ('noto', 'noto'), ('notop', 'notop'), ('notr', 'notr'), ('nottimeout', 'nottimeout'), ('nottybuiltin', 'nottybuiltin'), ('nottyfast', 'nottyfast'), ('notx', 'notx'), ('novb', 'novb'), ('novisualbell', 'novisualbell'), ('nowa', 'nowa'), ('nowarn', 'nowarn'), ('nowb', 'nowb'), ('noweirdinvert', 'noweirdinvert'), ('nowfh', 'nowfh'), ('nowfw', 'nowfw'), ('nowildmenu', 'nowildmenu'), ('nowinfixheight', 'nowinfixheight'), ('nowinfixwidth', 'nowinfixwidth'), ('nowiv', 'nowiv'), ('nowmnu', 'nowmnu'), ('nowrap', 'nowrap'), ('nowrapscan', 'nowrapscan'), ('nowrite', 'nowrite'), ('nowriteany', 'nowriteany'), ('nowritebackup', 'nowritebackup'), ('nows', 'nows'), ('nrformats', 'nrformats'), ('nu', 'nu'), ('number', 'number'), ('numberwidth', 'numberwidth'), ('nuw', 'nuw'), ('oft', 'oft'), ('ofu', 'ofu'), ('omnifunc', 'omnifunc'), ('operatorfunc', 'operatorfunc'), ('opfunc', 'opfunc'), ('osfiletype', 'osfiletype'), ('pa', 'pa'), ('para', 'para'), ('paragraphs', 'paragraphs'), ('paste', 'paste'), ('pastetoggle', 'pastetoggle'), ('patchexpr', 'patchexpr'), ('patchmode', 'patchmode'), ('path', 'path'), ('pdev', 'pdev'), ('penc', 'penc'), ('pex', 'pex'), ('pexpr', 'pexpr'), ('pfn', 'pfn'), ('ph', 'ph'), ('pheader', 'pheader'), ('pi', 'pi'), ('pm', 'pm'), ('pmbcs', 'pmbcs'), ('pmbfn', 'pmbfn'), ('popt', 'popt'), ('preserveindent', 'preserveindent'), ('previewheight', 'previewheight'), ('previewwindow', 'previewwindow'), ('printdevice', 'printdevice'), ('printencoding', 'printencoding'), ('printexpr', 'printexpr'), ('printfont', 'printfont'), ('printheader', 'printheader'), ('printmbcharset', 'printmbcharset'), ('printmbfont', 'printmbfont'), ('printoptions', 'printoptions'), ('prompt', 'prompt'), ('pt', 'pt'), ('pumheight', 'pumheight'), ('pvh', 'pvh'), ('pvw', 'pvw'), ('qe', 'qe'), ('quoteescape', 'quoteescape'), ('readonly', 'readonly'), ('remap', 'remap'), ('report', 'report'), ('restorescreen', 'restorescreen'), ('revins', 'revins'), ('ri', 'ri'), ('rightleft', 'rightleft'), ('rightleftcmd', 'rightleftcmd'), ('rl', 'rl'), ('rlc', 'rlc'), ('ro', 'ro'), ('rs', 'rs'), ('rtp', 'rtp'), ('ru', 'ru'), ('ruf', 'ruf'), ('ruler', 'ruler'), ('rulerformat', 'rulerformat'), ('runtimepath', 'runtimepath'), ('sb', 'sb'), ('sbo', 'sbo'), ('sbr', 'sbr'), ('sc', 'sc'), ('scb', 'scb'), ('scr', 'scr'), ('scroll', 'scroll'), ('scrollbind', 'scrollbind'), ('scrolljump', 'scrolljump'), ('scrolloff', 'scrolloff'), ('scrollopt', 'scrollopt'), ('scs', 'scs'), ('sect', 'sect'), ('sections', 'sections'), ('secure', 'secure'), ('sel', 'sel'), ('selection', 'selection'), ('selectmode', 'selectmode'), ('sessionoptions', 'sessionoptions'), ('sft', 'sft'), ('sh', 'sh'), ('shape', 'shape'), ('shape', 'shape'), ('shcf', 'shcf'), ('shell', 'shell'), ('shellcmdflag', 'shellcmdflag'), ('shellpipe', 'shellpipe'), ('shellquote', 'shellquote'), ('shellredir', 'shellredir'), ('shellslash', 'shellslash'), ('shelltemp', 'shelltemp'), ('shelltype', 'shelltype'), ('shellxquote', 'shellxquote'), ('shiftround', 'shiftround'), ('shiftwidth', 'shiftwidth'), ('shm', 'shm'), ('shortmess', 'shortmess'), ('shortname', 'shortname'), ('showbreak', 'showbreak'), ('showcmd', 'showcmd'), ('showfulltag', 'showfulltag'), ('showmatch', 'showmatch'), ('showmode', 'showmode'), ('showtabline', 'showtabline'), ('shq', 'shq'), ('si', 'si'), ('sidescroll', 'sidescroll'), ('sidescrolloff', 'sidescrolloff'), ('siso', 'siso'), ('sj', 'sj'), ('slm', 'slm'), ('sm', 'sm'), ('smartcase', 'smartcase'), ('smartindent', 'smartindent'), ('smarttab', 'smarttab'), ('smc', 'smc'), ('smd', 'smd'), ('sn', 'sn'), ('so', 'so'), ('softtabstop', 'softtabstop'), ('sol', 'sol'), ('sp', 'sp'), ('spc', 'spc'), ('spell', 'spell'), ('spellcapcheck', 'spellcapcheck'), ('spellfile', 'spellfile'), ('spelllang', 'spelllang'), ('spellsuggest', 'spellsuggest'), ('spf', 'spf'), ('spl', 'spl'), ('splitbelow', 'splitbelow'), ('splitright', 'splitright'), ('spr', 'spr'), ('sps', 'sps'), ('sr', 'sr'), ('srr', 'srr'), ('ss', 'ss'), ('ssl', 'ssl'), ('ssop', 'ssop'), ('st', 'st'), ('sta', 'sta'), ('stal', 'stal'), ('start', 'start'), ('startofline', 'startofline'), ('statusline', 'statusline'), ('stl', 'stl'), ('stmp', 'stmp'), ('sts', 'sts'), ('su', 'su'), ('sua', 'sua'), ('suffixes', 'suffixes'), ('suffixesadd', 'suffixesadd'), ('sw', 'sw'), ('swapfile', 'swapfile'), ('swapsync', 'swapsync'), ('swb', 'swb'), ('swf', 'swf'), ('switchbuf', 'switchbuf'), ('sws', 'sws'), ('sxq', 'sxq'), ('syn', 'syn'), ('synmaxcol', 'synmaxcol'), ('syntax', 'syntax'), ('t_AB', 't_AB'), ('t_AF', 't_AF'), ('t_AL', 't_AL'), ('t_CS', 't_CS'), ('t_CV', 't_CV'), ('t_Ce', 't_Ce'), ('t_Co', 't_Co'), ('t_Cs', 't_Cs'), ('t_DL', 't_DL'), ('t_EI', 't_EI'), ('t_EI', 't_EI'), ('t_EI', 't_EI'), ('t_F1', 't_F1'), ('t_F2', 't_F2'), ('t_F3', 't_F3'), ('t_F4', 't_F4'), ('t_F5', 't_F5'), ('t_F6', 't_F6'), ('t_F7', 't_F7'), ('t_F8', 't_F8'), ('t_F9', 't_F9'), ('t_IE', 't_IE'), ('t_IS', 't_IS'), ('t_K1', 't_K1'), ('t_K3', 't_K3'), ('t_K4', 't_K4'), ('t_K5', 't_K5'), ('t_K6', 't_K6'), ('t_K7', 't_K7'), ('t_K8', 't_K8'), ('t_K9', 't_K9'), ('t_KA', 't_KA'), ('t_KB', 't_KB'), ('t_KC', 't_KC'), ('t_KD', 't_KD'), ('t_KE', 't_KE'), ('t_KF', 't_KF'), ('t_KG', 't_KG'), ('t_KH', 't_KH'), ('t_KI', 't_KI'), ('t_KJ', 't_KJ'), ('t_KK', 't_KK'), ('t_KL', 't_KL'), ('t_RI', 't_RI'), ('t_RV', 't_RV'), ('t_SI', 't_SI'), ('t_SI', 't_SI'), ('t_SI', 't_SI'), ('t_Sb', 't_Sb'), ('t_Sf', 't_Sf'), ('t_WP', 't_WP'), ('t_WS', 't_WS'), ('t_ZH', 't_ZH'), ('t_ZR', 't_ZR'), ('t_al', 't_al'), ('t_bc', 't_bc'), ('t_cd', 't_cd'), ('t_ce', 't_ce'), ('t_cl', 't_cl'), ('t_cm', 't_cm'), ('t_cs', 't_cs'), ('t_da', 't_da'), ('t_db', 't_db'), ('t_dl', 't_dl'), ('t_fs', 't_fs'), ('t_k1', 't_k1'), ('t_k2', 't_k2'), ('t_k3', 't_k3'), ('t_k4', 't_k4'), ('t_k5', 't_k5'), ('t_k6', 't_k6'), ('t_k7', 't_k7'), ('t_k8', 't_k8'), ('t_k9', 't_k9'), ('t_kB', 't_kB'), ('t_kD', 't_kD'), ('t_kI', 't_kI'), ('t_kN', 't_kN'), ('t_kP', 't_kP'), ('t_kb', 't_kb'), ('t_kd', 't_kd'), ('t_ke', 't_ke'), ('t_kh', 't_kh'), ('t_kl', 't_kl'), ('t_kr', 't_kr'), ('t_ks', 't_ks'), ('t_ku', 't_ku'), ('t_le', 't_le'), ('t_mb', 't_mb'), ('t_md', 't_md'), ('t_me', 't_me'), ('t_mr', 't_mr'), ('t_ms', 't_ms'), ('t_nd', 't_nd'), ('t_op', 't_op'), ('t_se', 't_se'), ('t_so', 't_so'), ('t_sr', 't_sr'), ('t_te', 't_te'), ('t_ti', 't_ti'), ('t_ts', 't_ts'), ('t_ue', 't_ue'), ('t_us', 't_us'), ('t_ut', 't_ut'), ('t_vb', 't_vb'), ('t_ve', 't_ve'), ('t_vi', 't_vi'), ('t_vs', 't_vs'), ('t_xs', 't_xs'), ('ta', 'ta'), ('tabline', 'tabline'), ('tabpagemax', 'tabpagemax'), ('tabstop', 'tabstop'), ('tag', 'tag'), ('tagbsearch', 'tagbsearch'), ('taglength', 'taglength'), ('tagrelative', 'tagrelative'), ('tags', 'tags'), ('tagstack', 'tagstack'), ('tal', 'tal'), ('tb', 'tb'), ('tbi', 'tbi'), ('tbidi', 'tbidi'), ('tbis', 'tbis'), ('tbs', 'tbs'), ('tenc', 'tenc'), ('term', 'term'), ('termbidi', 'termbidi'), ('termencoding', 'termencoding'), ('terse', 'terse'), ('textauto', 'textauto'), ('textmode', 'textmode'), ('textwidth', 'textwidth'), ('tf', 'tf'), ('tgst', 'tgst'), ('thesaurus', 'thesaurus'), ('tildeop', 'tildeop'), ('timeout', 'timeout'), ('timeoutlen', 'timeoutlen'), ('title', 'title'), ('titlelen', 'titlelen'), ('titleold', 'titleold'), ('titlestring', 'titlestring'), ('tl', 'tl'), ('tm', 'tm'), ('to', 'to'), ('toolbar', 'toolbar'), ('toolbariconsize', 'toolbariconsize'), ('top', 'top'), ('tpm', 'tpm'), ('tr', 'tr'), ('ts', 'ts'), ('tsl', 'tsl'), ('tsr', 'tsr'), ('ttimeout', 'ttimeout'), ('ttimeoutlen', 'ttimeoutlen'), ('ttm', 'ttm'), ('tty', 'tty'), ('ttybuiltin', 'ttybuiltin'), ('ttyfast', 'ttyfast'), ('ttym', 'ttym'), ('ttymouse', 'ttymouse'), ('ttyscroll', 'ttyscroll'), ('ttytype', 'ttytype'), ('tw', 'tw'), ('tx', 'tx'), ('uc', 'uc'), ('ul', 'ul'), ('undolevels', 'undolevels'), ('updatecount', 'updatecount'), ('updatetime', 'updatetime'), ('ut', 'ut'), ('vb', 'vb'), ('vbs', 'vbs'), ('vdir', 'vdir'), ('ve', 've'), ('verbose', 'verbose'), ('verbosefile', 'verbosefile'), ('vfile', 'vfile'), ('vi', 'vi'), ('viewdir', 'viewdir'), ('viewoptions', 'viewoptions'), ('viminfo', 'viminfo'), ('virtualedit', 'virtualedit'), ('visualbell', 'visualbell'), ('vop', 'vop'), ('wa', 'wa'), ('wak', 'wak'), ('warn', 'warn'), ('wb', 'wb'), ('wc', 'wc'), ('wcm', 'wcm'), ('wd', 'wd'), ('weirdinvert', 'weirdinvert'), ('wfh', 'wfh'), ('wfw', 'wfw'), ('wh', 'wh'), ('whichwrap', 'whichwrap'), ('wi', 'wi'), ('wig', 'wig'), ('wildchar', 'wildchar'), ('wildcharm', 'wildcharm'), ('wildignore', 'wildignore'), ('wildmenu', 'wildmenu'), ('wildmode', 'wildmode'), ('wildoptions', 'wildoptions'), ('wim', 'wim'), ('winaltkeys', 'winaltkeys'), ('window', 'window'), ('winfixheight', 'winfixheight'), ('winfixwidth', 'winfixwidth'), ('winheight', 'winheight'), ('winminheight', 'winminheight'), ('winminwidth', 'winminwidth'), ('winwidth', 'winwidth'), ('wiv', 'wiv'), ('wiw', 'wiw'), ('wm', 'wm'), ('wmh', 'wmh'), ('wmnu', 'wmnu'), ('wmw', 'wmw'), ('wop', 'wop'), ('wrap', 'wrap'), ('wrapmargin', 'wrapmargin'), ('wrapscan', 'wrapscan'), ('write', 'write'), ('writeany', 'writeany'), ('writebackup', 'writebackup'), ('writedelay', 'writedelay'), ('ws', 'ws'), ('ww', 'ww')]
+auto=[('BufAdd','BufAdd'),('BufCreate','BufCreate'),('BufDelete','BufDelete'),('BufEnter','BufEnter'),('BufFilePost','BufFilePost'),('BufFilePre','BufFilePre'),('BufHidden','BufHidden'),('BufLeave','BufLeave'),('BufNew','BufNew'),('BufNewFile','BufNewFile'),('BufRead','BufRead'),('BufReadCmd','BufReadCmd'),('BufReadPost','BufReadPost'),('BufReadPre','BufReadPre'),('BufUnload','BufUnload'),('BufWinEnter','BufWinEnter'),('BufWinLeave','BufWinLeave'),('BufWipeout','BufWipeout'),('BufWrite','BufWrite'),('BufWriteCmd','BufWriteCmd'),('BufWritePost','BufWritePost'),('BufWritePre','BufWritePre'),('Cmd','Cmd'),('CmdwinEnter','CmdwinEnter'),('CmdwinLeave','CmdwinLeave'),('ColorScheme','ColorScheme'),('CursorHold','CursorHold'),('CursorHoldI','CursorHoldI'),('CursorMoved','CursorMoved'),('CursorMovedI','CursorMovedI'),('EncodingChanged','EncodingChanged'),('FileAppendCmd','FileAppendCmd'),('FileAppendPost','FileAppendPost'),('FileAppendPre','FileAppendPre'),('FileChangedRO','FileChangedRO'),('FileChangedShell','FileChangedShell'),('FileChangedShellPost','FileChangedShellPost'),('FileEncoding','FileEncoding'),('FileReadCmd','FileReadCmd'),('FileReadPost','FileReadPost'),('FileReadPre','FileReadPre'),('FileType','FileType'),('FileWriteCmd','FileWriteCmd'),('FileWritePost','FileWritePost'),('FileWritePre','FileWritePre'),('FilterReadPost','FilterReadPost'),('FilterReadPre','FilterReadPre'),('FilterWritePost','FilterWritePost'),('FilterWritePre','FilterWritePre'),('FocusGained','FocusGained'),('FocusLost','FocusLost'),('FuncUndefined','FuncUndefined'),('GUIEnter','GUIEnter'),('GUIFailed','GUIFailed'),('InsertChange','InsertChange'),('InsertCharPre','InsertCharPre'),('InsertEnter','InsertEnter'),('InsertLeave','InsertLeave'),('MenuPopup','MenuPopup'),('QuickFixCmdPost','QuickFixCmdPost'),('QuickFixCmdPre','QuickFixCmdPre'),('RemoteReply','RemoteReply'),('SessionLoadPost','SessionLoadPost'),('ShellCmdPost','ShellCmdPost'),('ShellFilterPost','ShellFilterPost'),('SourceCmd','SourceCmd'),('SourcePre','SourcePre'),('SpellFileMissing','SpellFileMissing'),('StdinReadPost','StdinReadPost'),('StdinReadPre','StdinReadPre'),('SwapExists','SwapExists'),('Syntax','Syntax'),('TabEnter','TabEnter'),('TabLeave','TabLeave'),('TermChanged','TermChanged'),('TermResponse','TermResponse'),('User','User'),('UserGettingBored','UserGettingBored'),('VimEnter','VimEnter'),('VimLeave','VimLeave'),('VimLeavePre','VimLeavePre'),('VimResized','VimResized'),('WinEnter','WinEnter'),('WinLeave','WinLeave'),('event','event')]
+command=[('Allargs','Allargs'),('DiffOrig','DiffOrig'),('Error','Error'),('Man','Man'),('MyCommand','MyCommand'),('Mycmd','Mycmd'),('N','N'),('N','Next'),('P','P'),('P','Print'),('Ren','Ren'),('Rena','Rena'),('Renu','Renu'),('TOhtml','TOhtml'),('X','X'),('XMLent','XMLent'),('XMLns','XMLns'),('a','a'),('ab','ab'),('abc','abclear'),('abo','aboveleft'),('al','all'),('ar','ar'),('ar','args'),('arga','argadd'),('argd','argdelete'),('argdo','argdo'),('arge','argedit'),('argg','argglobal'),('argl','arglocal'),('argu','argument'),('as','ascii'),('au','au'),('b','buffer'),('bN','bNext'),('ba','ball'),('bad','badd'),('bar','bar'),('bd','bdelete'),('bel','belowright'),('bf','bfirst'),('bl','blast'),('bm','bmodified'),('bn','bnext'),('bo','botright'),('bp','bprevious'),('br','br'),('br','brewind'),('brea','break'),('breaka','breakadd'),('breakd','breakdel'),('breakl','breaklist'),('bro','browse'),('browseset','browseset'),('bu','bu'),('buf','buf'),('bufdo','bufdo'),('buffers','buffers'),('bun','bunload'),('bw','bwipeout'),('c','c'),('c','change'),('cN','cN'),('cN','cNext'),('cNf','cNf'),('cNf','cNfile'),('cabc','cabclear'),('cad','cad'),('cad','caddexpr'),('caddb','caddbuffer'),('caddf','caddfile'),('cal','call'),('cat','catch'),('cb','cbuffer'),('cc','cc'),('ccl','cclose'),('cd','cd'),('ce','center'),('cex','cexpr'),('cf','cfile'),('cfir','cfirst'),('cg','cgetfile'),('cgetb','cgetbuffer'),('cgete','cgetexpr'),('changes','changes'),('chd','chdir'),('che','checkpath'),('checkt','checktime'),('cl','cl'),('cl','clist'),('cla','clast'),('clo','close'),('cmapc','cmapclear'),('cmdname','cmdname'),('cn','cn'),('cn','cnext'),('cnew','cnewer'),('cnf','cnf'),('cnf','cnfile'),('co','copy'),('col','colder'),('colo','colorscheme'),('com','com'),('comc','comclear'),('comment','comment'),('comp','compiler'),('con','con'),('con','continue'),('conf','confirm'),('cope','copen'),('count','count'),('cp','cprevious'),('cpf','cpfile'),('cq','cquit'),('cr','crewind'),('cs','cs'),('cscope','cscope'),('cstag','cstag'),('cuna','cunabbrev'),('cw','cwindow'),('d','d'),('d','delete'),('de','de'),('debug','debug'),('debugg','debuggreedy'),('del','del'),('delc','delcommand'),('delf','delf'),('delf','delfunction'),('delm','delmarks'),('di','di'),('di','display'),('diffg','diffget'),('diffo','diffo'),('diffoff','diffoff'),('diffp','diffp'),('diffpatch','diffpatch'),('diffpu','diffput'),('diffsplit','diffsplit'),('difft','difft'),('diffthis','diffthis'),('diffu','diffupdate'),('dig','dig'),('dig','digraphs'),('dj','djump'),('dl','dlist'),('do','do'),('doau','doau'),('dr','drop'),('ds','dsearch'),('dsp','dsplit'),('dwim','dwim'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','e'),('e','edit'),('ea','ea'),('earlier','earlier'),('ec','ec'),('echoe','echoerr'),('echom','echomsg'),('echon','echon'),('el','else'),('elsei','elseif'),('em','emenu'),('emenu','emenu'),('en','en'),('en','endif'),('endf','endf'),('endf','endfunction'),('endfo','endfor'),('endfun','endfun'),('endt','endtry'),('endw','endwhile'),('ene','enew'),('ex','ex'),('exi','exit'),('exu','exusage'),('f','f'),('f','file'),('filename','filename'),('files','files'),('filet','filet'),('filetype','filetype'),('fin','fin'),('fin','find'),('fina','finally'),('fini','finish'),('fir','first'),('fix','fixdel'),('fo','fold'),('foldc','foldclose'),('foldd','folddoopen'),('folddoc','folddoclosed'),('foldo','foldopen'),('for','for'),('fu','fu'),('fu','function'),('fun','fun'),('g','g'),('get','get'),('go','goto'),('gr','grep'),('grepa','grepadd'),('gs','gs'),('gs','gs'),('gui','gui'),('gvim','gvim'),('h','h'),('h','h'),('h','h'),('h','h'),('h','help'),('ha','hardcopy'),('helpf','helpfind'),('helpg','helpgrep'),('helpt','helptags'),('hi','hi'),('hid','hide'),('his','history'),('i','i'),('ia','ia'),('iabc','iabclear'),('if','if'),('ij','ijump'),('il','ilist'),('imapc','imapclear'),('in','in'),('index','index'),('intro','intro'),('is','isearch'),('isp','isplit'),('iuna','iunabbrev'),('j','join'),('ju','jumps'),('k','k'),('kee','keepmarks'),('keepa','keepa'),('keepalt','keepalt'),('keepj','keepjumps'),('l','l'),('l','list'),('lN','lN'),('lN','lNext'),('lNf','lNf'),('lNf','lNfile'),('la','la'),('la','last'),('lad','lad'),('lad','laddexpr'),('laddb','laddbuffer'),('laddf','laddfile'),('lan','lan'),('lan','language'),('lat','lat'),('later','later'),('lb','lbuffer'),('lc','lcd'),('lch','lchdir'),('lcl','lclose'),('lcs','lcs'),('lcscope','lcscope'),('le','left'),('lefta','leftabove'),('let','let'),('lex','lexpr'),('lf','lfile'),('lfir','lfirst'),('lg','lgetfile'),('lgetb','lgetbuffer'),('lgete','lgetexpr'),('lgr','lgrep'),('lgrepa','lgrepadd'),('lh','lhelpgrep'),('ll','ll'),('lla','llast'),('lli','llist'),('lmak','lmake'),('lmapc','lmapclear'),('lne','lne'),('lne','lnext'),('lnew','lnewer'),('lnf','lnf'),('lnf','lnfile'),('lo','lo'),('lo','loadview'),('loadk','loadk'),('loadkeymap','loadkeymap'),('loc','lockmarks'),('locale','locale'),('lockv','lockvar'),('lol','lolder'),('lop','lopen'),('lp','lprevious'),('lpf','lpfile'),('lr','lrewind'),('ls','ls'),('lt','ltag'),('lua','lua'),('luado','luado'),('luafile','luafile'),('lv','lvimgrep'),('lvimgrepa','lvimgrepadd'),('lw','lwindow'),('m','move'),('ma','ma'),('ma','mark'),('main','main'),('main','main'),('mak','make'),('marks','marks'),('mat','match'),('menut','menut'),('menut','menutranslate'),('mes','mes'),('messages','messages'),('mk','mk'),('mk','mkexrc'),('mkdir','mkdir'),('mks','mksession'),('mksp','mkspell'),('mkv','mkv'),('mkv','mkvimrc'),('mkvie','mkview'),('mo','mo'),('mod','mode'),('mv','mv'),('mz','mz'),('mz','mzscheme'),('mzf','mzfile'),('n','n'),('n','n'),('n','next'),('nb','nbkey'),('nbc','nbclose'),('nbs','nbstart'),('ne','ne'),('new','new'),('nkf','nkf'),('nmapc','nmapclear'),('noa','noa'),('noautocmd','noautocmd'),('noh','nohlsearch'),('nu','number'),('o','o'),('o','open'),('ol','oldfiles'),('omapc','omapclear'),('on','only'),('opt','options'),('ownsyntax','ownsyntax'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','p'),('p','print'),('pat','pat'),('pat','pat'),('pc','pclose'),('pe','pe'),('pe','perl'),('ped','pedit'),('perld','perldo'),('po','pop'),('popu','popu'),('popu','popup'),('pp','ppop'),('pr','pr'),('pre','preserve'),('prev','previous'),('pro','pro'),('prof','profile'),('profd','profdel'),('promptf','promptfind'),('promptr','promptrepl'),('ps','psearch'),('ptN','ptN'),('ptN','ptNext'),('pta','ptag'),('ptf','ptfirst'),('ptj','ptjump'),('ptl','ptlast'),('ptn','ptn'),('ptn','ptnext'),('ptp','ptprevious'),('ptr','ptrewind'),('pts','ptselect'),('pu','put'),('pw','pwd'),('py','py'),('py','python'),('py3','py3'),('py3','py3'),('py3file','py3file'),('pyf','pyfile'),('python3','python3'),('q','q'),('q','quit'),('qa','qall'),('quita','quitall'),('quote','quote'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','r'),('r','read'),('re','re'),('rec','recover'),('red','red'),('red','redo'),('redi','redir'),('redr','redraw'),('redraws','redrawstatus'),('reg','registers'),('res','resize'),('ret','retab'),('retu','return'),('rew','rewind'),('ri','right'),('rightb','rightbelow'),('ru','ru'),('ru','runtime'),('rub','ruby'),('rubyd','rubydo'),('rubyf','rubyfile'),('rundo','rundo'),('rv','rviminfo'),('s','s'),('s','s'),('s','s'),('s','s'),('sN','sNext'),('sa','sargument'),('sal','sall'),('san','sandbox'),('sav','saveas'),('sb','sbuffer'),('sbN','sbNext'),('sba','sball'),('sbf','sbfirst'),('sbl','sblast'),('sbm','sbmodified'),('sbn','sbnext'),('sbp','sbprevious'),('sbr','sbrewind'),('scrip','scrip'),('scrip','scriptnames'),('scripte','scriptencoding'),('scs','scs'),('scscope','scscope'),('se','set'),('setf','setfiletype'),('setg','setglobal'),('setl','setlocal'),('sf','sfind'),('sfir','sfirst'),('sh','shell'),('si','si'),('sig','sig'),('sign','sign'),('sil','silent'),('sim','simalt'),('sl','sl'),('sl','sleep'),('sla','slast'),('sm','smagic'),('sm','smap'),('sme','sme'),('smenu','smenu'),('sn','snext'),('sni','sniff'),('sno','snomagic'),('snoreme','snoreme'),('snoremenu','snoremenu'),('so','so'),('so','source'),('sor','sort'),('sp','split'),('spe','spe'),('spe','spellgood'),('spelld','spelldump'),('spelli','spellinfo'),('spellr','spellrepall'),('spellu','spellundo'),('spellw','spellwrong'),('spr','sprevious'),('sre','srewind'),('st','st'),('st','stop'),('sta','stag'),('star','star'),('star','startinsert'),('start','start'),('startg','startgreplace'),('startr','startreplace'),('stj','stjump'),('stopi','stopinsert'),('sts','stselect'),('sub','sub'),('sub','sub'),('sun','sunhide'),('sunme','sunme'),('sunmenu','sunmenu'),('sus','suspend'),('sv','sview'),('sw','swapname'),('sy','sy'),('syn','syn'),('sync','sync'),('syncbind','syncbind'),('synlist','synlist'),('t','t'),('t','t'),('t','t'),('tN','tN'),('tN','tNext'),('ta','ta'),('ta','tag'),('tab','tab'),('tabN','tabN'),('tabN','tabNext'),('tabc','tabclose'),('tabd','tabdo'),('tabe','tabedit'),('tabf','tabfind'),('tabfir','tabfirst'),('tabl','tablast'),('tabm','tabmove'),('tabn','tabnext'),('tabnew','tabnew'),('tabo','tabonly'),('tabp','tabprevious'),('tabr','tabrewind'),('tabs','tabs'),('tags','tags'),('tc','tcl'),('tcld','tcldo'),('tclf','tclfile'),('te','tearoff'),('tf','tfirst'),('th','throw'),('tj','tjump'),('tl','tlast'),('tm','tm'),('tm','tmenu'),('tn','tn'),('tn','tnext'),('to','topleft'),('tp','tprevious'),('tr','tr'),('tr','trewind'),('try','try'),('ts','tselect'),('tu','tu'),('tu','tunmenu'),('u','u'),('u','undo'),('un','un'),('una','unabbreviate'),('undoj','undojoin'),('undol','undolist'),('unh','unhide'),('unl','unl'),('unlo','unlockvar'),('uns','unsilent'),('up','update'),('v','v'),('ve','ve'),('ve','version'),('verb','verbose'),('version','version'),('version','version'),('vert','vertical'),('vi','vi'),('vi','visual'),('vie','view'),('vim','vimgrep'),('vimgrepa','vimgrepadd'),('viu','viusage'),('vmapc','vmapclear'),('vne','vnew'),('vs','vsplit'),('w','w'),('w','write'),('wN','wNext'),('wa','wall'),('wh','while'),('win','win'),('win','winsize'),('winc','wincmd'),('windo','windo'),('winp','winpos'),('wn','wnext'),('wp','wprevious'),('wq','wq'),('wqa','wqall'),('ws','wsverb'),('wundo','wundo'),('wv','wviminfo'),('x','x'),('x','xit'),('xa','xall'),('xmapc','xmapclear'),('xme','xme'),('xmenu','xmenu'),('xnoreme','xnoreme'),('xnoremenu','xnoremenu'),('xterm','xterm'),('xunme','xunme'),('xunmenu','xunmenu'),('xwininfo','xwininfo'),('y','yank')]
+option=[('acd','acd'),('ai','ai'),('akm','akm'),('al','al'),('aleph','aleph'),('allowrevins','allowrevins'),('altkeymap','altkeymap'),('ambiwidth','ambiwidth'),('ambw','ambw'),('anti','anti'),('antialias','antialias'),('ar','ar'),('arab','arab'),('arabic','arabic'),('arabicshape','arabicshape'),('ari','ari'),('arshape','arshape'),('autochdir','autochdir'),('autoindent','autoindent'),('autoread','autoread'),('autowrite','autowrite'),('autowriteall','autowriteall'),('aw','aw'),('awa','awa'),('background','background'),('backspace','backspace'),('backup','backup'),('backupcopy','backupcopy'),('backupdir','backupdir'),('backupext','backupext'),('backupskip','backupskip'),('balloondelay','balloondelay'),('ballooneval','ballooneval'),('balloonexpr','balloonexpr'),('bdir','bdir'),('bdlay','bdlay'),('beval','beval'),('bex','bex'),('bexpr','bexpr'),('bg','bg'),('bh','bh'),('bin','bin'),('binary','binary'),('biosk','biosk'),('bioskey','bioskey'),('bk','bk'),('bkc','bkc'),('bl','bl'),('bomb','bomb'),('breakat','breakat'),('brk','brk'),('browsedir','browsedir'),('bs','bs'),('bsdir','bsdir'),('bsk','bsk'),('bt','bt'),('bufhidden','bufhidden'),('buflisted','buflisted'),('buftype','buftype'),('casemap','casemap'),('cb','cb'),('cc','cc'),('ccv','ccv'),('cd','cd'),('cdpath','cdpath'),('cedit','cedit'),('cf','cf'),('cfu','cfu'),('ch','ch'),('charconvert','charconvert'),('ci','ci'),('cin','cin'),('cindent','cindent'),('cink','cink'),('cinkeys','cinkeys'),('cino','cino'),('cinoptions','cinoptions'),('cinw','cinw'),('cinwords','cinwords'),('clipboard','clipboard'),('cmdheight','cmdheight'),('cmdwinheight','cmdwinheight'),('cmp','cmp'),('cms','cms'),('co','co'),('cocu','cocu'),('cole','cole'),('colorcolumn','colorcolumn'),('columns','columns'),('com','com'),('comments','comments'),('commentstring','commentstring'),('compatible','compatible'),('complete','complete'),('completefunc','completefunc'),('completeopt','completeopt'),('concealcursor','concealcursor'),('conceallevel','conceallevel'),('confirm','confirm'),('consk','consk'),('conskey','conskey'),('copyindent','copyindent'),('cot','cot'),('cp','cp'),('cpo','cpo'),('cpoptions','cpoptions'),('cpt','cpt'),('crb','crb'),('cryptmethod','cryptmethod'),('cscopepathcomp','cscopepathcomp'),('cscopeprg','cscopeprg'),('cscopequickfix','cscopequickfix'),('cscoperelative','cscoperelative'),('cscopetag','cscopetag'),('cscopetagorder','cscopetagorder'),('cscopeverbose','cscopeverbose'),('cspc','cspc'),('csprg','csprg'),('csqf','csqf'),('csre','csre'),('cst','cst'),('csto','csto'),('csverb','csverb'),('cuc','cuc'),('cul','cul'),('cursorbind','cursorbind'),('cursorcolumn','cursorcolumn'),('cursorline','cursorline'),('cwh','cwh'),('debug','debug'),('deco','deco'),('def','def'),('define','define'),('delcombine','delcombine'),('dex','dex'),('dg','dg'),('dict','dict'),('dictionary','dictionary'),('diff','diff'),('diffexpr','diffexpr'),('diffopt','diffopt'),('digraph','digraph'),('dip','dip'),('dir','dir'),('directory','directory'),('display','display'),('dy','dy'),('ea','ea'),('ead','ead'),('eadirection','eadirection'),('eb','eb'),('ed','ed'),('edcompatible','edcompatible'),('ef','ef'),('efm','efm'),('ei','ei'),('ek','ek'),('enc','enc'),('encoding','encoding'),('endofline','endofline'),('eol','eol'),('ep','ep'),('equalalways','equalalways'),('equalprg','equalprg'),('errorbells','errorbells'),('errorfile','errorfile'),('errorformat','errorformat'),('esckeys','esckeys'),('et','et'),('eventignore','eventignore'),('ex','ex'),('expandtab','expandtab'),('exrc','exrc'),('fcl','fcl'),('fcs','fcs'),('fdc','fdc'),('fde','fde'),('fdi','fdi'),('fdl','fdl'),('fdls','fdls'),('fdm','fdm'),('fdn','fdn'),('fdo','fdo'),('fdt','fdt'),('fen','fen'),('fenc','fenc'),('fencs','fencs'),('fex','fex'),('ff','ff'),('ffs','ffs'),('fileencoding','fileencoding'),('fileencodings','fileencodings'),('fileformat','fileformat'),('fileformats','fileformats'),('filetype','filetype'),('fillchars','fillchars'),('fk','fk'),('fkmap','fkmap'),('flp','flp'),('fml','fml'),('fmr','fmr'),('fo','fo'),('foldclose','foldclose'),('foldcolumn','foldcolumn'),('foldenable','foldenable'),('foldexpr','foldexpr'),('foldignore','foldignore'),('foldlevel','foldlevel'),('foldlevelstart','foldlevelstart'),('foldmarker','foldmarker'),('foldmethod','foldmethod'),('foldminlines','foldminlines'),('foldnestmax','foldnestmax'),('foldopen','foldopen'),('foldtext','foldtext'),('formatexpr','formatexpr'),('formatlistpat','formatlistpat'),('formatoptions','formatoptions'),('formatprg','formatprg'),('fp','fp'),('fs','fs'),('fsync','fsync'),('ft','ft'),('gcr','gcr'),('gd','gd'),('gdefault','gdefault'),('gfm','gfm'),('gfn','gfn'),('gfs','gfs'),('gfw','gfw'),('ghr','ghr'),('go','go'),('gp','gp'),('grepformat','grepformat'),('grepprg','grepprg'),('gtl','gtl'),('gtt','gtt'),('guicursor','guicursor'),('guifont','guifont'),('guifontset','guifontset'),('guifontwide','guifontwide'),('guiheadroom','guiheadroom'),('guioptions','guioptions'),('guipty','guipty'),('guitablabel','guitablabel'),('guitabtooltip','guitabtooltip'),('helpfile','helpfile'),('helpheight','helpheight'),('helplang','helplang'),('hf','hf'),('hh','hh'),('hi','hi'),('hid','hid'),('hidden','hidden'),('highlight','highlight'),('history','history'),('hk','hk'),('hkmap','hkmap'),('hkmapp','hkmapp'),('hkp','hkp'),('hl','hl'),('hlg','hlg'),('hls','hls'),('hlsearch','hlsearch'),('ic','ic'),('icon','icon'),('iconstring','iconstring'),('ignorecase','ignorecase'),('im','im'),('imactivatekey','imactivatekey'),('imak','imak'),('imc','imc'),('imcmdline','imcmdline'),('imd','imd'),('imdisable','imdisable'),('imi','imi'),('iminsert','iminsert'),('ims','ims'),('imsearch','imsearch'),('inc','inc'),('include','include'),('includeexpr','includeexpr'),('incsearch','incsearch'),('inde','inde'),('indentexpr','indentexpr'),('indentkeys','indentkeys'),('indk','indk'),('inex','inex'),('inf','inf'),('infercase','infercase'),('inoremap','inoremap'),('insertmode','insertmode'),('invacd','invacd'),('invai','invai'),('invakm','invakm'),('invallowrevins','invallowrevins'),('invaltkeymap','invaltkeymap'),('invanti','invanti'),('invantialias','invantialias'),('invar','invar'),('invarab','invarab'),('invarabic','invarabic'),('invarabicshape','invarabicshape'),('invari','invari'),('invarshape','invarshape'),('invautochdir','invautochdir'),('invautoindent','invautoindent'),('invautoread','invautoread'),('invautowrite','invautowrite'),('invautowriteall','invautowriteall'),('invaw','invaw'),('invawa','invawa'),('invbackup','invbackup'),('invballooneval','invballooneval'),('invbeval','invbeval'),('invbin','invbin'),('invbinary','invbinary'),('invbiosk','invbiosk'),('invbioskey','invbioskey'),('invbk','invbk'),('invbl','invbl'),('invbomb','invbomb'),('invbuflisted','invbuflisted'),('invcf','invcf'),('invci','invci'),('invcin','invcin'),('invcindent','invcindent'),('invcompatible','invcompatible'),('invconfirm','invconfirm'),('invconsk','invconsk'),('invconskey','invconskey'),('invcopyindent','invcopyindent'),('invcp','invcp'),('invcrb','invcrb'),('invcscopetag','invcscopetag'),('invcscopeverbose','invcscopeverbose'),('invcst','invcst'),('invcsverb','invcsverb'),('invcuc','invcuc'),('invcul','invcul'),('invcursorbind','invcursorbind'),('invcursorcolumn','invcursorcolumn'),('invcursorline','invcursorline'),('invdeco','invdeco'),('invdelcombine','invdelcombine'),('invdg','invdg'),('invdiff','invdiff'),('invdigraph','invdigraph'),('invea','invea'),('inveb','inveb'),('inved','inved'),('invedcompatible','invedcompatible'),('invek','invek'),('invendofline','invendofline'),('inveol','inveol'),('invequalalways','invequalalways'),('inverrorbells','inverrorbells'),('invesckeys','invesckeys'),('invet','invet'),('invex','invex'),('invexpandtab','invexpandtab'),('invexrc','invexrc'),('invfen','invfen'),('invfk','invfk'),('invfkmap','invfkmap'),('invfoldenable','invfoldenable'),('invgd','invgd'),('invgdefault','invgdefault'),('invguipty','invguipty'),('invhid','invhid'),('invhidden','invhidden'),('invhk','invhk'),('invhkmap','invhkmap'),('invhkmapp','invhkmapp'),('invhkp','invhkp'),('invhls','invhls'),('invhlsearch','invhlsearch'),('invic','invic'),('invicon','invicon'),('invignorecase','invignorecase'),('invim','invim'),('invimc','invimc'),('invimcmdline','invimcmdline'),('invimd','invimd'),('invimdisable','invimdisable'),('invincsearch','invincsearch'),('invinf','invinf'),('invinfercase','invinfercase'),('invinsertmode','invinsertmode'),('invis','invis'),('invjoinspaces','invjoinspaces'),('invjs','invjs'),('invlazyredraw','invlazyredraw'),('invlbr','invlbr'),('invlinebreak','invlinebreak'),('invlisp','invlisp'),('invlist','invlist'),('invloadplugins','invloadplugins'),('invlpl','invlpl'),('invlz','invlz'),('invma','invma'),('invmacatsui','invmacatsui'),('invmagic','invmagic'),('invmh','invmh'),('invml','invml'),('invmod','invmod'),('invmodeline','invmodeline'),('invmodifiable','invmodifiable'),('invmodified','invmodified'),('invmore','invmore'),('invmousef','invmousef'),('invmousefocus','invmousefocus'),('invmousehide','invmousehide'),('invnu','invnu'),('invnumber','invnumber'),('invodev','invodev'),('invopendevice','invopendevice'),('invpaste','invpaste'),('invpi','invpi'),('invpreserveindent','invpreserveindent'),('invpreviewwindow','invpreviewwindow'),('invprompt','invprompt'),('invpvw','invpvw'),('invreadonly','invreadonly'),('invrelativenumber','invrelativenumber'),('invremap','invremap'),('invrestorescreen','invrestorescreen'),('invrevins','invrevins'),('invri','invri'),('invrightleft','invrightleft'),('invrl','invrl'),('invrnu','invrnu'),('invro','invro'),('invrs','invrs'),('invru','invru'),('invruler','invruler'),('invsb','invsb'),('invsc','invsc'),('invscb','invscb'),('invscrollbind','invscrollbind'),('invscs','invscs'),('invsecure','invsecure'),('invsft','invsft'),('invshellslash','invshellslash'),('invshelltemp','invshelltemp'),('invshiftround','invshiftround'),('invshortname','invshortname'),('invshowcmd','invshowcmd'),('invshowfulltag','invshowfulltag'),('invshowmatch','invshowmatch'),('invshowmode','invshowmode'),('invsi','invsi'),('invsm','invsm'),('invsmartcase','invsmartcase'),('invsmartindent','invsmartindent'),('invsmarttab','invsmarttab'),('invsmd','invsmd'),('invsn','invsn'),('invsol','invsol'),('invspell','invspell'),('invsplitbelow','invsplitbelow'),('invsplitright','invsplitright'),('invspr','invspr'),('invsr','invsr'),('invssl','invssl'),('invsta','invsta'),('invstartofline','invstartofline'),('invstmp','invstmp'),('invswapfile','invswapfile'),('invswf','invswf'),('invta','invta'),('invtagbsearch','invtagbsearch'),('invtagrelative','invtagrelative'),('invtagstack','invtagstack'),('invtbi','invtbi'),('invtbidi','invtbidi'),('invtbs','invtbs'),('invtermbidi','invtermbidi'),('invterse','invterse'),('invtextauto','invtextauto'),('invtextmode','invtextmode'),('invtf','invtf'),('invtgst','invtgst'),('invtildeop','invtildeop'),('invtimeout','invtimeout'),('invtitle','invtitle'),('invto','invto'),('invtop','invtop'),('invtr','invtr'),('invttimeout','invttimeout'),('invttybuiltin','invttybuiltin'),('invttyfast','invttyfast'),('invtx','invtx'),('invvb','invvb'),('invvisualbell','invvisualbell'),('invwa','invwa'),('invwarn','invwarn'),('invwb','invwb'),('invweirdinvert','invweirdinvert'),('invwfh','invwfh'),('invwfw','invwfw'),('invwildignorecase','invwildignorecase'),('invwildmenu','invwildmenu'),('invwinfixheight','invwinfixheight'),('invwinfixwidth','invwinfixwidth'),('invwiv','invwiv'),('invwmnu','invwmnu'),('invwrap','invwrap'),('invwrapscan','invwrapscan'),('invwrite','invwrite'),('invwriteany','invwriteany'),('invwritebackup','invwritebackup'),('invws','invws'),('is','is'),('isf','isf'),('isfname','isfname'),('isi','isi'),('isident','isident'),('isk','isk'),('iskeyword','iskeyword'),('isp','isp'),('isprint','isprint'),('joinspaces','joinspaces'),('js','js'),('key','key'),('keymap','keymap'),('keymodel','keymodel'),('keywordprg','keywordprg'),('km','km'),('kmp','kmp'),('kp','kp'),('langmap','langmap'),('langmenu','langmenu'),('laststatus','laststatus'),('lazyredraw','lazyredraw'),('lbr','lbr'),('lcs','lcs'),('linebreak','linebreak'),('lines','lines'),('linespace','linespace'),('lisp','lisp'),('lispwords','lispwords'),('list','list'),('listchars','listchars'),('lm','lm'),('lmap','lmap'),('loadplugins','loadplugins'),('lpl','lpl'),('ls','ls'),('lsp','lsp'),('lw','lw'),('lz','lz'),('ma','ma'),('macatsui','macatsui'),('magic','magic'),('makeef','makeef'),('makeprg','makeprg'),('mat','mat'),('matchpairs','matchpairs'),('matchtime','matchtime'),('maxcombine','maxcombine'),('maxfuncdepth','maxfuncdepth'),('maxmapdepth','maxmapdepth'),('maxmem','maxmem'),('maxmempattern','maxmempattern'),('maxmemtot','maxmemtot'),('mco','mco'),('mef','mef'),('menuitems','menuitems'),('mfd','mfd'),('mh','mh'),('mis','mis'),('mkspellmem','mkspellmem'),('ml','ml'),('mls','mls'),('mm','mm'),('mmd','mmd'),('mmp','mmp'),('mmt','mmt'),('mod','mod'),('modeline','modeline'),('modelines','modelines'),('modifiable','modifiable'),('modified','modified'),('more','more'),('mouse','mouse'),('mousef','mousef'),('mousefocus','mousefocus'),('mousehide','mousehide'),('mousem','mousem'),('mousemodel','mousemodel'),('mouses','mouses'),('mouseshape','mouseshape'),('mouset','mouset'),('mousetime','mousetime'),('mp','mp'),('mps','mps'),('msm','msm'),('mzq','mzq'),('mzquantum','mzquantum'),('nf','nf'),('nnoremap','nnoremap'),('noacd','noacd'),('noai','noai'),('noakm','noakm'),('noallowrevins','noallowrevins'),('noaltkeymap','noaltkeymap'),('noanti','noanti'),('noantialias','noantialias'),('noar','noar'),('noarab','noarab'),('noarabic','noarabic'),('noarabicshape','noarabicshape'),('noari','noari'),('noarshape','noarshape'),('noautochdir','noautochdir'),('noautoindent','noautoindent'),('noautoread','noautoread'),('noautowrite','noautowrite'),('noautowriteall','noautowriteall'),('noaw','noaw'),('noawa','noawa'),('nobackup','nobackup'),('noballooneval','noballooneval'),('nobeval','nobeval'),('nobin','nobin'),('nobinary','nobinary'),('nobiosk','nobiosk'),('nobioskey','nobioskey'),('nobk','nobk'),('nobl','nobl'),('nobomb','nobomb'),('nobuflisted','nobuflisted'),('nocf','nocf'),('noci','noci'),('nocin','nocin'),('nocindent','nocindent'),('nocompatible','nocompatible'),('noconfirm','noconfirm'),('noconsk','noconsk'),('noconskey','noconskey'),('nocopyindent','nocopyindent'),('nocp','nocp'),('nocrb','nocrb'),('nocscopetag','nocscopetag'),('nocscopeverbose','nocscopeverbose'),('nocst','nocst'),('nocsverb','nocsverb'),('nocuc','nocuc'),('nocul','nocul'),('nocursorbind','nocursorbind'),('nocursorcolumn','nocursorcolumn'),('nocursorline','nocursorline'),('nodeco','nodeco'),('nodelcombine','nodelcombine'),('nodg','nodg'),('nodiff','nodiff'),('nodigraph','nodigraph'),('noea','noea'),('noeb','noeb'),('noed','noed'),('noedcompatible','noedcompatible'),('noek','noek'),('noendofline','noendofline'),('noeol','noeol'),('noequalalways','noequalalways'),('noerrorbells','noerrorbells'),('noesckeys','noesckeys'),('noet','noet'),('noex','noex'),('noexpandtab','noexpandtab'),('noexrc','noexrc'),('nofen','nofen'),('nofk','nofk'),('nofkmap','nofkmap'),('nofoldenable','nofoldenable'),('nogd','nogd'),('nogdefault','nogdefault'),('noguipty','noguipty'),('nohid','nohid'),('nohidden','nohidden'),('nohk','nohk'),('nohkmap','nohkmap'),('nohkmapp','nohkmapp'),('nohkp','nohkp'),('nohls','nohls'),('nohlsearch','nohlsearch'),('noic','noic'),('noicon','noicon'),('noignorecase','noignorecase'),('noim','noim'),('noimc','noimc'),('noimcmdline','noimcmdline'),('noimd','noimd'),('noimdisable','noimdisable'),('noincsearch','noincsearch'),('noinf','noinf'),('noinfercase','noinfercase'),('noinsertmode','noinsertmode'),('nois','nois'),('nojoinspaces','nojoinspaces'),('nojs','nojs'),('nolazyredraw','nolazyredraw'),('nolbr','nolbr'),('nolinebreak','nolinebreak'),('nolisp','nolisp'),('nolist','nolist'),('noloadplugins','noloadplugins'),('nolpl','nolpl'),('nolz','nolz'),('noma','noma'),('nomacatsui','nomacatsui'),('nomagic','nomagic'),('nomh','nomh'),('noml','noml'),('nomod','nomod'),('nomodeline','nomodeline'),('nomodifiable','nomodifiable'),('nomodified','nomodified'),('nomore','nomore'),('nomousef','nomousef'),('nomousefocus','nomousefocus'),('nomousehide','nomousehide'),('nonu','nonu'),('nonumber','nonumber'),('noodev','noodev'),('noopendevice','noopendevice'),('nopaste','nopaste'),('nopi','nopi'),('nopreserveindent','nopreserveindent'),('nopreviewwindow','nopreviewwindow'),('noprompt','noprompt'),('nopvw','nopvw'),('noreadonly','noreadonly'),('norelativenumber','norelativenumber'),('noremap','noremap'),('norestorescreen','norestorescreen'),('norevins','norevins'),('nori','nori'),('norightleft','norightleft'),('norl','norl'),('nornu','nornu'),('noro','noro'),('nors','nors'),('noru','noru'),('noruler','noruler'),('nosb','nosb'),('nosc','nosc'),('noscb','noscb'),('noscrollbind','noscrollbind'),('noscs','noscs'),('nosecure','nosecure'),('nosft','nosft'),('noshellslash','noshellslash'),('noshelltemp','noshelltemp'),('noshiftround','noshiftround'),('noshortname','noshortname'),('noshowcmd','noshowcmd'),('noshowfulltag','noshowfulltag'),('noshowmatch','noshowmatch'),('noshowmode','noshowmode'),('nosi','nosi'),('nosm','nosm'),('nosmartcase','nosmartcase'),('nosmartindent','nosmartindent'),('nosmarttab','nosmarttab'),('nosmd','nosmd'),('nosn','nosn'),('nosol','nosol'),('nospell','nospell'),('nosplitbelow','nosplitbelow'),('nosplitright','nosplitright'),('nospr','nospr'),('nosr','nosr'),('nossl','nossl'),('nosta','nosta'),('nostartofline','nostartofline'),('nostmp','nostmp'),('noswapfile','noswapfile'),('noswf','noswf'),('nota','nota'),('notagbsearch','notagbsearch'),('notagrelative','notagrelative'),('notagstack','notagstack'),('notbi','notbi'),('notbidi','notbidi'),('notbs','notbs'),('notermbidi','notermbidi'),('noterse','noterse'),('notextauto','notextauto'),('notextmode','notextmode'),('notf','notf'),('notgst','notgst'),('notildeop','notildeop'),('notimeout','notimeout'),('notitle','notitle'),('noto','noto'),('notop','notop'),('notr','notr'),('nottimeout','nottimeout'),('nottybuiltin','nottybuiltin'),('nottyfast','nottyfast'),('notx','notx'),('novb','novb'),('novisualbell','novisualbell'),('nowa','nowa'),('nowarn','nowarn'),('nowb','nowb'),('noweirdinvert','noweirdinvert'),('nowfh','nowfh'),('nowfw','nowfw'),('nowildignorecase','nowildignorecase'),('nowildmenu','nowildmenu'),('nowinfixheight','nowinfixheight'),('nowinfixwidth','nowinfixwidth'),('nowiv','nowiv'),('nowmnu','nowmnu'),('nowrap','nowrap'),('nowrapscan','nowrapscan'),('nowrite','nowrite'),('nowriteany','nowriteany'),('nowritebackup','nowritebackup'),('nows','nows'),('nrformats','nrformats'),('nu','nu'),('number','number'),('numberwidth','numberwidth'),('nuw','nuw'),('odev','odev'),('oft','oft'),('ofu','ofu'),('omnifunc','omnifunc'),('opendevice','opendevice'),('operatorfunc','operatorfunc'),('opfunc','opfunc'),('osfiletype','osfiletype'),('pa','pa'),('para','para'),('paragraphs','paragraphs'),('paste','paste'),('pastetoggle','pastetoggle'),('patchexpr','patchexpr'),('patchmode','patchmode'),('path','path'),('pdev','pdev'),('penc','penc'),('pex','pex'),('pexpr','pexpr'),('pfn','pfn'),('ph','ph'),('pheader','pheader'),('pi','pi'),('pm','pm'),('pmbcs','pmbcs'),('pmbfn','pmbfn'),('popt','popt'),('preserveindent','preserveindent'),('previewheight','previewheight'),('previewwindow','previewwindow'),('printdevice','printdevice'),('printencoding','printencoding'),('printexpr','printexpr'),('printfont','printfont'),('printheader','printheader'),('printmbcharset','printmbcharset'),('printmbfont','printmbfont'),('printoptions','printoptions'),('prompt','prompt'),('pt','pt'),('pumheight','pumheight'),('pvh','pvh'),('pvw','pvw'),('qe','qe'),('quoteescape','quoteescape'),('rdt','rdt'),('readonly','readonly'),('redrawtime','redrawtime'),('relativenumber','relativenumber'),('remap','remap'),('report','report'),('restorescreen','restorescreen'),('revins','revins'),('ri','ri'),('rightleft','rightleft'),('rightleftcmd','rightleftcmd'),('rl','rl'),('rlc','rlc'),('rnu','rnu'),('ro','ro'),('rs','rs'),('rtp','rtp'),('ru','ru'),('ruf','ruf'),('ruler','ruler'),('rulerformat','rulerformat'),('runtimepath','runtimepath'),('sb','sb'),('sbo','sbo'),('sbr','sbr'),('sc','sc'),('scb','scb'),('scr','scr'),('scroll','scroll'),('scrollbind','scrollbind'),('scrolljump','scrolljump'),('scrolloff','scrolloff'),('scrollopt','scrollopt'),('scs','scs'),('sect','sect'),('sections','sections'),('secure','secure'),('sel','sel'),('selection','selection'),('selectmode','selectmode'),('sessionoptions','sessionoptions'),('sft','sft'),('sh','sh'),('shcf','shcf'),('shell','shell'),('shellcmdflag','shellcmdflag'),('shellpipe','shellpipe'),('shellquote','shellquote'),('shellredir','shellredir'),('shellslash','shellslash'),('shelltemp','shelltemp'),('shelltype','shelltype'),('shellxquote','shellxquote'),('shiftround','shiftround'),('shiftwidth','shiftwidth'),('shm','shm'),('shortmess','shortmess'),('shortname','shortname'),('showbreak','showbreak'),('showcmd','showcmd'),('showfulltag','showfulltag'),('showmatch','showmatch'),('showmode','showmode'),('showtabline','showtabline'),('shq','shq'),('si','si'),('sidescroll','sidescroll'),('sidescrolloff','sidescrolloff'),('siso','siso'),('sj','sj'),('slm','slm'),('sm','sm'),('smartcase','smartcase'),('smartindent','smartindent'),('smarttab','smarttab'),('smc','smc'),('smd','smd'),('sn','sn'),('so','so'),('softtabstop','softtabstop'),('sol','sol'),('sp','sp'),('spc','spc'),('spell','spell'),('spellcapcheck','spellcapcheck'),('spellfile','spellfile'),('spelllang','spelllang'),('spellsuggest','spellsuggest'),('spf','spf'),('spl','spl'),('splitbelow','splitbelow'),('splitright','splitright'),('spr','spr'),('sps','sps'),('sr','sr'),('srr','srr'),('ss','ss'),('ssl','ssl'),('ssop','ssop'),('st','st'),('sta','sta'),('stal','stal'),('startofline','startofline'),('statusline','statusline'),('stl','stl'),('stmp','stmp'),('sts','sts'),('su','su'),('sua','sua'),('suffixes','suffixes'),('suffixesadd','suffixesadd'),('sw','sw'),('swapfile','swapfile'),('swapsync','swapsync'),('swb','swb'),('swf','swf'),('switchbuf','switchbuf'),('sws','sws'),('sxq','sxq'),('syn','syn'),('synmaxcol','synmaxcol'),('syntax','syntax'),('t_AB','t_AB'),('t_AF','t_AF'),('t_AL','t_AL'),('t_CS','t_CS'),('t_CV','t_CV'),('t_Ce','t_Ce'),('t_Co','t_Co'),('t_Cs','t_Cs'),('t_DL','t_DL'),('t_EI','t_EI'),('t_F1','t_F1'),('t_F2','t_F2'),('t_F3','t_F3'),('t_F4','t_F4'),('t_F5','t_F5'),('t_F6','t_F6'),('t_F7','t_F7'),('t_F8','t_F8'),('t_F9','t_F9'),('t_IE','t_IE'),('t_IS','t_IS'),('t_K1','t_K1'),('t_K3','t_K3'),('t_K4','t_K4'),('t_K5','t_K5'),('t_K6','t_K6'),('t_K7','t_K7'),('t_K8','t_K8'),('t_K9','t_K9'),('t_KA','t_KA'),('t_KB','t_KB'),('t_KC','t_KC'),('t_KD','t_KD'),('t_KE','t_KE'),('t_KF','t_KF'),('t_KG','t_KG'),('t_KH','t_KH'),('t_KI','t_KI'),('t_KJ','t_KJ'),('t_KK','t_KK'),('t_KL','t_KL'),('t_RI','t_RI'),('t_RV','t_RV'),('t_SI','t_SI'),('t_Sb','t_Sb'),('t_Sf','t_Sf'),('t_WP','t_WP'),('t_WS','t_WS'),('t_ZH','t_ZH'),('t_ZR','t_ZR'),('t_al','t_al'),('t_bc','t_bc'),('t_cd','t_cd'),('t_ce','t_ce'),('t_cl','t_cl'),('t_cm','t_cm'),('t_cs','t_cs'),('t_da','t_da'),('t_db','t_db'),('t_dl','t_dl'),('t_fs','t_fs'),('t_k1','t_k1'),('t_k2','t_k2'),('t_k3','t_k3'),('t_k4','t_k4'),('t_k5','t_k5'),('t_k6','t_k6'),('t_k7','t_k7'),('t_k8','t_k8'),('t_k9','t_k9'),('t_kB','t_kB'),('t_kD','t_kD'),('t_kI','t_kI'),('t_kN','t_kN'),('t_kP','t_kP'),('t_kb','t_kb'),('t_kd','t_kd'),('t_ke','t_ke'),('t_kh','t_kh'),('t_kl','t_kl'),('t_kr','t_kr'),('t_ks','t_ks'),('t_ku','t_ku'),('t_le','t_le'),('t_mb','t_mb'),('t_md','t_md'),('t_me','t_me'),('t_mr','t_mr'),('t_ms','t_ms'),('t_nd','t_nd'),('t_op','t_op'),('t_se','t_se'),('t_so','t_so'),('t_sr','t_sr'),('t_te','t_te'),('t_ti','t_ti'),('t_ts','t_ts'),('t_ue','t_ue'),('t_us','t_us'),('t_ut','t_ut'),('t_vb','t_vb'),('t_ve','t_ve'),('t_vi','t_vi'),('t_vs','t_vs'),('t_xs','t_xs'),('ta','ta'),('tabline','tabline'),('tabpagemax','tabpagemax'),('tabstop','tabstop'),('tag','tag'),('tagbsearch','tagbsearch'),('taglength','taglength'),('tagrelative','tagrelative'),('tags','tags'),('tagstack','tagstack'),('tal','tal'),('tb','tb'),('tbi','tbi'),('tbidi','tbidi'),('tbis','tbis'),('tbs','tbs'),('tenc','tenc'),('term','term'),('termbidi','termbidi'),('termencoding','termencoding'),('terse','terse'),('textauto','textauto'),('textmode','textmode'),('textwidth','textwidth'),('tf','tf'),('tgst','tgst'),('thesaurus','thesaurus'),('tildeop','tildeop'),('timeout','timeout'),('timeoutlen','timeoutlen'),('title','title'),('titlelen','titlelen'),('titleold','titleold'),('titlestring','titlestring'),('tl','tl'),('tm','tm'),('to','to'),('toolbar','toolbar'),('toolbariconsize','toolbariconsize'),('top','top'),('tpm','tpm'),('tr','tr'),('ts','ts'),('tsl','tsl'),('tsr','tsr'),('ttimeout','ttimeout'),('ttimeoutlen','ttimeoutlen'),('ttm','ttm'),('tty','tty'),('ttybuiltin','ttybuiltin'),('ttyfast','ttyfast'),('ttym','ttym'),('ttymouse','ttymouse'),('ttyscroll','ttyscroll'),('ttytype','ttytype'),('tw','tw'),('tx','tx'),('uc','uc'),('udf','udf'),('udir','udir'),('ul','ul'),('undodir','undodir'),('undofile','undofile'),('undolevels','undolevels'),('undoreload','undoreload'),('updatecount','updatecount'),('updatetime','updatetime'),('ur','ur'),('ut','ut'),('vb','vb'),('vbs','vbs'),('vdir','vdir'),('ve','ve'),('verbose','verbose'),('verbosefile','verbosefile'),('vfile','vfile'),('vi','vi'),('viewdir','viewdir'),('viewoptions','viewoptions'),('viminfo','viminfo'),('virtualedit','virtualedit'),('visualbell','visualbell'),('vnoremap','vnoremap'),('vop','vop'),('wa','wa'),('wak','wak'),('warn','warn'),('wb','wb'),('wc','wc'),('wcm','wcm'),('wd','wd'),('weirdinvert','weirdinvert'),('wfh','wfh'),('wfw','wfw'),('wh','wh'),('whichwrap','whichwrap'),('wi','wi'),('wic','wic'),('wig','wig'),('wildchar','wildchar'),('wildcharm','wildcharm'),('wildignore','wildignore'),('wildignorecase','wildignorecase'),('wildmenu','wildmenu'),('wildmode','wildmode'),('wildoptions','wildoptions'),('wim','wim'),('winaltkeys','winaltkeys'),('window','window'),('winfixheight','winfixheight'),('winfixwidth','winfixwidth'),('winheight','winheight'),('winminheight','winminheight'),('winminwidth','winminwidth'),('winwidth','winwidth'),('wiv','wiv'),('wiw','wiw'),('wm','wm'),('wmh','wmh'),('wmnu','wmnu'),('wmw','wmw'),('wop','wop'),('wrap','wrap'),('wrapmargin','wrapmargin'),('wrapscan','wrapscan'),('write','write'),('writeany','writeany'),('writebackup','writebackup'),('writedelay','writedelay'),('ws','ws'),('ww','ww')]
index 7f3c23406ac446b6b5bbed543775e31e90da8f3a..024ab8d59c107a1e1f47e4e65d7729fa90183e7a 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for agile languages.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -20,12 +20,13 @@ from pygments import unistring as uni
 
 
 __all__ = ['PythonLexer', 'PythonConsoleLexer', 'PythonTracebackLexer',
-           'RubyLexer', 'RubyConsoleLexer', 'PerlLexer', 'LuaLexer',
-           'MiniDLexer', 'IoLexer', 'TclLexer', 'ClojureLexer',
-           'Python3Lexer', 'Python3TracebackLexer', 'FactorLexer', 'IokeLexer']
+           'Python3Lexer', 'Python3TracebackLexer', 'RubyLexer',
+           'RubyConsoleLexer', 'PerlLexer', 'LuaLexer', 'MoonScriptLexer',
+           'MiniDLexer', 'IoLexer', 'TclLexer', 'FactorLexer', 'FancyLexer']
 
 # b/w compatibility
 from pygments.lexers.functional import SchemeLexer
+from pygments.lexers.jvm import IokeLexer, ClojureLexer
 
 line_re  = re.compile('.*?\n')
 
@@ -55,8 +56,10 @@ class PythonLexer(RegexLexer):
             include('keywords'),
             (r'(def)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'funcname'),
             (r'(class)((?:\s|\\\s)+)', bygroups(Keyword, Text), 'classname'),
-            (r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text), 'fromimport'),
-            (r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text), 'import'),
+            (r'(from)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
+             'fromimport'),
+            (r'(import)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text),
+             'import'),
             include('builtins'),
             include('backtick'),
             ('(?:[rR]|[uU][rR]|[rR][uU])"""', String, 'tdqs'),
@@ -102,12 +105,12 @@ class PythonLexer(RegexLexer):
              r'WindowsError|ZeroDivisionError)\b', Name.Exception),
         ],
         'numbers': [
-            (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
-            (r'\d+[eE][+-]?[0-9]+', Number.Float),
-            (r'0[0-7]+', Number.Oct),
+            (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
+            (r'\d+[eE][+-]?[0-9]+j?', Number.Float),
+            (r'0[0-7]+j?', Number.Oct),
             (r'0[xX][a-fA-F0-9]+', Number.Hex),
             (r'\d+L', Number.Integer.Long),
-            (r'\d+', Number.Integer)
+            (r'\d+j?', Number.Integer)
         ],
         'backtick': [
             ('`.*?`', String.Backtick),
@@ -123,14 +126,15 @@ class PythonLexer(RegexLexer):
             ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
         ],
         'import': [
-            (r'((?:\s|\\\s)+)(as)((?:\s|\\\s)+)',
-             bygroups(Text, Keyword.Namespace, Text)),
+            (r'(?:[ \t]|\\\n)+', Text),
+            (r'as\b', Keyword.Namespace),
+            (r',', Operator),
             (r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace),
-            (r'(\s*)(,)(\s*)', bygroups(Text, Operator, Text)),
             (r'', Text, '#pop') # all else: go back
         ],
         'fromimport': [
-            (r'((?:\s|\\\s)+)(import)\b', bygroups(Text, Keyword.Namespace), '#pop'),
+            (r'(?:[ \t]|\\\n)+', Text),
+            (r'import\b', Keyword.Namespace, '#pop'),
             (r'[a-zA-Z_.][a-zA-Z0-9_.]*', Name.Namespace),
         ],
         'stringescape': [
@@ -152,12 +156,12 @@ class PythonLexer(RegexLexer):
         ],
         'dqs': [
             (r'"', String, '#pop'),
-            (r'\\\\|\\"|\\\n', String.Escape), # included here again for raw strings
+            (r'\\\\|\\"|\\\n', String.Escape), # included here for raw strings
             include('strings')
         ],
         'sqs': [
             (r"'", String, '#pop'),
-            (r"\\\\|\\'|\\\n", String.Escape), # included here again for raw strings
+            (r"\\\\|\\'|\\\n", String.Escape), # included here for raw strings
             include('strings')
         ],
         'tdqs': [
@@ -173,7 +177,7 @@ class PythonLexer(RegexLexer):
     }
 
     def analyse_text(text):
-        return shebang_matches(text, r'pythonw?(2\.\d)?')
+        return shebang_matches(text, r'pythonw?(2(\.\d)?)?')
 
 
 class Python3Lexer(RegexLexer):
@@ -195,7 +199,7 @@ class Python3Lexer(RegexLexer):
     tokens = PythonLexer.tokens.copy()
     tokens['keywords'] = [
         (r'(assert|break|continue|del|elif|else|except|'
-         r'finally|for|global|if|lambda|pass|raise|'
+         r'finally|for|global|if|lambda|pass|raise|nonlocal|'
          r'return|try|while|yield|as|with|True|False|None)\b', Keyword),
     ]
     tokens['builtins'] = [
@@ -364,7 +368,8 @@ class PythonTracebackLexer(RegexLexer):
 
     tokens = {
         'root': [
-            (r'^Traceback \(most recent call last\):\n', Generic.Traceback, 'intb'),
+            (r'^Traceback \(most recent call last\):\n',
+             Generic.Traceback, 'intb'),
             # SyntaxError starts with this.
             (r'^(?=  File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
             (r'^.*\n', Other),
@@ -376,7 +381,7 @@ class PythonTracebackLexer(RegexLexer):
              bygroups(Text, Name.Builtin, Text, Number, Text)),
             (r'^(    )(.+)(\n)',
              bygroups(Text, using(PythonLexer), Text)),
-            (r'^([ \t]*)(...)(\n)',
+            (r'^([ \t]*)(\.\.\.)(\n)',
              bygroups(Text, Comment, Text)), # for doctests...
             (r'^(.+)(: )(.+)(\n)',
              bygroups(Generic.Error, Text, Name, Text), '#pop'),
@@ -412,7 +417,7 @@ class Python3TracebackLexer(RegexLexer):
              bygroups(Text, Name.Builtin, Text, Number, Text, Name, Text)),
             (r'^(    )(.+)(\n)',
              bygroups(Text, using(Python3Lexer), Text)),
-            (r'^([ \t]*)(...)(\n)',
+            (r'^([ \t]*)(\.\.\.)(\n)',
              bygroups(Text, Comment, Text)), # for doctests...
             (r'^(.+)(: )(.+)(\n)',
              bygroups(Generic.Error, Text, Name, Text), '#pop'),
@@ -483,11 +488,11 @@ class RubyLexer(ExtendedRegexLexer):
 
     def gen_rubystrings_rules():
         def intp_regex_callback(self, match, ctx):
-            yield match.start(1), String.Regex, match.group(1)    # begin
+            yield match.start(1), String.Regex, match.group(1)  # begin
             nctx = LexerContext(match.group(3), 0, ['interpolated-regex'])
             for i, t, v in self.get_tokens_unprocessed(context=nctx):
                 yield match.start(3)+i, t, v
-            yield match.start(4), String.Regex, match.group(4)    # end[mixounse]*
+            yield match.start(4), String.Regex, match.group(4)  # end[mixounse]*
             ctx.pos = match.end()
 
         def intp_string_callback(self, match, ctx):
@@ -495,13 +500,13 @@ class RubyLexer(ExtendedRegexLexer):
             nctx = LexerContext(match.group(3), 0, ['interpolated-string'])
             for i, t, v in self.get_tokens_unprocessed(context=nctx):
                 yield match.start(3)+i, t, v
-            yield match.start(4), String.Other, match.group(4)    # end
+            yield match.start(4), String.Other, match.group(4)  # end
             ctx.pos = match.end()
 
         states = {}
         states['strings'] = [
             # easy ones
-            (r'\:([a-zA-Z_][\w_]*[\!\?]?|\*\*?|[-+]@?|'
+            (r'\:@{0,2}([a-zA-Z_]\w*[\!\?]?|\*\*?|[-+]@?|'
              r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)', String.Symbol),
             (r":'(\\\\|\\'|[^'])*'", String.Symbol),
             (r"'(\\\\|\\'|[^'])*'", String.Single),
@@ -583,7 +588,7 @@ class RubyLexer(ExtendedRegexLexer):
     tokens = {
         'root': [
             (r'#.*?$', Comment.Single),
-            (r'=begin\s.*?\n=end', Comment.Multiline),
+            (r'=begin\s.*?\n=end.*?$', Comment.Multiline),
             # keywords
             (r'(BEGIN|END|alias|begin|break|case|defined\?|'
              r'do|else|elsif|end|ensure|for|if|in|next|redo|'
@@ -598,18 +603,19 @@ class RubyLexer(ExtendedRegexLexer):
             # special methods
             (r'(initialize|new|loop|include|extend|raise|attr_reader|'
              r'attr_writer|attr_accessor|attr|catch|throw|private|'
-             r'module_function|public|protected|true|false|nil)\b', Keyword.Pseudo),
+             r'module_function|public|protected|true|false|nil)\b',
+             Keyword.Pseudo),
             (r'(not|and|or)\b', Operator.Word),
             (r'(autoload|block_given|const_defined|eql|equal|frozen|include|'
              r'instance_of|is_a|iterator|kind_of|method_defined|nil|'
              r'private_method_defined|protected_method_defined|'
              r'public_method_defined|respond_to|tainted)\?', Name.Builtin),
             (r'(chomp|chop|exit|gsub|sub)!', Name.Builtin),
-            (r'(?<!\.)(Array|Float|Integer|String|__id__|__send__|abort|ancestors|'
-             r'at_exit|autoload|binding|callcc|caller|'
+            (r'(?<!\.)(Array|Float|Integer|String|__id__|__send__|abort|'
+             r'ancestors|at_exit|autoload|binding|callcc|caller|'
              r'catch|chomp|chop|class_eval|class_variables|'
-             r'clone|const_defined\?|const_get|const_missing|const_set|constants|'
-             r'display|dup|eval|exec|exit|extend|fail|fork|'
+             r'clone|const_defined\?|const_get|const_missing|const_set|'
+             r'constants|display|dup|eval|exec|exit|extend|fail|fork|'
              r'format|freeze|getc|gets|global_variables|gsub|'
              r'hash|id|included_modules|inspect|instance_eval|'
              r'instance_method|instance_methods|'
@@ -628,7 +634,8 @@ class RubyLexer(ExtendedRegexLexer):
              r'warn)\b', Name.Builtin),
             (r'__(FILE|LINE)__\b', Name.Builtin.Pseudo),
             # normal heredocs
-            (r'(?<!\w)(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)', heredoc_callback),
+            (r'(?<!\w)(<<-?)(["`\']?)([a-zA-Z_]\w*)(\2)(.*?\n)',
+             heredoc_callback),
             # empty string heredocs
             (r'(<<-?)("|\')()(\2)(.*?\n)', heredoc_callback),
             (r'__END__', Comment.Preproc, 'end-part'),
@@ -657,10 +664,11 @@ class RubyLexer(ExtendedRegexLexer):
                  r'(?<=^if\s)|'
                  r'(?<=^elsif\s)'
              r')(\s*)(/)', bygroups(Text, String.Regex), 'multiline-regex'),
-            # multiline regex (in method calls)
-            (r'(?<=\(|,)/', String.Regex, 'multiline-regex'),
+            # multiline regex (in method calls or subscripts)
+            (r'(?<=\(|,|\[)/', String.Regex, 'multiline-regex'),
             # multiline regex (this time the funny no whitespace rule)
-            (r'(\s+)(/[^\s=])', String.Regex, 'multiline-regex'),
+            (r'(\s+)(/)(?![\s=])', bygroups(Text, String.Regex),
+             'multiline-regex'),
             # lex numbers and ignore following regular expressions which
             # are division operators in fact (grrrr. i hate that. any
             # better ideas?)
@@ -695,7 +703,7 @@ class RubyLexer(ExtendedRegexLexer):
             # like keywords (class) or like this: ` ?!?
             (r'(\.|::)([a-zA-Z_]\w*[\!\?]?|[*%&^`~+-/\[<>=])',
              bygroups(Operator, Name)),
-            (r'[a-zA-Z_][\w_]*[\!\?]?', Name),
+            (r'[a-zA-Z_]\w*[\!\?]?', Name),
             (r'(\[|\]|\*\*|<<?|>>?|>=|<=|<=>|=~|={3}|'
              r'!~|&&?|\|\||\.{1,3})', Operator),
             (r'[-+/*%=<>&!^|~]=?', Operator),
@@ -705,7 +713,7 @@ class RubyLexer(ExtendedRegexLexer):
         'funcname': [
             (r'\(', Punctuation, 'defexpr'),
             (r'(?:([a-zA-Z_][a-zA-Z0-9_]*)(\.))?'
-             r'([a-zA-Z_][\w_]*[\!\?]?|\*\*?|[-+]@?|'
+             r'([a-zA-Z_]\w*[\!\?]?|\*\*?|[-+]@?|'
              r'[/%&|^`~]|\[\]=?|<<|>>|<=?>|>=?|===?)',
              bygroups(Name.Class, Operator, Name.Function), '#pop'),
             (r'', Text, '#pop')
@@ -713,7 +721,7 @@ class RubyLexer(ExtendedRegexLexer):
         'classname': [
             (r'\(', Punctuation, 'defexpr'),
             (r'<<', Operator, '#pop'),
-            (r'[A-Z_][\w_]*', Name.Class, '#pop'),
+            (r'[A-Z_]\w*', Name.Class, '#pop'),
             (r'', Text, '#pop')
         ],
         'defexpr': [
@@ -732,7 +740,8 @@ class RubyLexer(ExtendedRegexLexer):
         ],
         'string-intp-escaped': [
             include('string-intp'),
-            (r'\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})', String.Escape)
+            (r'\\([\\abefnrstv#"\']|x[a-fA-F0-9]{1,2}|[0-7]{1,3})',
+             String.Escape)
         ],
         'interpolated-regex': [
             include('string-intp'),
@@ -819,19 +828,19 @@ class PerlLexer(RegexLexer):
     mimetypes = ['text/x-perl', 'application/x-perl']
 
     flags = re.DOTALL | re.MULTILINE
-    # TODO: give this a perl guy who knows how to parse perl...
+    # TODO: give this to a perl guy who knows how to parse perl...
     tokens = {
         'balanced-regex': [
-            (r'/(\\\\|\\/|[^/])*/[egimosx]*', String.Regex, '#pop'),
-            (r'!(\\\\|\\!|[^!])*![egimosx]*', String.Regex, '#pop'),
+            (r'/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*', String.Regex, '#pop'),
+            (r'!(\\\\|\\[^\\]|[^\\!])*![egimosx]*', String.Regex, '#pop'),
             (r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'),
-            (r'{(\\\\|\\}|[^}])*}[egimosx]*', String.Regex, '#pop'),
-            (r'<(\\\\|\\>|[^>])*>[egimosx]*', String.Regex, '#pop'),
-            (r'\[(\\\\|\\\]|[^\]])*\][egimosx]*', String.Regex, '#pop'),
-            (r'\((\\\\|\\\)|[^\)])*\)[egimosx]*', String.Regex, '#pop'),
-            (r'@(\\\\|\\\@|[^\@])*@[egimosx]*', String.Regex, '#pop'),
-            (r'%(\\\\|\\\%|[^\%])*%[egimosx]*', String.Regex, '#pop'),
-            (r'\$(\\\\|\\\$|[^\$])*\$[egimosx]*', String.Regex, '#pop'),
+            (r'{(\\\\|\\[^\\]|[^\\}])*}[egimosx]*', String.Regex, '#pop'),
+            (r'<(\\\\|\\[^\\]|[^\\>])*>[egimosx]*', String.Regex, '#pop'),
+            (r'\[(\\\\|\\[^\\]|[^\\\]])*\][egimosx]*', String.Regex, '#pop'),
+            (r'\((\\\\|\\[^\\]|[^\\\)])*\)[egimosx]*', String.Regex, '#pop'),
+            (r'@(\\\\|\\[^\\]|[^\\\@])*@[egimosx]*', String.Regex, '#pop'),
+            (r'%(\\\\|\\[^\\]|[^\\\%])*%[egimosx]*', String.Regex, '#pop'),
+            (r'\$(\\\\|\\[^\\]|[^\\\$])*\$[egimosx]*', String.Regex, '#pop'),
         ],
         'root': [
             (r'\#.*?$', Comment.Single),
@@ -843,20 +852,26 @@ class PerlLexer(RegexLexer):
              bygroups(Keyword, Text, Name, Text, Punctuation, Text), 'format'),
             (r'(eq|lt|gt|le|ge|ne|not|and|or|cmp)\b', Operator.Word),
             # common delimiters
-            (r's/(\\\\|\\/|[^/])*/(\\\\|\\/|[^/])*/[egimosx]*', String.Regex),
+            (r's/(\\\\|\\[^\\]|[^\\/])*/(\\\\|\\[^\\]|[^\\/])*/[egimosx]*',
+                String.Regex),
             (r's!(\\\\|\\!|[^!])*!(\\\\|\\!|[^!])*![egimosx]*', String.Regex),
             (r's\\(\\\\|[^\\])*\\(\\\\|[^\\])*\\[egimosx]*', String.Regex),
-            (r's@(\\\\|\\@|[^@])*@(\\\\|\\@|[^@])*@[egimosx]*', String.Regex),
-            (r's%(\\\\|\\%|[^%])*%(\\\\|\\%|[^%])*%[egimosx]*', String.Regex),
+            (r's@(\\\\|\\[^\\]|[^\\@])*@(\\\\|\\[^\\]|[^\\@])*@[egimosx]*',
+                String.Regex),
+            (r's%(\\\\|\\[^\\]|[^\\%])*%(\\\\|\\[^\\]|[^\\%])*%[egimosx]*',
+                String.Regex),
             # balanced delimiters
-            (r's{(\\\\|\\}|[^}])*}\s*', String.Regex, 'balanced-regex'),
-            (r's<(\\\\|\\>|[^>])*>\s*', String.Regex, 'balanced-regex'),
-            (r's\[(\\\\|\\\]|[^\]])*\]\s*', String.Regex, 'balanced-regex'),
-            (r's\((\\\\|\\\)|[^\)])*\)\s*', String.Regex, 'balanced-regex'),
-
-            (r'm?/(\\\\|\\/|[^/\n])*/[gcimosx]*', String.Regex),
+            (r's{(\\\\|\\[^\\]|[^\\}])*}\s*', String.Regex, 'balanced-regex'),
+            (r's<(\\\\|\\[^\\]|[^\\>])*>\s*', String.Regex, 'balanced-regex'),
+            (r's\[(\\\\|\\[^\\]|[^\\\]])*\]\s*', String.Regex,
+                'balanced-regex'),
+            (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*/(\\\\|\\[^\\]|[^\\/])*/[gcimosx]*',
+                String.Regex),
             (r'\s+', Text),
             (r'(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|'
              r'chmod|chomp|chop|chown|chr|chroot|close|closedir|connect|'
@@ -898,9 +913,9 @@ class PerlLexer(RegexLexer):
              Number.Float),
             (r'(?i)\d+(_\d*)*e[+-]?\d+(_\d*)*', Number.Float),
             (r'\d+(_\d+)*', Number.Integer),
-            (r"'(\\\\|\\'|[^'])*'", String),
-            (r'"(\\\\|\\"|[^"])*"', String),
-            (r'`(\\\\|\\`|[^`])*`', String.Backtick),
+            (r"'(\\\\|\\[^\\]|[^'\\])*'", String),
+            (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
+            (r'`(\\\\|\\[^\\]|[^`\\])*`', String.Backtick),
             (r'<([^\s>]+)>', String.Regex),
             (r'(q|qq|qw|qr|qx)\{', String.Other, 'cb-string'),
             (r'(q|qq|qw|qr|qx)\(', String.Other, 'rb-string'),
@@ -909,7 +924,7 @@ class PerlLexer(RegexLexer):
             (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}|!=|=~|'
+            (r'(\[\]|\*\*|::|<<|>>|>=|<=>|<=|={3}|!=|=~|'
              r'!~|&&?|\|\||\.{1,3})', Operator),
             (r'[-+/*%=<>&^|!\\~]=?', Operator),
             (r'[\(\)\[\]:;,<>/\?\{\}]', Punctuation), # yes, there's no shortage
@@ -934,10 +949,10 @@ class PerlLexer(RegexLexer):
             (r'(?=[^a-zA-Z0-9_])', Text, '#pop'),
         ],
         'modulename': [
-            (r'[a-zA-Z_][\w_]*', Name.Namespace, '#pop')
+            (r'[a-zA-Z_]\w*', Name.Namespace, '#pop')
         ],
         'funcname': [
-            (r'[a-zA-Z_][\w_]*[\!\?]?', Name.Function),
+            (r'[a-zA-Z_]\w*[\!\?]?', Name.Function),
             (r'\s+', Text),
             # argument declaration
             (r'(\([$@%]*\))(\s*)', bygroups(Punctuation, Text)),
@@ -1033,7 +1048,7 @@ class LuaLexer(RegexLexer):
             # multiline strings
             (r'(?s)\[(=*)\[.*?\]\1\]', String),
 
-            (r'(==|~=|<=|>=|\.\.|\.\.\.|[=+\-*/%^<>#])', Operator),
+            (r'(==|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#])', Operator),
             (r'[\[\]\{\}\(\)\.,:;]', Punctuation),
             (r'(and|or|not)\b', Operator.Word),
 
@@ -1042,8 +1057,7 @@ class LuaLexer(RegexLexer):
             (r'(local)\b', Keyword.Declaration),
             (r'(true|false|nil)\b', Keyword.Constant),
 
-            (r'(function)(\s+)', bygroups(Keyword, Text), 'funcname'),
-            (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
+            (r'(function)\b', Keyword, 'funcname'),
 
             (r'[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?', Name),
 
@@ -1052,16 +1066,13 @@ class LuaLexer(RegexLexer):
         ],
 
         'funcname': [
+            (r'\s+', Text),
             ('(?:([A-Za-z_][A-Za-z0-9_]*)(\.))?([A-Za-z_][A-Za-z0-9_]*)',
              bygroups(Name.Class, Punctuation, Name.Function), '#pop'),
             # inline function
             ('\(', Punctuation, '#pop'),
         ],
 
-        'classname': [
-            ('[A-Za-z_][A-Za-z0-9_]*', Name.Class, '#pop')
-        ],
-
         # if I understand correctly, every character is valid in a lua string,
         # so this state is only for later corrections
         'string': [
@@ -1112,6 +1123,73 @@ class LuaLexer(RegexLexer):
             yield index, token, value
 
 
+class MoonScriptLexer(LuaLexer):
+    """
+    For `MoonScript <http://moonscript.org.org>`_ source code.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = "MoonScript"
+    aliases = ["moon", "moonscript"]
+    filenames = ["*.moon"]
+    mimetypes = ['text/x-moonscript', 'application/x-moonscript']
+
+    tokens = {
+        'root': [
+            (r'#!(.*?)$', Comment.Preproc),
+            (r'', Text, 'base'),
+        ],
+        'base': [
+            ('--.*$', Comment.Single),
+            (r'(?i)(\d*\.\d+|\d+\.\d*)(e[+-]?\d+)?', Number.Float),
+            (r'(?i)\d+e[+-]?\d+', Number.Float),
+            (r'(?i)0x[0-9a-f]*', Number.Hex),
+            (r'\d+', Number.Integer),
+            (r'\n', Text),
+            (r'[^\S\n]+', Text),
+            (r'(?s)\[(=*)\[.*?\]\1\]', String),
+            (r'(->|=>)', Name.Function),
+            (r':[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
+            (r'(==|!=|~=|<=|>=|\.\.\.|\.\.|[=+\-*/%^<>#!.\\:])', Operator),
+            (r'[;,]', Punctuation),
+            (r'[\[\]\{\}\(\)]', Keyword.Type),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Variable),
+            (r"(class|extends|if|then|super|do|with|import|export|"
+             r"while|elseif|return|for|in|from|when|using|else|"
+             r"and|or|not|switch|break)\b", Keyword),
+            (r'(true|false|nil)\b', Keyword.Constant),
+            (r'(and|or|not)\b', Operator.Word),
+            (r'(self)\b', Name.Builtin.Pseudo),
+            (r'@@?([a-zA-Z_][a-zA-Z0-9_]*)?', Name.Variable.Class),
+            (r'[A-Z]\w*', Name.Class), # proper name
+            (r'[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)?', Name),
+            ("'", String.Single, combined('stringescape', 'sqs')),
+            ('"', String.Double, combined('stringescape', 'dqs'))
+        ],
+        'stringescape': [
+            (r'''\\([abfnrtv\\"']|\d{1,3})''', String.Escape)
+        ],
+        'sqs': [
+            ("'", String.Single, '#pop'),
+            (".", String)
+        ],
+        'dqs': [
+            ('"', String.Double, '#pop'),
+            (".", String)
+        ]
+    }
+
+    def get_tokens_unprocessed(self, text):
+        # set . as Operator instead of Punctuation
+        for index, token, value in \
+            LuaLexer.get_tokens_unprocessed(self, text):
+            if token == Punctuation and value == ".":
+                token = Operator
+            yield index, token, value
+
+
+
 class MiniDLexer(RegexLexer):
     """
     For `MiniD <http://www.dsource.org/projects/minid>`_ (a D-like scripting
@@ -1154,7 +1232,7 @@ class MiniDLexer(RegexLexer):
             ),
             # StringLiteral
             # -- WysiwygString
-            (r'@"(""|.)*"', String),
+            (r'@"(""|[^"])*"', String),
             # -- AlternateWysiwygString
             (r'`(``|.)*`', String),
             # -- DoubleQuotedString
@@ -1208,7 +1286,7 @@ class IoLexer(RegexLexer):
             # constants
             (r'(nil|false|true)\b', Name.Constant),
             # names
-            ('(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
+            (r'(Object|list|List|Map|args|Sequence|Coroutine|File)\b',
              Name.Builtin),
             ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
             # numbers
@@ -1300,7 +1378,7 @@ class TclLexer(RegexLexer):
         'params': [
             (r';', Keyword, '#pop'),
             (r'\n', Text, '#pop'),
-            (r'(else|elseif|then)', Keyword),
+            (r'(else|elseif|then)\b', Keyword),
             include('basic'),
             include('data'),
         ],
@@ -1354,141 +1432,6 @@ class TclLexer(RegexLexer):
         return shebang_matches(text, r'(tcl)')
 
 
-class ClojureLexer(RegexLexer):
-    """
-    Lexer for `Clojure <http://clojure.org/>`_ source code.
-
-    *New in Pygments 0.11.*
-    """
-    name = 'Clojure'
-    aliases = ['clojure', 'clj']
-    filenames = ['*.clj']
-    mimetypes = ['text/x-clojure', 'application/x-clojure']
-
-    keywords = [
-        'fn', 'def', 'defn', 'defmacro', 'defmethod', 'defmulti', 'defn-',
-        'defstruct',
-        'if', 'cond',
-        'let', 'for'
-    ]
-    builtins = [
-        '.', '..',
-        '*', '+', '-', '->', '..', '/', '<', '<=', '=', '==', '>', '>=',
-        'accessor', 'agent', 'agent-errors', 'aget', 'alength', 'all-ns',
-        'alter', 'and', 'append-child', 'apply', 'array-map', 'aset',
-        'aset-boolean', 'aset-byte', 'aset-char', 'aset-double', 'aset-float',
-        'aset-int', 'aset-long', 'aset-short', 'assert', 'assoc', 'await',
-        'await-for', 'bean', 'binding', 'bit-and', 'bit-not', 'bit-or',
-        'bit-shift-left', 'bit-shift-right', 'bit-xor', 'boolean', 'branch?',
-        'butlast', 'byte', 'cast', 'char', 'children', 'class',
-        'clear-agent-errors', 'comment', 'commute', 'comp', 'comparator',
-        'complement', 'concat', 'conj', 'cons', 'constantly',
-        'construct-proxy', 'contains?', 'count', 'create-ns', 'create-struct',
-        'cycle', 'dec',  'deref', 'difference', 'disj', 'dissoc', 'distinct',
-        'doall', 'doc', 'dorun', 'doseq', 'dosync', 'dotimes', 'doto',
-        'double', 'down', 'drop', 'drop-while', 'edit', 'end?', 'ensure',
-        'eval', 'every?', 'false?', 'ffirst', 'file-seq', 'filter', 'find',
-        'find-doc', 'find-ns', 'find-var', 'first', 'float', 'flush',
-        'fnseq', 'frest', 'gensym', 'get', 'get-proxy-class',
-        'hash-map', 'hash-set', 'identical?', 'identity', 'if-let', 'import',
-        'in-ns', 'inc', 'index', 'insert-child', 'insert-left', 'insert-right',
-        'inspect-table', 'inspect-tree', 'instance?', 'int', 'interleave',
-        'intersection', 'into', 'into-array', 'iterate', 'join', 'key', 'keys',
-        'keyword', 'keyword?', 'last', 'lazy-cat', 'lazy-cons', 'left',
-        'lefts', 'line-seq', 'list', 'list*', 'load', 'load-file',
-        'locking', 'long', 'loop', 'macroexpand', 'macroexpand-1',
-        'make-array', 'make-node', 'map', 'map-invert', 'map?', 'mapcat',
-        'max', 'max-key', 'memfn', 'merge', 'merge-with', 'meta', 'min',
-        'min-key', 'name', 'namespace', 'neg?', 'new', 'newline', 'next',
-        'nil?', 'node', 'not', 'not-any?', 'not-every?', 'not=', 'ns-imports',
-        'ns-interns', 'ns-map', 'ns-name', 'ns-publics', 'ns-refers',
-        'ns-resolve', 'ns-unmap', 'nth', 'nthrest', 'or', 'parse', 'partial',
-        'path', 'peek', 'pop', 'pos?', 'pr', 'pr-str', 'print', 'print-str',
-        'println', 'println-str', 'prn', 'prn-str', 'project', 'proxy',
-        'proxy-mappings', 'quot', 'rand', 'rand-int', 'range', 're-find',
-        're-groups', 're-matcher', 're-matches', 're-pattern', 're-seq',
-        'read', 'read-line', 'reduce', 'ref', 'ref-set', 'refer', 'rem',
-        'remove', 'remove-method', 'remove-ns', 'rename', 'rename-keys',
-        'repeat', 'replace', 'replicate', 'resolve', 'rest', 'resultset-seq',
-        'reverse', 'rfirst', 'right', 'rights', 'root', 'rrest', 'rseq',
-        'second', 'select', 'select-keys', 'send', 'send-off', 'seq',
-        'seq-zip', 'seq?', 'set', 'short', 'slurp', 'some', 'sort',
-        'sort-by', 'sorted-map', 'sorted-map-by', 'sorted-set',
-        'special-symbol?', 'split-at', 'split-with', 'str', 'string?',
-        'struct', 'struct-map', 'subs', 'subvec', 'symbol', 'symbol?',
-        'sync', 'take', 'take-nth', 'take-while', 'test', 'time', 'to-array',
-        'to-array-2d', 'tree-seq', 'true?', 'union', 'up', 'update-proxy',
-        'val', 'vals', 'var-get', 'var-set', 'var?', 'vector', 'vector-zip',
-        'vector?', 'when', 'when-first', 'when-let', 'when-not',
-        'with-local-vars', 'with-meta', 'with-open', 'with-out-str',
-        'xml-seq', 'xml-zip', 'zero?', 'zipmap', 'zipper']
-
-    # valid names for identifiers
-    # well, names can only not consist fully of numbers
-    # but this should be good enough for now
-    valid_name = r'[a-zA-Z0-9!$%&*+,/:<=>?@^_~-]+'
-
-    tokens = {
-        'root' : [
-            # the comments - always starting with semicolon
-            # and going to the end of the line
-            (r';.*$', Comment.Single),
-
-            # whitespaces - usually not relevant
-            (r'\s+', Text),
-
-            # numbers
-            (r'-?\d+\.\d+', Number.Float),
-            (r'-?\d+', Number.Integer),
-            # support for uncommon kinds of numbers -
-            # have to figure out what the characters mean
-            #(r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number),
-
-            # strings, symbols and characters
-            (r'"(\\\\|\\"|[^"])*"', String),
-            (r"'" + valid_name, String.Symbol),
-            (r"\\([()/'\".'_!§$%& ?;=#+-]{1}|[a-zA-Z0-9]+)", String.Char),
-
-            # constants
-            (r'(#t|#f)', Name.Constant),
-
-            # special operators
-            (r"('|#|`|,@|,|\.)", Operator),
-
-            # highlight the keywords
-            ('(%s)' % '|'.join([
-                re.escape(entry) + ' ' for entry in keywords]),
-                Keyword
-            ),
-
-            # first variable in a quoted string like
-            # '(this is syntactic sugar)
-            (r"(?<='\()" + valid_name, Name.Variable),
-            (r"(?<=#\()" + valid_name, Name.Variable),
-
-            # highlight the builtins
-            ("(?<=\()(%s)" % '|'.join([
-                re.escape(entry) + ' ' for entry in builtins]),
-                Name.Builtin
-            ),
-
-            # the remaining functions
-            (r'(?<=\()' + valid_name, Name.Function),
-            # find the remaining variables
-            (valid_name, Name.Variable),
-
-            # Clojure accepts vector notation
-            (r'(\[|\])', Punctuation),
-
-            # Clojure accepts map notation
-            (r'(\{|\})', Punctuation),
-
-            # the famous parentheses!
-            (r'(\(|\))', Punctuation),
-        ],
-    }
-
-
 class FactorLexer(RegexLexer):
     """
     Lexer for the `Factor <http://factorcode.org>`_ language.
@@ -1651,33 +1594,38 @@ class FactorLexer(RegexLexer):
 
             # defining words
             (r'(\s*)(:|::|MACRO:|MEMO:)(\s+)(\S+)',
-                bygroups(Text, Keyword, Text, Name.Function)),
+             bygroups(Text, Keyword, Text, Name.Function)),
             (r'(\s*)(M:)(\s+)(\S+)(\s+)(\S+)',
-                bygroups(Text, Keyword, Text, Name.Class, Text, Name.Function)),
+             bygroups(Text, Keyword, Text, Name.Class, Text, Name.Function)),
             (r'(\s*)(GENERIC:)(\s+)(\S+)',
-                bygroups(Text, Keyword, Text, Name.Function)),
+             bygroups(Text, Keyword, Text, Name.Function)),
             (r'(\s*)(HOOK:|GENERIC#)(\s+)(\S+)(\s+)(\S+)',
-                bygroups(Text, Keyword, Text, Name.Function, Text, Name.Function)),
+             bygroups(Text, Keyword, Text, Name.Function, Text, Name.Function)),
             (r'(\()(\s+)', bygroups(Name.Function, Text), 'stackeffect'),
             (r'\;\s', Keyword),
 
             # imports and namespaces
-            (r'(USING:)((?:\s|\\\s)+)', bygroups(Keyword.Namespace, Text), 'import'),
-            (r'(USE:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Namespace)),
-            (r'(UNUSE:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Namespace)),
+            (r'(USING:)((?:\s|\\\s)+)',
+             bygroups(Keyword.Namespace, Text), 'import'),
+            (r'(USE:)(\s+)(\S+)',
+             bygroups(Keyword.Namespace, Text, Name.Namespace)),
+            (r'(UNUSE:)(\s+)(\S+)',
+             bygroups(Keyword.Namespace, Text, Name.Namespace)),
             (r'(QUALIFIED:)(\s+)(\S+)',
-                bygroups(Keyword.Namespace, Text, Name.Namespace)),
+             bygroups(Keyword.Namespace, Text, Name.Namespace)),
             (r'(QUALIFIED-WITH:)(\s+)(\S+)',
-                bygroups(Keyword.Namespace, Text, Name.Namespace)),
+             bygroups(Keyword.Namespace, Text, Name.Namespace)),
             (r'(FROM:|EXCLUDE:)(\s+)(\S+)(\s+)(=>)',
-                bygroups(Keyword.Namespace, Text, Name.Namespace, Text, Text)),
-            (r'(IN:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Namespace)),
+             bygroups(Keyword.Namespace, Text, Name.Namespace, Text, Text)),
+            (r'(IN:)(\s+)(\S+)',
+             bygroups(Keyword.Namespace, Text, Name.Namespace)),
             (r'(?:ALIAS|DEFER|FORGET|POSTPONE):', Keyword.Namespace),
 
             # tuples and classes
             (r'(TUPLE:)(\s+)(\S+)(\s+<\s+)(\S+)',
-                bygroups(Keyword, Text, Name.Class, Text, Name.Class), 'slots'),
-            (r'(TUPLE:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class), 'slots'),
+             bygroups(Keyword, Text, Name.Class, Text, Name.Class), 'slots'),
+            (r'(TUPLE:)(\s+)(\S+)',
+             bygroups(Keyword, Text, Name.Class), 'slots'),
             (r'(UNION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
             (r'(INTERSECTION:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Class)),
             (r'(PREDICATE:)(\s+)(\S+)(\s+<\s+)(\S+)',
@@ -1695,7 +1643,8 @@ class FactorLexer(RegexLexer):
             (r'ERROR:', Keyword),
             (r'SYNTAX:', Keyword),
             (r'(HELP:)(\s+)(\S+)', bygroups(Keyword, Text, Name.Function)),
-            (r'(MAIN:)(\s+)(\S+)', bygroups(Keyword.Namespace, Text, Name.Function)),
+            (r'(MAIN:)(\s+)(\S+)',
+             bygroups(Keyword.Namespace, Text, Name.Function)),
             (r'(?:ALIEN|TYPEDEF|FUNCTION|STRUCT):', Keyword),
 
             # vocab.private
@@ -1725,7 +1674,8 @@ class FactorLexer(RegexLexer):
             (r'[-+/*=<>^]\s', Operator),
 
             # keywords
-            (r'(?:deprecated|final|foldable|flushable|inline|recursive)\s', Keyword),
+            (r'(?:deprecated|final|foldable|flushable|inline|recursive)\s',
+             Keyword),
 
             # builtins
             (builtin_kernel, Name.Builtin),
@@ -1769,191 +1719,85 @@ class FactorLexer(RegexLexer):
     }
 
 
-class IokeLexer(RegexLexer):
+class FancyLexer(RegexLexer):
     """
-    For `Ioke <http://ioke.org/>`_ (a strongly typed, dynamic,
-    prototype based programming language) source.
+    Pygments Lexer For `Fancy <http://www.fancy-lang.org/>`_.
 
-    *New in Pygments 1.4.*
-    """
-    name = 'Ioke'
-    filenames = ['*.ik']
-    aliases = ['ioke', 'ik']
-    mimetypes = ['text/x-iokesrc']
-    tokens = {
-        'interpolatableText': [
-            (r'(\\b|\\e|\\t|\\n|\\f|\\r|\\"|\\\\|\\#|\\\Z|\\u[0-9a-fA-F]{1,4}'
-             r'|\\[0-3]?[0-7]?[0-7])', String.Escape),
-            (r'#{', Punctuation, 'textInterpolationRoot')
-            ],
-
-        'text': [
-            (r'(?<!\\)"', String, '#pop'),
-            include('interpolatableText'),
-            (r'[^"]', String)
-            ],
-
-        'documentation': [
-            (r'(?<!\\)"', String.Doc, '#pop'),
-            include('interpolatableText'),
-            (r'[^"]', String.Doc)
-            ],
-
-        'textInterpolationRoot': [
-            (r'}', Punctuation, '#pop'),
-            include('root')
-            ],
+    Fancy is a self-hosted, pure object-oriented, dynamic,
+    class-based, concurrent general-purpose programming language
+    running on Rubinius, the Ruby VM.
 
-        'slashRegexp': [
-            (r'(?<!\\)/[oxpniums]*', String.Regex, '#pop'),
-            include('interpolatableText'),
-            (r'\\/', String.Regex),
-            (r'[^/]', String.Regex)
-            ],
-
-        'squareRegexp': [
-            (r'(?<!\\)][oxpniums]*', String.Regex, '#pop'),
-            include('interpolatableText'),
-            (r'\\]', String.Regex),
-            (r'[^\]]', String.Regex)
-            ],
-
-        'squareText': [
-            (r'(?<!\\)]', String, '#pop'),
-            include('interpolatableText'),
-            (r'[^\]]', String)
-            ],
+    *New in Pygments 1.5.*
+    """
+    name = 'Fancy'
+    filenames = ['*.fy', '*.fancypack']
+    aliases = ['fancy', 'fy']
+    mimetypes = ['text/x-fancysrc']
 
+    tokens = {
+        # copied from PerlLexer:
+        'balanced-regex': [
+            (r'/(\\\\|\\/|[^/])*/[egimosx]*', String.Regex, '#pop'),
+            (r'!(\\\\|\\!|[^!])*![egimosx]*', String.Regex, '#pop'),
+            (r'\\(\\\\|[^\\])*\\[egimosx]*', String.Regex, '#pop'),
+            (r'{(\\\\|\\}|[^}])*}[egimosx]*', String.Regex, '#pop'),
+            (r'<(\\\\|\\>|[^>])*>[egimosx]*', String.Regex, '#pop'),
+            (r'\[(\\\\|\\\]|[^\]])*\][egimosx]*', String.Regex, '#pop'),
+            (r'\((\\\\|\\\)|[^\)])*\)[egimosx]*', String.Regex, '#pop'),
+            (r'@(\\\\|\\\@|[^\@])*@[egimosx]*', String.Regex, '#pop'),
+            (r'%(\\\\|\\\%|[^\%])*%[egimosx]*', String.Regex, '#pop'),
+            (r'\$(\\\\|\\\$|[^\$])*\$[egimosx]*', String.Regex, '#pop'),
+        ],
         'root': [
-            (r'\n', Text),
             (r'\s+', Text),
 
-            # Comments
-            (r';(.*?)\n', Comment),
-            (r'\A#!(.*?)\n', Comment),
-
-            #Regexps
-            (r'#/', String.Regex, 'slashRegexp'),
-            (r'#r\[', String.Regex, 'squareRegexp'),
-
-            #Symbols
-            (r':[a-zA-Z0-9_!:?]+', String.Symbol),
-            (r'[a-zA-Z0-9_!:?]+:(?![a-zA-Z0-9_!?])', String.Other),
-            (r':"(\\\\|\\"|[^"])*"', String.Symbol),
-
-            #Documentation
-            (r'((?<=fn\()|(?<=fnx\()|(?<=method\()|(?<=macro\()|(?<=lecro\()'
-             r'|(?<=syntax\()|(?<=dmacro\()|(?<=dlecro\()|(?<=dlecrox\()'
-             r'|(?<=dsyntax\())[\s\n\r]*"', String.Doc, 'documentation'),
-
-            #Text
-            (r'"', String, 'text'),
-            (r'#\[', String, 'squareText'),
-
-            #Mimic
-            (r'[a-zA-Z0-9_][a-zA-Z0-9!?_:]+(?=\s*=.*mimic\s)', Name.Entity),
-
-            #Assignment
-            (r'[a-zA-Z_][a-zA-Z0-9_!:?]*(?=[\s]*[+*/-]?=[^=].*($|\.))', Name.Variable),
+            # balanced delimiters (copied from PerlLexer):
+            (r's{(\\\\|\\}|[^}])*}\s*', String.Regex, 'balanced-regex'),
+            (r's<(\\\\|\\>|[^>])*>\s*', String.Regex, 'balanced-regex'),
+            (r's\[(\\\\|\\\]|[^\]])*\]\s*', String.Regex, 'balanced-regex'),
+            (r's\((\\\\|\\\)|[^\)])*\)\s*', String.Regex, 'balanced-regex'),
+            (r'm?/(\\\\|\\/|[^/\n])*/[gcimosx]*', String.Regex),
+            (r'm(?=[/!\\{<\[\(@%\$])', String.Regex, 'balanced-regex'),
 
+            # Comments
+            (r'#(.*?)\n', Comment.Single),
+            # Symbols
+            (r'\'([^\'\s\[\]\(\)\{\}]+|\[\])', String.Symbol),
+            # Multi-line DoubleQuotedString
+            (r'"""(\\\\|\\"|[^"])*"""', String),
+            # DoubleQuotedString
+            (r'"(\\\\|\\"|[^"])*"', String),
             # keywords
-            (r'(break|cond|continue|do|ensure|for|for:dict|for:set|if|let|'
-             r'loop|p:for|p:for:dict|p:for:set|return|unless|until|while|'
-             r'with)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
-
-            # Origin
-            (r'(eval|mimic|print|println)(?![a-zA-Z0-9!:_?])', Keyword),
-
-            # Base
-            (r'(cell\?|cellNames|cellOwner\?|cellOwner|cells|cell|'
-             r'documentation|hash|identity|mimic|removeCell\!|undefineCell\!)'
-             r'(?![a-zA-Z0-9!:_?])', Keyword),
-
-            # Ground
-            (r'(stackTraceAsText)(?![a-zA-Z0-9!:_?])', Keyword),
-
-            #DefaultBehaviour Literals
-            (r'(dict|list|message|set)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
-
-            #DefaultBehaviour Case
-            (r'(case|case:and|case:else|case:nand|case:nor|case:not|case:or|'
-             r'case:otherwise|case:xor)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
-
-            #DefaultBehaviour Reflection
-            (r'(asText|become\!|derive|freeze\!|frozen\?|in\?|is\?|kind\?|'
-             r'mimic\!|mimics|mimics\?|prependMimic\!|removeAllMimics\!|'
-             r'removeMimic\!|same\?|send|thaw\!|uniqueHexId)'
-             r'(?![a-zA-Z0-9!:_?])', Keyword),
-
-            #DefaultBehaviour Aspects
-            (r'(after|around|before)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
-
-            # DefaultBehaviour
-            (r'(kind|cellDescriptionDict|cellSummary|genSym|inspect|notice)'
-             r'(?![a-zA-Z0-9!:_?])', Keyword),
-            (r'(use|destructuring)', Keyword.Reserved),
-
-            #DefaultBehavior BaseBehavior
-            (r'(cell\?|cellOwner\?|cellOwner|cellNames|cells|cell|'
-             r'documentation|identity|removeCell!|undefineCell)'
-             r'(?![a-zA-Z0-9!:_?])', Keyword),
-
-            #DefaultBehavior Internal
-            (r'(internal:compositeRegexp|internal:concatenateText|'
-             r'internal:createDecimal|internal:createNumber|'
-             r'internal:createRegexp|internal:createText)'
-             r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
-
-            #DefaultBehaviour Conditions
-            (r'(availableRestarts|bind|error\!|findRestart|handle|'
-             r'invokeRestart|rescue|restart|signal\!|warn\!)'
-             r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
-
+            (r'(def|class|try|catch|finally|retry|return|return_local|match|'
+             r'case|->|=>)\b', Keyword),
             # constants
-            (r'(nil|false|true)(?![a-zA-Z0-9!:_?])', Name.Constant),
-
+            (r'(self|super|nil|false|true)\b', Name.Constant),
+            (r'[(){};,/?\|:\\]', Punctuation),
             # names
-            (r'(Arity|Base|Call|Condition|DateTime|Aspects|Pointcut|'
-             r'Assignment|BaseBehavior|Boolean|Case|AndCombiner|Else|'
-             r'NAndCombiner|NOrCombiner|NotCombiner|OrCombiner|XOrCombiner|'
-             r'Conditions|Definitions|FlowControl|Internal|Literals|'
-             r'Reflection|DefaultMacro|DefaultMethod|DefaultSyntax|Dict|'
-             r'FileSystem|Ground|Handler|Hook|IO|IokeGround|Struct|'
-             r'LexicalBlock|LexicalMacro|List|Message|Method|Mixins|'
-             r'NativeMethod|Number|Origin|Pair|Range|Reflector|Regexp Match|'
-             r'Regexp|Rescue|Restart|Runtime|Sequence|Set|Symbol|'
-             r'System|Text|Tuple)(?![a-zA-Z0-9!:_?])', Name.Builtin),
-
+            (r'(Object|Array|Hash|Directory|File|Class|String|Number|'
+             r'Enumerable|FancyEnumerable|Block|TrueClass|NilClass|'
+             r'FalseClass|Tuple|Symbol|Stack|Set|FancySpec|Method|Package|'
+             r'Range)\b', Name.Builtin),
             # functions
-            (ur'(generateMatchMethod|aliasMethod|\u03bb|\u028E|fnx|fn|method|'
-             ur'dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)'
-             ur'(?![a-zA-Z0-9!:_?])', Name.Function),
-
-            # Numbers
-            (r'-?0[xX][0-9a-fA-F]+', Number.Hex),
-            (r'-?(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
-            (r'-?\d+', Number.Integer),
-
-            (r'#\(', Punctuation),
-
-             # Operators
-            (ur'(&&>>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|'
-             ur'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|'
-             ur'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|'
-             ur'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|'
-             ur'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|'
-             ur'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|'
-             ur'\?|#|\u2260|\u2218|\u2208|\u2209)', Operator),
-            (r'(and|nand|or|xor|nor|return|import)(?![a-zA-Z0-9_!?])',
-             Operator),
-
-            # Punctuation
-            (r'(\`\`|\`|\'\'|\'|\.|\,|@|@@|\[|\]|\(|\)|{|})', Punctuation),
-
-            #kinds
-            (r'[A-Z][a-zA-Z0-9_!:?]*', Name.Class),
-
-            #default cellnames
-            (r'[a-z_][a-zA-Z0-9_!:?]*', Name)
+            (r'[a-zA-Z]([a-zA-Z0-9_]|[-+?!=*/^><%])*:', Name.Function),
+            # operators, must be below functions
+            (r'[-+*/~,<>=&!?%^\[\]\.$]+', Operator),
+            ('[A-Z][a-zA-Z0-9_]*', Name.Constant),
+            ('@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Instance),
+            ('@@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Class),
+            ('@@?', Operator),
+            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            # numbers - / checks are necessary to avoid mismarking regexes,
+            # see comment in RubyLexer
+            (r'(0[oO]?[0-7]+(?:_[0-7]+)*)(\s*)([/?])?',
+             bygroups(Number.Oct, Text, Operator)),
+            (r'(0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*)(\s*)([/?])?',
+             bygroups(Number.Hex, Text, Operator)),
+            (r'(0[bB][01]+(?:_[01]+)*)(\s*)([/?])?',
+             bygroups(Number.Bin, Text, Operator)),
+            (r'([\d]+(?:_\d+)*)(\s*)([/?])?',
+             bygroups(Number.Integer, Text, Operator)),
+            (r'\d+([eE][+-]?[0-9]+)|\d+\.\d+([eE][+-]?[0-9]+)?', Number.Float),
+            (r'\d+', Number.Integer)
         ]
     }
index 4740569c698adcd0c7405bcadfee82f9651c2851..11964a7718b071b10d9964b8071e42f8d4c00862 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for assembly languages.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -13,7 +13,8 @@ import re
 
 from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingLexer
 from pygments.lexers.compiled import DLexer, CppLexer, CLexer
-from pygments.token import *
+from pygments.token import Text, Name, Number, String, Comment, Punctuation, \
+     Other, Keyword, Operator
 
 __all__ = ['GasLexer', 'ObjdumpLexer','DObjdumpLexer', 'CppObjdumpLexer',
            'CObjdumpLexer', 'LlvmLexer', 'NasmLexer']
@@ -72,6 +73,7 @@ class GasLexer(RegexLexer):
             ('%' + identifier, Name.Variable),
             # Numeric constants
             ('$'+number, Number.Integer),
+            (r"$'(.|\\')'", String.Char),
             (r'[\r\n]+', Text, '#pop'),
             (r'#.*?$', Comment, '#pop'),
             include('punctuation'),
@@ -88,7 +90,11 @@ class GasLexer(RegexLexer):
     }
 
     def analyse_text(text):
-        return re.match(r'^\.\w+', text, re.M)
+        if re.match(r'^\.(text|data|section)', text, re.M):
+            return True
+        elif re.match(r'^\.\w+', text, re.M):
+            return 0.1
+
 
 class ObjdumpLexer(RegexLexer):
     """
@@ -130,17 +136,17 @@ class ObjdumpLexer(RegexLexer):
             ('( *)('+hex+r'+:)(\t)((?:'+hex+hex+' )+)$',
                 bygroups(Text, Name.Label, Text, Number.Hex)),
             # Skipped a few bytes
-            ('\t\.\.\.$', Text),
+            (r'\t\.\.\.$', Text),
             # Relocation line
             # (With offset)
-            ('(\t\t\t)('+hex+'+:)( )([^\t]+)(\t)(.*?)([-+])(0x' + hex + '+)$',
+            (r'(\t\t\t)('+hex+r'+:)( )([^\t]+)(\t)(.*?)([-+])(0x' + hex + '+)$',
                 bygroups(Text, Name.Label, Text, Name.Property, Text,
                          Name.Constant, Punctuation, Number.Hex)),
             # (Without offset)
-            ('(\t\t\t)('+hex+'+:)( )([^\t]+)(\t)(.*?)$',
+            (r'(\t\t\t)('+hex+r'+:)( )([^\t]+)(\t)(.*?)$',
                 bygroups(Text, Name.Label, Text, Name.Property, Text,
                          Name.Constant)),
-            ('[^\n]+\n', Other)
+            (r'[^\n]+\n', Other)
         ]
     }
 
@@ -296,7 +302,7 @@ class NasmLexer(RegexLexer):
     binn = r'[01]+b'
     decn = r'[0-9]+'
     floatn = decn + r'\.e?' + decn
-    string = r'"(\\"|[^"])*"|' + r"'(\\'|[^'])*'"
+    string = r'"(\\"|[^"\n])*"|' + r"'(\\'|[^'\n])*'|" + r"`(\\`|[^`\n])*`"
     declkw = r'(?:res|d)[bwdqt]|times'
     register = (r'[a-d][lh]|e?[a-d]x|e?[sb]p|e?[sd]i|[c-gs]s|st[0-7]|'
                 r'mm[0-7]|cr[0-4]|dr[0-367]|tr[3-7]')
index 5c10a785af4f177385d439e4e6d7527249d24357..04077ec6e53c54720eb00e3e3894b1b9b4b206d3 100644 (file)
@@ -5,28 +5,29 @@
 
     Lexers for compiled languages.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
 import re
+from string import Template
 
-from pygments.scanner import Scanner
 from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
-                           this, combined
+     this, combined
 from pygments.util import get_bool_opt, get_list_opt
-from pygments.token import \
-     Text, Comment, Operator, Keyword, Name, String, Number, Punctuation, \
-     Error
+from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
+     Number, Punctuation, Error, Literal
+from pygments.scanner import Scanner
 
 # backwards compatibility
 from pygments.lexers.functional import OcamlLexer
+from pygments.lexers.jvm import JavaLexer, ScalaLexer
 
-__all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'JavaLexer',
-           'ScalaLexer', 'DylanLexer', 'OcamlLexer', 'ObjectiveCLexer',
-           'FortranLexer', 'GLShaderLexer', 'PrologLexer', 'CythonLexer',
-           'ValaLexer', 'OocLexer', 'GoLexer', 'FelixLexer', 'AdaLexer',
-           'Modula2Lexer', 'BlitzMaxLexer']
+__all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'ECLexer',
+           'DylanLexer', 'ObjectiveCLexer', 'FortranLexer', 'GLShaderLexer',
+           'PrologLexer', 'CythonLexer', 'ValaLexer', 'OocLexer', 'GoLexer',
+           'FelixLexer', 'AdaLexer', 'Modula2Lexer', 'BlitzMaxLexer',
+           'NimrodLexer', 'FantomLexer']
 
 
 class CLexer(RegexLexer):
@@ -35,7 +36,7 @@ class CLexer(RegexLexer):
     """
     name = 'C'
     aliases = ['c']
-    filenames = ['*.c', '*.h']
+    filenames = ['*.c', '*.h', '*.idc']
     mimetypes = ['text/x-chdr', 'text/x-csrc']
 
     #: optional Comment or Whitespace
@@ -47,9 +48,12 @@ class CLexer(RegexLexer):
             ('^#if\s+0', Comment.Preproc, 'if0'),
             ('^#', Comment.Preproc, 'macro'),
             # or with whitespace
-            ('^' + _ws + r'#if\s+0', Comment.Preproc, 'if0'),
-            ('^' + _ws + '#', Comment.Preproc, 'macro'),
-            (r'^(\s*)([a-zA-Z_][a-zA-Z0-9_]*:(?!:))', bygroups(Text, Name.Label)),
+            ('^(' + _ws + r')(#if\s+0)',
+             bygroups(using(this), Comment.Preproc), 'if0'),
+            ('^(' + _ws + ')(#)',
+             bygroups(using(this), Comment.Preproc), 'macro'),
+            (r'^(\s*)([a-zA-Z_][a-zA-Z0-9_]*:(?!:))',
+             bygroups(Text, Name.Label)),
             (r'\n', Text),
             (r'\s+', Text),
             (r'\\\n', Text), # line continuation
@@ -169,7 +173,8 @@ class CppLexer(RegexLexer):
     """
     name = 'C++'
     aliases = ['cpp', 'c++']
-    filenames = ['*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx']
+    filenames = ['*.cpp', '*.hpp', '*.c++', '*.h++',
+                 '*.cc', '*.hh', '*.cxx', '*.hxx']
     mimetypes = ['text/x-c++hdr', 'text/x-c++src']
 
     #: optional Comment or Whitespace
@@ -181,8 +186,10 @@ class CppLexer(RegexLexer):
             ('^#if\s+0', Comment.Preproc, 'if0'),
             ('^#', Comment.Preproc, 'macro'),
             # or with whitespace
-            ('^' + _ws + r'#if\s+0', Comment.Preproc, 'if0'),
-            ('^' + _ws + '#', Comment.Preproc, 'macro'),
+            ('^(' + _ws + r')(#if\s+0)',
+             bygroups(using(this), Comment.Preproc), 'if0'),
+            ('^(' + _ws + ')(#)',
+             bygroups(using(this), Comment.Preproc), 'macro'),
             (r'\n', Text),
             (r'\s+', Text),
             (r'\\\n', Text), # line continuation
@@ -216,7 +223,7 @@ class CppLexer(RegexLexer):
              r'multiple_inheritance|m128i|m128d|m128|m64|interface|'
              r'identifier|forceinline|event|assume)\b', Keyword.Reserved),
             # Offload C++ extensions, http://offload.codeplay.com/
-            (r'(__offload|__blockingoffload|__outer)\b', Keyword.Psuedo),
+            (r'(__offload|__blockingoffload|__outer)\b', Keyword.Pseudo),
             (r'(true|false)\b', Keyword.Constant),
             (r'NULL\b', Name.Builtin),
             ('[a-zA-Z_][a-zA-Z0-9_]*:(?!:)', Name.Label),
@@ -250,6 +257,156 @@ class CppLexer(RegexLexer):
     }
 
 
+class ECLexer(RegexLexer):
+    """
+    For eC source code with preprocessor directives.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'eC'
+    aliases = ['ec']
+    filenames = ['*.ec', '*.eh']
+    mimetypes = ['text/x-echdr', 'text/x-ecsrc']
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'whitespace': [
+            # preprocessor directives: without whitespace
+            ('^#if\s+0', Comment.Preproc, 'if0'),
+            ('^#', Comment.Preproc, 'macro'),
+            # or with whitespace
+            ('^' + _ws + r'#if\s+0', Comment.Preproc, 'if0'),
+            ('^' + _ws + '#', Comment.Preproc, 'macro'),
+            (r'^(\s*)([a-zA-Z_][a-zA-Z0-9_]*:(?!:))', bygroups(Text, Name.Label)),
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text), # line continuation
+            (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+        ],
+        'statements': [
+            (r'L?"', String, 'string'),
+            (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
+            (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
+            (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
+            (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
+            (r'0[0-7]+[LlUu]*', Number.Oct),
+            (r'\d+[LlUu]*', Number.Integer),
+            (r'\*/', Error),
+            (r'[~!%^&*+=|?:<>/-]', Operator),
+            (r'[()\[\],.]', Punctuation),
+            (r'\b(case)(.+?)(:)', bygroups(Keyword, using(this), Text)),
+            (r'(auto|break|case|const|continue|default|do|else|enum|extern|'
+             r'for|goto|if|register|restricted|return|sizeof|static|struct|'
+             r'switch|typedef|union|volatile|virtual|while|class|private|public|'
+             r'property|import|delete|new|new0|renew|renew0|define|get|set|remote|dllexport|dllimport|stdcall|'
+             r'subclass|__on_register_module|namespace|using|typed_object|any_object|incref|register|watch|'
+             r'stopwatching|firewatchers|watchable|class_designer|class_fixed|class_no_expansion|isset|'
+             r'class_default_property|property_category|class_data|class_property|virtual|thisclass|'
+             r'dbtable|dbindex|database_open|dbfield)\b', Keyword),
+            (r'(int|long|float|short|double|char|unsigned|signed|void)\b',
+             Keyword.Type),
+            (r'(uint|uint16|uint32|uint64|bool|byte|unichar|int64)\b',
+             Keyword.Type),
+            (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
+            (r'(_{0,2}inline|naked|restrict|thread|typename)\b', Keyword.Reserved),
+            (r'__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|'
+             r'declspec|finally|int64|try|leave)\b', Keyword.Reserved),
+            (r'(true|false|null|value|this|NULL)\b', Name.Builtin),
+            ('[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'(\s*\([^;]*?\))'                      # signature
+             r'(' + _ws + r')({)',
+             bygroups(using(this), Name.Function, using(this), using(this),
+                      Punctuation),
+             'function'),
+            # function declarations
+            (r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))'    # return arguments
+             r'([a-zA-Z_][a-zA-Z0-9_]*)'             # method name
+             r'(\s*\([^;]*?\))'                      # signature
+             r'(' + _ws + r')(;)',
+             bygroups(using(this), Name.Function, using(this), using(this),
+                      Punctuation)),
+            ('', Text, 'statement'),
+        ],
+        'classname': [
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop'),
+            # template specification
+            (r'\s*(?=>)', Text, '#pop'),
+        ],
+        'statement' : [
+            include('whitespace'),
+            include('statements'),
+            ('[{}]', Punctuation),
+            (';', Punctuation, '#pop'),
+        ],
+        'function': [
+            include('whitespace'),
+            include('statements'),
+            (';', Punctuation),
+            ('{', Punctuation, '#push'),
+            ('}', 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*#el(?:se|if).*\n', Comment.Preproc, '#pop'),
+            (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
+            (r'.*?\n', Comment),
+        ]
+    }
+
+    stdlib_types = ['size_t', 'ssize_t', 'off_t', 'wchar_t', 'ptrdiff_t',
+            'sig_atomic_t', 'fpos_t', 'clock_t', 'time_t', 'va_list',
+            'jmp_buf', 'FILE', 'DIR', 'div_t', 'ldiv_t', 'mbstate_t',
+            'wctrans_t', 'wint_t', 'wctype_t']
+    c99_types = ['_Bool', '_Complex', 'int8_t', 'int16_t', 'int32_t', 'int64_t',
+            'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'int_least8_t',
+            'int_least16_t', 'int_least32_t', 'int_least64_t',
+            'uint_least8_t', 'uint_least16_t', 'uint_least32_t',
+            'uint_least64_t', 'int_fast8_t', 'int_fast16_t', 'int_fast32_t',
+            'int_fast64_t', 'uint_fast8_t', 'uint_fast16_t', 'uint_fast32_t',
+            'uint_fast64_t', 'intptr_t', 'uintptr_t', 'intmax_t', 'uintmax_t']
+
+    def __init__(self, **options):
+        self.stdlibhighlighting = get_bool_opt(options,
+                'stdlibhighlighting', True)
+        self.c99highlighting = get_bool_opt(options,
+                'c99highlighting', True)
+        RegexLexer.__init__(self, **options)
+
+    def get_tokens_unprocessed(self, text):
+        for index, token, value in \
+            RegexLexer.get_tokens_unprocessed(self, text):
+            if token is Name:
+                if self.stdlibhighlighting and value in self.stdlib_types:
+                    token = Keyword.Type
+                elif self.c99highlighting and value in self.c99_types:
+                    token = Keyword.Type
+            yield index, token, value
+
+
 class DLexer(RegexLexer):
     """
     For D source.
@@ -884,164 +1041,6 @@ class DelphiLexer(Lexer):
             yield scanner.start_pos, token, scanner.match or ''
 
 
-class JavaLexer(RegexLexer):
-    """
-    For `Java <http://www.sun.com/java/>`_ source code.
-    """
-
-    name = 'Java'
-    aliases = ['java']
-    filenames = ['*.java']
-    mimetypes = ['text/x-java']
-
-    flags = re.MULTILINE | re.DOTALL
-
-    #: optional Comment or Whitespace
-    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
-
-    tokens = {
-        'root': [
-            # method names
-            (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
-             r'([a-zA-Z_][a-zA-Z0-9_]*)'                    # method name
-             r'(\s*)(\()',                                  # signature start
-             bygroups(using(this), Name.Function, Text, Operator)),
-            (r'[^\S\n]+', Text),
-            (r'//.*?\n', Comment.Single),
-            (r'/\*.*?\*/', Comment.Multiline),
-            (r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
-            (r'(assert|break|case|catch|continue|default|do|else|finally|for|'
-             r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b',
-             Keyword),
-            (r'(abstract|const|enum|extends|final|implements|native|private|'
-             r'protected|public|static|strictfp|super|synchronized|throws|'
-             r'transient|volatile)\b', Keyword.Declaration),
-            (r'(boolean|byte|char|double|float|int|long|short|void)\b',
-             Keyword.Type),
-            (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
-            (r'(true|false|null)\b', Keyword.Constant),
-            (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), 'class'),
-            (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
-            (r'"(\\\\|\\"|[^"])*"', String),
-            (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
-            (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
-            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
-            (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
-            (r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
-            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
-            (r'0x[0-9a-f]+', Number.Hex),
-            (r'[0-9]+L?', Number.Integer),
-            (r'\n', Text)
-        ],
-        'class': [
-            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
-        ],
-        'import': [
-            (r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
-        ],
-    }
-
-
-class ScalaLexer(RegexLexer):
-    """
-    For `Scala <http://www.scala-lang.org>`_ source code.
-    """
-
-    name = 'Scala'
-    aliases = ['scala']
-    filenames = ['*.scala']
-    mimetypes = ['text/x-scala']
-
-    flags = re.MULTILINE | re.DOTALL
-
-    #: optional Comment or Whitespace
-    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
-
-    # don't use raw unicode strings!
-    op = u'[-~\\^\\*!%&\\\\<>\\|+=:/?@\u00a6-\u00a7\u00a9\u00ac\u00ae\u00b0-\u00b1\u00b6\u00d7\u00f7\u03f6\u0482\u0606-\u0608\u060e-\u060f\u06e9\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0cf1-\u0cf2\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcf\u109e-\u109f\u1360\u1390-\u1399\u1940\u19e0-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2044\u2052\u207a-\u207c\u208a-\u208c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u2140-\u2144\u214a-\u214d\u214f\u2190-\u2328\u232b-\u244a\u249c-\u24e9\u2500-\u2767\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2b54\u2ce5-\u2cea\u2e80-\u2ffb\u3004\u3012-\u3013\u3020\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ufb29\ufdfd\ufe62\ufe64-\ufe66\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe4\uffe8-\uffee\ufffc-\ufffd]+'
-
-    letter = u'[a-zA-Z\\$_\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02af\u0370-\u0373\u0376-\u0377\u037b-\u037d\u0386\u0388-\u03f5\u03f7-\u0481\u048a-\u0556\u0561-\u0587\u05d0-\u05f2\u0621-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u0904-\u0939\u093d\u0950\u0958-\u0961\u0972-\u097f\u0985-\u09b9\u09bd\u09ce\u09dc-\u09e1\u09f0-\u09f1\u0a05-\u0a39\u0a59-\u0a5e\u0a72-\u0a74\u0a85-\u0ab9\u0abd\u0ad0-\u0ae1\u0b05-\u0b39\u0b3d\u0b5c-\u0b61\u0b71\u0b83-\u0bb9\u0bd0\u0c05-\u0c3d\u0c58-\u0c61\u0c85-\u0cb9\u0cbd\u0cde-\u0ce1\u0d05-\u0d3d\u0d60-\u0d61\u0d7a-\u0d7f\u0d85-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0eb0\u0eb2-\u0eb3\u0ebd-\u0ec4\u0edc-\u0f00\u0f40-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10fa\u1100-\u135a\u1380-\u138f\u13a0-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u16ee-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u1770\u1780-\u17b3\u17dc\u1820-\u1842\u1844-\u18a8\u18aa-\u191c\u1950-\u19a9\u19c1-\u19c7\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1d00-\u1d2b\u1d62-\u1d77\u1d79-\u1d9a\u1e00-\u1fbc\u1fbe\u1fc2-\u1fcc\u1fd0-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ffc\u2071\u207f\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c7c\u2c80-\u2ce4\u2d00-\u2d65\u2d80-\u2dde\u3006-\u3007\u3021-\u3029\u3038-\u303a\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\ua014\ua016-\ua48c\ua500-\ua60b\ua610-\ua61f\ua62a-\ua66e\ua680-\ua697\ua722-\ua76f\ua771-\ua787\ua78b-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua90a-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uac00-\ud7a3\uf900-\ufb1d\ufb1f-\ufb28\ufb2a-\ufd3d\ufd50-\ufdfb\ufe70-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uff6f\uff71-\uff9d\uffa0-\uffdc]'
-
-    upper = u'[A-Z\\$_\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038f\u0391-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0531-\u0556\u10a0-\u10c5\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59-\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c6f\u2c72\u2c75\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]'
-
-    idrest = ur'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op)
-
-    tokens = {
-        'root': [
-            # method names
-            (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'),
-            (ur"'%s" % idrest, Text.Symbol),
-            (r'[^\S\n]+', Text),
-            (r'//.*?\n', Comment.Single),
-            (r'/\*', Comment.Multiline, 'comment'),
-            (ur'@%s' % idrest, Name.Decorator),
-            (ur'(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|'
-             ur'f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|'
-             ur'lazy|match|new|override|pr(?:ivate|otected)'
-             ur'|re(?:quires|turn)|s(?:ealed|uper)|'
-             ur't(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\b|'
-             u'(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\b|(?=\\s)|$)', Keyword),
-            (ur':(?!%s)' % op, Keyword, 'type'),
-            (ur'%s%s\b' % (upper, idrest), Name.Class),
-            (r'(true|false|null)\b', Keyword.Constant),
-            (r'(import|package)(\s+)', bygroups(Keyword, Text), 'import'),
-            (r'(type)(\s+)', bygroups(Keyword, Text), 'type'),
-            (r'"""(?:.|\n)*?"""', String),
-            (r'"(\\\\|\\"|[^"])*"', String),
-            (ur"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
-#            (ur'(\.)(%s|%s|`[^`]+`)' % (idrest, op), bygroups(Operator,
-#             Name.Attribute)),
-            (idrest, Name),
-            (r'`[^`]+`', Name),
-            (r'\[', Operator, 'typeparam'),
-            (r'[\(\)\{\};,.]', Operator),
-            (op, Operator),
-            (ur'([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?',
-             Number.Float),
-            (r'0x[0-9a-f]+', Number.Hex),
-            (r'[0-9]+L?', Number.Integer),
-            (r'\n', Text)
-        ],
-        'class': [
-            (ur'(%s|%s|`[^`]+`)(\s*)(\[)' % (idrest, op),
-             bygroups(Name.Class, Text, Operator), 'typeparam'),
-            (r'[\s\n]+', Text),
-            (r'{', Operator, '#pop'),
-            (r'\(', Operator, '#pop'),
-            (ur'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'),
-        ],
-        'type': [
-            (r'\s+', Text),
-            (u'<[%:]|>:|[#_\u21D2]|forSome|type', Keyword),
-            (r'([,\);}]|=>|=)([\s\n]*)', bygroups(Operator, Text), '#pop'),
-            (r'[\(\{]', Operator, '#push'),
-            (ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)(\[)' %
-             (idrest, op, idrest, op),
-             bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')),
-            (ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)$' %
-             (idrest, op, idrest, op),
-             bygroups(Keyword.Type, Text), '#pop'),
-            (ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
-        ],
-        'typeparam': [
-            (r'[\s\n,]+', Text),
-            (u'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword),
-            (r'([\]\)\}])', Operator, '#pop'),
-            (r'[\(\[\{]', Operator, '#push'),
-            (ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
-        ],
-        'comment': [
-            (r'[^/\*]+', Comment.Multiline),
-            (r'/\*', Comment.Multiline, '#push'),
-            (r'\*/', Comment.Multiline, '#pop'),
-            (r'[*/]', Comment.Multiline)
-        ],
-        'import': [
-            (ur'(%s|\.)+' % idrest, Name.Namespace, '#pop')
-        ],
-    }
-
-
 class DylanLexer(RegexLexer):
     """
     For the `Dylan <http://www.opendylan.org/>`_ language.
@@ -1059,7 +1058,7 @@ class DylanLexer(RegexLexer):
     tokens = {
         'root': [
             (r'\b(subclass|abstract|block|c(on(crete|stant)|lass)|domain'
-             r'|ex(c(eption|lude)|port)|f(unction(|al))|generic|handler'
+             r'|ex(c(eption|lude)|port)|f(unction(al)?)|generic|handler'
              r'|i(n(herited|line|stance|terface)|mport)|library|m(acro|ethod)'
              r'|open|primary|sealed|si(deways|ngleton)|slot'
              r'|v(ariable|irtual))\b', Name.Builtin),
@@ -1069,7 +1068,7 @@ class DylanLexer(RegexLexer):
             (r'"', String, 'string'),
             (r"'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
             (r'=>|\b(a(bove|fterwards)|b(e(gin|low)|y)|c(ase|leanup|reate)'
-             r'|define|else(|if)|end|f(inally|or|rom)|i[fn]|l(et|ocal)|otherwise'
+             r'|define|else(if)?|end|f(inally|or|rom)|i[fn]|l(et|ocal)|otherwise'
              r'|rename|s(elect|ignal)|t(hen|o)|u(n(less|til)|se)|wh(en|ile))\b',
              Keyword),
             (r'([ \t])([!\$%&\*\/:<=>\?~_^a-zA-Z0-9.+\-]*:)',
@@ -1081,8 +1080,10 @@ class DylanLexer(RegexLexer):
             (r'\$[a-zA-Z0-9-]+', Name.Constant),
             (r'[!$%&*/:<>=?~^.+\[\]{}-]+', Operator),
             (r'\s+', Text),
+            (r'#"[a-zA-Z0-9-]+"', Keyword),
             (r'#[a-zA-Z0-9-]+', Keyword),
-            (r'[a-zA-Z0-9-]+', Name.Variable),
+            (r'#(\(|\[)', Punctuation),
+            (r'[a-zA-Z0-9-_]+', Name.Variable),
         ],
         'string': [
             (r'"', String, '#pop'),
@@ -1159,6 +1160,13 @@ class ObjectiveCLexer(RegexLexer):
              bygroups(using(this), Name.Function,
                       using(this), Text, Punctuation),
              'function'),
+            # methods
+            (r'^([-+])(\s*)'                         # method marker
+             r'(\(.*?\))?(\s*)'                      # return type
+             r'([a-zA-Z$_][a-zA-Z0-9$_]*:?)',        # begin of method name
+             bygroups(Keyword, Text, using(this),
+                      Text, Name.Function),
+             'method'),
             # function declarations
             (r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))'    # return arguments
              r'([a-zA-Z$_][a-zA-Z0-9$_]*)'           # method name
@@ -1202,6 +1210,15 @@ class ObjectiveCLexer(RegexLexer):
             ('{', Punctuation, '#push'),
             ('}', Punctuation, '#pop'),
         ],
+        'method': [
+            include('whitespace'),
+            (r'(\(.*?\))([a-zA-Z$_][a-zA-Z0-9$_]*)', bygroups(using(this),
+                                                              Name.Variable)),
+            (r'[a-zA-Z$_][a-zA-Z0-9$_]*:', Name.Function),
+            (';', Punctuation, '#pop'),
+            ('{', Punctuation, 'function'),
+            ('', Text, '#pop'),
+        ],
         'string': [
             (r'"', String, '#pop'),
             (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
@@ -1225,21 +1242,25 @@ class ObjectiveCLexer(RegexLexer):
     }
 
     def analyse_text(text):
-        if '@"' in text: # strings
+        if '@import' in text or '@interface' in text or \
+            '@implementation' in text:
+            return True
+        elif '@"' in text: # strings
             return True
-        if re.match(r'\[[a-zA-Z0-9.]:', text): # message
+        elif re.match(r'\[[a-zA-Z0-9.]:', text): # message
             return True
         return False
 
+
 class FortranLexer(RegexLexer):
-    '''
+    """
     Lexer for FORTRAN 90 code.
 
     *New in Pygments 0.10.*
-    '''
+    """
     name = 'Fortran'
     aliases = ['fortran']
-    filenames = ['*.f', '*.f90']
+    filenames = ['*.f', '*.f90', '*.F', '*.F90']
     mimetypes = ['text/x-fortran']
     flags = re.IGNORECASE
 
@@ -1261,20 +1282,28 @@ class FortranLexer(RegexLexer):
         ],
         'core': [
             # Statements
-            (r'\b(ACCEPT|ALLOCATABLE|ALLOCATE|ARRAY|ASSIGN|BACKSPACE|BLOCK DATA|'
-             r'BYTE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|'
-             r'DEALLOCATE|DECODE|DIMENSION|DO|ENCODE|END FILE|ENDIF|END|ENTRY|'
-             r'EQUIVALENCE|EXIT|EXTERNAL|EXTRINSIC|FORALL|FORMAT|FUNCTION|GOTO|'
-             r'IF|IMPLICIT|INCLUDE|INQUIRE|INTENT|INTERFACE|INTRINSIC|MODULE|'
-             r'NAMELIST|NULLIFY|NONE|OPEN|OPTIONAL|OPTIONS|PARAMETER|PAUSE|'
-             r'POINTER|PRINT|PRIVATE|PROGRAM|PUBLIC|PURE|READ|RECURSIVE|RETURN|'
-             r'REWIND|SAVE|SELECT|SEQUENCE|STOP|SUBROUTINE|TARGET|TYPE|USE|'
-             r'VOLATILE|WHERE|WRITE|WHILE|THEN|ELSE|ENDIF)\s*\b',
+            (r'\b(ACCEPT|ALLOCATABLE|ALLOCATE|ARRAY|ASSIGN|ASYNCHRONOUS|'
+             r'BACKSPACE|BIND|BLOCK DATA|BYTE|CALL|CASE|CLOSE|COMMON|CONTAINS|'
+             r'CONTINUE|CYCLE|DATA|DEALLOCATE|DECODE|DEFERRED|DIMENSION|DO|'
+             r'ELSE|ENCODE|END FILE|ENDIF|END|ENTRY|ENUMERATOR|EQUIVALENCE|'
+             r'EXIT|EXTERNAL|EXTRINSIC|FINAL|FORALL|FORMAT|FUNCTION|GENERIC|'
+             r'GOTO|IF|IMPLICIT|IMPORT|INCLUDE|INQUIRE|INTENT|INTERFACE|'
+             r'INTRINSIC|MODULE|NAMELIST|NULLIFY|NONE|NON_INTRINSIC|'
+             r'NON_OVERRIDABLE|NOPASS|OPEN|OPTIONAL|OPTIONS|PARAMETER|PASS|'
+             r'PAUSE|POINTER|PRINT|PRIVATE|PROGRAM|PROTECTED|PUBLIC|PURE|READ|'
+             r'RECURSIVE|RETURN|REWIND|SAVE|SELECT|SEQUENCE|STOP|SUBROUTINE|'
+             r'TARGET|THEN|TYPE|USE|VALUE|VOLATILE|WHERE|WRITE|WHILE)\s*\b',
              Keyword),
 
             # Data Types
             (r'\b(CHARACTER|COMPLEX|DOUBLE PRECISION|DOUBLE COMPLEX|INTEGER|'
-             r'LOGICAL|REAL)\s*\b',
+             r'LOGICAL|REAL|C_INT|C_SHORT|C_LONG|C_LONG_LONG|C_SIGNED_CHAR|'
+             r'C_SIZE_T|C_INT8_T|C_INT16_T|C_INT32_T|C_INT64_T|C_INT_LEAST8_T|'
+             r'C_INT_LEAST16_T|C_INT_LEAST32_T|C_INT_LEAST64_T|C_INT_FAST8_T|'
+             r'C_INT_FAST16_T|C_INT_FAST32_T|C_INT_FAST64_T|C_INTMAX_T|'
+             r'C_INTPTR_T|C_FLOAT|C_DOUBLE|C_LONG_DOUBLE|C_FLOAT_COMPLEX|'
+             r'C_DOUBLE_COMPLEX|C_LONG_DOUBLE_COMPLEX|C_BOOL|C_CHAR|C_PTR|'
+             r'C_FUNPTR)\s*\b',
              Keyword.Type),
 
             # Operators
@@ -1286,31 +1315,37 @@ class FortranLexer(RegexLexer):
 
             # Intrinsics
             (r'\b(Abort|Abs|Access|AChar|ACos|AdjustL|AdjustR|AImag|AInt|Alarm|'
-             r'All|Allocated|ALog|AMax|AMin|AMod|And|ANInt|Any|'
-             r'ASin|Associated|ATan|BesJ|BesJN|BesY|BesYN|'
-             r'Bit_Size|BTest|CAbs|CCos|Ceiling|CExp|Char|ChDir|ChMod|CLog|'
-             r'Cmplx|Complex|Conjg|Cos|CosH|Count|CPU_Time|CShift|CSin|CSqRt|'
-             r'CTime|DAbs|DACos|DASin|DATan|Date_and_Time|DbesJ|'
+             r'All|Allocated|ALog|AMax|AMin|AMod|And|ANInt|Any|ASin|Associated|'
+             r'ATan|BesJ|BesJN|BesY|BesYN|Bit_Size|BTest|CAbs|CCos|Ceiling|'
+             r'CExp|Char|ChDir|ChMod|CLog|Cmplx|Command_Argument_Count|Complex|'
+             r'Conjg|Cos|CosH|Count|CPU_Time|CShift|CSin|CSqRt|CTime|C_Funloc|'
+             r'C_Loc|C_Associated|C_Null_Ptr|C_Null_Funptr|C_F_Pointer|'
+             r'C_Null_Char|C_Alert|C_Backspace|C_Form_Feed|C_New_Line|'
+             r'C_Carriage_Return|C_Horizontal_Tab|C_Vertical_Tab|'
+             r'DAbs|DACos|DASin|DATan|Date_and_Time|DbesJ|'
              r'DbesJ|DbesJN|DbesY|DbesY|DbesYN|Dble|DCos|DCosH|DDiM|DErF|DErFC|'
              r'DExp|Digits|DiM|DInt|DLog|DLog|DMax|DMin|DMod|DNInt|Dot_Product|'
              r'DProd|DSign|DSinH|DSin|DSqRt|DTanH|DTan|DTime|EOShift|Epsilon|'
-             r'ErF|ErFC|ETime|Exit|Exp|Exponent|FDate|FGet|FGetC|Float|'
-             r'Floor|Flush|FNum|FPutC|FPut|Fraction|FSeek|FStat|FTell|'
-             r'GError|GetArg|GetCWD|GetEnv|GetGId|GetLog|GetPId|GetUId|'
-             r'GMTime|HostNm|Huge|IAbs|IAChar|IAnd|IArgC|IBClr|IBits|'
+             r'ErF|ErFC|ETime|Exit|Exp|Exponent|Extends_Type_Of|FDate|FGet|'
+             r'FGetC|Float|Floor|Flush|FNum|FPutC|FPut|Fraction|FSeek|FStat|'
+             r'FTell|GError|GetArg|Get_Command|Get_Command_Argument|'
+             r'Get_Environment_Variable|GetCWD|GetEnv|GetGId|GetLog|GetPId|'
+             r'GetUId|GMTime|HostNm|Huge|IAbs|IAChar|IAnd|IArgC|IBClr|IBits|'
              r'IBSet|IChar|IDate|IDiM|IDInt|IDNInt|IEOr|IErrNo|IFix|Imag|'
              r'ImagPart|Index|Int|IOr|IRand|IsaTty|IShft|IShftC|ISign|'
-             r'ITime|Kill|Kind|LBound|Len|Len_Trim|LGe|LGt|Link|LLe|LLt|LnBlnk|'
-             r'Loc|Log|Log|Logical|Long|LShift|LStat|LTime|MatMul|Max|'
-             r'MaxExponent|MaxLoc|MaxVal|MClock|Merge|Min|MinExponent|MinLoc|'
-             r'MinVal|Mod|Modulo|MvBits|Nearest|NInt|Not|Or|Pack|PError|'
+             r'Iso_C_Binding|Is_Iostat_End|Is_Iostat_Eor|ITime|Kill|Kind|'
+             r'LBound|Len|Len_Trim|LGe|LGt|Link|LLe|LLt|LnBlnk|Loc|Log|'
+             r'Logical|Long|LShift|LStat|LTime|MatMul|Max|MaxExponent|MaxLoc|'
+             r'MaxVal|MClock|Merge|Move_Alloc|Min|MinExponent|MinLoc|MinVal|'
+             r'Mod|Modulo|MvBits|Nearest|New_Line|NInt|Not|Or|Pack|PError|'
              r'Precision|Present|Product|Radix|Rand|Random_Number|Random_Seed|'
-             r'Range|Real|RealPart|Rename|Repeat|Reshape|RRSpacing|RShift|Scale|'
-             r'Scan|Second|Selected_Int_Kind|Selected_Real_Kind|Set_Exponent|'
-             r'Shape|Short|Sign|Signal|SinH|Sin|Sleep|Sngl|Spacing|Spread|SqRt|'
-             r'SRand|Stat|Sum|SymLnk|System|System_Clock|Tan|TanH|Time|'
-             r'Tiny|Transfer|Transpose|Trim|TtyNam|UBound|UMask|Unlink|Unpack|'
-             r'Verify|XOr|ZAbs|ZCos|ZExp|ZLog|ZSin|ZSqRt)\s*\b',
+             r'Range|Real|RealPart|Rename|Repeat|Reshape|RRSpacing|RShift|'
+             r'Same_Type_As|Scale|Scan|Second|Selected_Int_Kind|'
+             r'Selected_Real_Kind|Set_Exponent|Shape|Short|Sign|Signal|SinH|'
+             r'Sin|Sleep|Sngl|Spacing|Spread|SqRt|SRand|Stat|Sum|SymLnk|'
+             r'System|System_Clock|Tan|TanH|Time|Tiny|Transfer|Transpose|Trim|'
+             r'TtyNam|UBound|UMask|Unlink|Unpack|Verify|XOr|ZAbs|ZCos|ZExp|'
+             r'ZLog|ZSin|ZSqRt)\s*\b',
              Name.Builtin),
 
             # Booleans
@@ -2129,7 +2164,7 @@ class AdaLexer(RegexLexer):
             include('numbers'),
             (r"'[^']'", String.Character),
             (r'([a-z0-9_]+)(\s*|[(,])', bygroups(Name, using(this))),
-            (r"(<>|=>|:=|[\(\)\|:;,.'])", Punctuation),
+            (r"(<>|=>|:=|[()|:;,.'])", Punctuation),
             (r'[*<>+=/&-]', Operator),
             (r'\n+', Text),
         ],
@@ -2150,8 +2185,8 @@ class AdaLexer(RegexLexer):
         ],
         'end' : [
             ('(if|case|record|loop|select)', Keyword.Reserved),
-            ('"[^"]+"|[a-zA-Z0-9_]+', Name.Function),
-            ('[\n\s]+', Text),
+            ('"[^"]+"|[a-zA-Z0-9_.]+', Name.Function),
+            ('\s+', Text),
             (';', Punctuation, '#pop'),
         ],
         'type_def': [
@@ -2170,11 +2205,12 @@ class AdaLexer(RegexLexer):
         ],
         'import': [
             (r'[a-z0-9_.]+', Name.Namespace, '#pop'),
+            (r'', Text, '#pop'),
         ],
         'formal_part' : [
             (r'\)', Punctuation, '#pop'),
-            (r'([a-z0-9_]+)(\s*)(,|:[^=])', bygroups(Name.Variable,
-                                                     Text, Punctuation)),
+            (r'[a-z0-9_]+', Name.Variable),
+            (r',|:[^=]', Punctuation),
             (r'(in|not|null|out|access)\b', Keyword.Reserved),
             include('root'),
         ],
@@ -2480,3 +2516,376 @@ class BlitzMaxLexer(RegexLexer):
             (r'[^"]+', String.Double),
         ],
     }
+
+
+class NimrodLexer(RegexLexer):
+    """
+    For `Nimrod <http://nimrod-code.org/>`_ source code.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Nimrod'
+    aliases = ['nimrod', 'nim']
+    filenames = ['*.nim', '*.nimrod']
+    mimetypes = ['text/x-nimrod']
+
+    flags = re.MULTILINE | re.IGNORECASE | re.UNICODE
+
+    def underscorize(words):
+        newWords = []
+        new = ""
+        for word in words:
+            for ch in word:
+                new += (ch + "_?")
+            newWords.append(new)
+            new = ""
+        return "|".join(newWords)
+
+    keywords = [
+        'addr', 'and', 'as', 'asm', 'atomic', 'bind', 'block', 'break',
+        'case', 'cast', 'const', 'continue', 'converter', 'discard',
+        'distinct', 'div', 'elif', 'else', 'end', 'enum', 'except', 'finally',
+        'for', 'generic', 'if', 'implies', 'in', 'yield',
+        'is', 'isnot', 'iterator', 'lambda', 'let', 'macro', 'method',
+        'mod', 'not', 'notin', 'object', 'of', 'or', 'out', 'proc',
+        'ptr', 'raise', 'ref', 'return', 'shl', 'shr', 'template', 'try',
+        'tuple', 'type' , 'when', 'while', 'with', 'without', 'xor'
+    ]
+
+    keywordsPseudo = [
+        'nil', 'true', 'false'
+    ]
+
+    opWords = [
+        'and', 'or', 'not', 'xor', 'shl', 'shr', 'div', 'mod', 'in',
+        'notin', 'is', 'isnot'
+    ]
+
+    types = [
+        'int', 'int8', 'int16', 'int32', 'int64', 'float', 'float32', 'float64',
+        'bool', 'char', 'range', 'array', 'seq', 'set', 'string'
+    ]
+
+    tokens = {
+        'root': [
+            (r'##.*$', String.Doc),
+            (r'#.*$', Comment),
+            (r'\*|=|>|<|\+|-|/|@|\$|~|&|%|\!|\?|\||\\|\[|\]', Operator),
+            (r'\.\.|\.|,|\[\.|\.\]|{\.|\.}|\(\.|\.\)|{|}|\(|\)|:|\^|`|;',
+             Punctuation),
+
+            # Strings
+            (r'(?:[\w]+)"', String, 'rdqs'),
+            (r'"""', String, 'tdqs'),
+            ('"', String, 'dqs'),
+
+            # Char
+            ("'", String.Char, 'chars'),
+
+            # Keywords
+            (r'(%s)\b' % underscorize(opWords), Operator.Word),
+            (r'(p_?r_?o_?c_?\s)(?![\(\[\]])', Keyword, 'funcname'),
+            (r'(%s)\b' % underscorize(keywords), Keyword),
+            (r'(%s)\b' % underscorize(['from', 'import', 'include']),
+             Keyword.Namespace),
+            (r'(v_?a_?r)\b', Keyword.Declaration),
+            (r'(%s)\b' % underscorize(types), Keyword.Type),
+            (r'(%s)\b' % underscorize(keywordsPseudo), Keyword.Pseudo),
+            # Identifiers
+            (r'\b((?![_\d])\w)(((?!_)\w)|(_(?!_)\w))*', Name),
+            # Numbers
+            (r'[0-9][0-9_]*(?=([eE.]|\'[fF](32|64)))',
+              Number.Float, ('float-suffix', 'float-number')),
+            (r'0[xX][a-fA-F0-9][a-fA-F0-9_]*', Number.Hex, 'int-suffix'),
+            (r'0[bB][01][01_]*', Number, 'int-suffix'),
+            (r'0o[0-7][0-7_]*', Number.Oct, 'int-suffix'),
+            (r'[0-9][0-9_]*', Number.Integer, 'int-suffix'),
+            # Whitespace
+            (r'\s+', Text),
+            (r'.+$', Error),
+        ],
+        'chars': [
+          (r'\\([\\abcefnrtvl"\']|x[a-fA-F0-9]{2}|[0-9]{1,3})', String.Escape),
+          (r"'", String.Char, '#pop'),
+          (r".", String.Char)
+        ],
+        'strings': [
+            (r'(?<!\$)\$(\d+|#|\w+)+', String.Interpol),
+            (r'[^\\\'"\$\n]+', String),
+            # quotes, dollars and backslashes must be parsed one at a time
+            (r'[\'"\\]', String),
+            # unhandled string formatting sign
+            (r'\$', String)
+            # newlines are an error (use "nl" state)
+        ],
+        'dqs': [
+            (r'\\([\\abcefnrtvl"\']|\n|x[a-fA-F0-9]{2}|[0-9]{1,3})',
+             String.Escape),
+            (r'"', String, '#pop'),
+            include('strings')
+        ],
+        'rdqs': [
+            (r'"(?!")', String, '#pop'),
+            (r'""', String.Escape),
+            include('strings')
+        ],
+        'tdqs': [
+            (r'"""(?!")', String, '#pop'),
+            include('strings'),
+            include('nl')
+        ],
+        'funcname': [
+            (r'((?![\d_])\w)(((?!_)\w)|(_(?!_)\w))*', Name.Function, '#pop'),
+            (r'`.+`', Name.Function, '#pop')
+        ],
+        'nl': [
+            (r'\n', String)
+        ],
+        'float-number': [
+          (r'\.(?!\.)[0-9_]*', Number.Float),
+          (r'[eE][+-]?[0-9][0-9_]*', Number.Float),
+          (r'', Text, '#pop')
+        ],
+        'float-suffix': [
+          (r'\'[fF](32|64)', Number.Float),
+          (r'', Text, '#pop')
+        ],
+        'int-suffix': [
+          (r'\'[iI](32|64)', Number.Integer.Long),
+          (r'\'[iI](8|16)', Number.Integer),
+          (r'', Text, '#pop')
+        ],
+    }
+
+
+class FantomLexer(RegexLexer):
+    """
+    For Fantom source code.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'Fantom'
+    aliases = ['fan']
+    filenames = ['*.fan']
+    mimetypes = ['application/x-fantom']
+
+    # often used regexes
+    def s(str):
+        return Template(str).substitute(
+            dict (
+                pod = r'[\"\w\.]+',
+                eos = r'\n|;',
+                id = r'[a-zA-Z_][a-zA-Z0-9_]*',
+                # all chars which can be part of type definition. Starts with
+                # either letter, or [ (maps), or | (funcs)
+                type = r'(?:\[|[a-zA-Z_]|\|)[:\w\[\]\|\->\?]*?',
+                )
+            )
+
+
+    tokens = {
+        'comments': [
+            (r'(?s)/\*.*?\*/', Comment.Multiline),           #Multiline
+            (r'//.*?\n', Comment.Single),                    #Single line
+            #todo: highlight references in fandocs
+            (r'\*\*.*?\n', Comment.Special),                 #Fandoc
+            (r'#.*\n', Comment.Single)                       #Shell-style
+        ],
+        'literals': [
+            (r'\b-?[\d_]+(ns|ms|sec|min|hr|day)', Number),   #Duration
+            (r'\b-?[\d_]*\.[\d_]+(ns|ms|sec|min|hr|day)', Number),
+                                                             #Duration with dot
+            (r'\b-?(\d+)?\.\d+(f|F|d|D)?', Number.Float),    #Float/Decimal
+            (r'\b-?0x[0-9a-fA-F_]+', Number.Hex),            #Hex
+            (r'\b-?[\d_]+', Number.Integer),                 #Int
+            (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char), #Char
+            (r'"', Punctuation, 'insideStr'),                #Opening quote
+            (r'`', Punctuation, 'insideUri'),                #Opening accent
+            (r'\b(true|false|null)\b', Keyword.Constant),    #Bool & null
+            (r'(?:(\w+)(::))?(\w+)(<\|)(.*?)(\|>)',          #DSL
+             bygroups(Name.Namespace, Punctuation, Name.Class,
+                      Punctuation, String, Punctuation)),
+            (r'(?:(\w+)(::))?(\w+)?(#)(\w+)?',               #Type/slot literal
+             bygroups(Name.Namespace, Punctuation, Name.Class,
+                      Punctuation, Name.Function)),
+            (r'\[,\]', Literal),                             # Empty list
+            (s(r'($type)(\[,\])'),                           # Typed empty list
+             bygroups(using(this, state = 'inType'), Literal)),
+            (r'\[:\]', Literal),                             # Empty Map
+            (s(r'($type)(\[:\])'),
+             bygroups(using(this, state = 'inType'), Literal)),
+        ],
+        'insideStr': [
+            (r'\\\\', String.Escape),                        #Escaped backslash
+            (r'\\"', String.Escape),                         #Escaped "
+            (r'\\`', String.Escape),                         #Escaped `
+            (r'\$\w+', String.Interpol),                     #Subst var
+            (r'\${.*?}', String.Interpol),                   #Subst expr
+            (r'"', Punctuation, '#pop'),                     #Closing quot
+            (r'.', String)                                   #String content
+        ],
+        'insideUri': [  #TODO: remove copy/paste str/uri
+            (r'\\\\', String.Escape),                        #Escaped backslash
+            (r'\\"', String.Escape),                         #Escaped "
+            (r'\\`', String.Escape),                         #Escaped `
+            (r'\$\w+', String.Interpol),                     #Subst var
+            (r'\${.*?}', String.Interpol),                   #Subst expr
+            (r'`', Punctuation, '#pop'),                     #Closing tick
+            (r'.', String.Backtick)                          #URI content
+        ],
+        'protectionKeywords': [
+            (r'\b(public|protected|private|internal)\b', Keyword),
+        ],
+        'typeKeywords': [
+            (r'\b(abstract|final|const|native|facet|enum)\b', Keyword),
+        ],
+        'methodKeywords': [
+            (r'\b(abstract|native|once|override|static|virtual|final)\b',
+             Keyword),
+        ],
+        'fieldKeywords': [
+            (r'\b(abstract|const|final|native|override|static|virtual|'
+             r'readonly)\b', Keyword)
+        ],
+        'otherKeywords': [
+            (r'\b(try|catch|throw|finally|for|if|else|while|as|is|isnot|'
+             r'switch|case|default|continue|break|do|return|get|set)\b',
+             Keyword),
+            (r'\b(it|this|super)\b', Name.Builtin.Pseudo),
+        ],
+        'operators': [
+            (r'\+\+|\-\-|\+|\-|\*|/|\|\||&&|<=>|<=|<|>=|>|=|!|\[|\]', Operator)
+        ],
+        'inType': [
+            (r'[\[\]\|\->:\?]', Punctuation),
+            (s(r'$id'), Name.Class),
+            (r'', Text, '#pop'),
+
+        ],
+        'root': [
+            include('comments'),
+            include('protectionKeywords'),
+            include('typeKeywords'),
+            include('methodKeywords'),
+            include('fieldKeywords'),
+            include('literals'),
+            include('otherKeywords'),
+            include('operators'),
+            (r'using\b', Keyword.Namespace, 'using'),         # Using stmt
+            (r'@\w+', Name.Decorator, 'facet'),               # Symbol
+            (r'(class|mixin)(\s+)(\w+)', bygroups(Keyword, Text, Name.Class),
+             'inheritance'),                                  # Inheritance list
+
+
+            ### Type var := val
+            (s(r'($type)([ \t]+)($id)(\s*)(:=)'),
+             bygroups(using(this, state = 'inType'), Text,
+                      Name.Variable, Text, Operator)),
+
+            ### var := val
+            (s(r'($id)(\s*)(:=)'),
+             bygroups(Name.Variable, Text, Operator)),
+
+            ### .someId( or ->someId( ###
+            (s(r'(\.|(?:\->))($id)(\s*)(\()'),
+             bygroups(Operator, Name.Function, Text, Punctuation),
+             'insideParen'),
+
+            ### .someId  or ->someId
+            (s(r'(\.|(?:\->))($id)'),
+             bygroups(Operator, Name.Function)),
+
+            ### new makeXXX ( ####
+            (r'(new)(\s+)(make\w*)(\s*)(\()',
+             bygroups(Keyword, Text, Name.Function, Text, Punctuation),
+             'insideMethodDeclArgs'),
+
+            ### Type name (  ####
+            (s(r'($type)([ \t]+)' #Return type and whitespace
+               r'($id)(\s*)(\()'), #method name + open brace
+             bygroups(using(this, state = 'inType'), Text,
+                      Name.Function, Text, Punctuation),
+             'insideMethodDeclArgs'),
+
+            ### ArgType argName, #####
+            (s(r'($type)(\s+)($id)(\s*)(,)'),
+             bygroups(using(this, state='inType'), Text, Name.Variable,
+                      Text, Punctuation)),
+
+            #### ArgType argName) ####
+            ## Covered in 'insideParen' state
+
+            ### ArgType argName -> ArgType| ###
+            (s(r'($type)(\s+)($id)(\s*)(\->)(\s*)($type)(\|)'),
+             bygroups(using(this, state='inType'), Text, Name.Variable,
+                      Text, Punctuation, Text, using(this, state = 'inType'),
+                      Punctuation)),
+
+            ### ArgType argName|  ###
+            (s(r'($type)(\s+)($id)(\s*)(\|)'),
+             bygroups(using(this, state='inType'), Text, Name.Variable,
+                      Text, Punctuation)),
+
+            ### Type var
+            (s(r'($type)([ \t]+)($id)'),
+             bygroups(using(this, state='inType'), Text,
+                      Name.Variable)),
+
+            (r'\(', Punctuation, 'insideParen'),
+            (r'\{', Punctuation, 'insideBrace'),
+            (r'.', Text)
+        ],
+        'insideParen': [
+            (r'\)', Punctuation, '#pop'),
+            include('root'),
+        ],
+        'insideMethodDeclArgs': [
+            (r'\)', Punctuation, '#pop'),
+            (s(r'($type)(\s+)($id)(\s*)(\))'),
+             bygroups(using(this, state='inType'), Text, Name.Variable,
+                      Text, Punctuation), '#pop'),
+            include('root'),
+        ],
+        'insideBrace': [
+            (r'\}', Punctuation, '#pop'),
+            include('root'),
+        ],
+        'inheritance': [
+            (r'\s+', Text),                                      #Whitespace
+            (r':|,', Punctuation),
+            (r'(?:(\w+)(::))?(\w+)',
+             bygroups(Name.Namespace, Punctuation, Name.Class)),
+            (r'{', Punctuation, '#pop')
+        ],
+        'using': [
+            (r'[ \t]+', Text), # consume whitespaces
+            (r'(\[)(\w+)(\])',
+             bygroups(Punctuation, Comment.Special, Punctuation)), #ffi
+            (r'(\")?([\w\.]+)(\")?',
+             bygroups(Punctuation, Name.Namespace, Punctuation)), #podname
+            (r'::', Punctuation, 'usingClass'),
+            (r'', Text, '#pop')
+        ],
+        'usingClass': [
+            (r'[ \t]+', Text), # consume whitespaces
+            (r'(as)(\s+)(\w+)',
+             bygroups(Keyword.Declaration, Text, Name.Class), '#pop:2'),
+            (r'[\w\$]+', Name.Class),
+            (r'', Text, '#pop:2') # jump out to root state
+        ],
+        'facet': [
+            (r'\s+', Text),
+            (r'{', Punctuation, 'facetFields'),
+            (r'', Text, '#pop')
+        ],
+        'facetFields': [
+            include('comments'),
+            include('literals'),
+            include('operators'),
+            (r'\s+', Text),
+            (r'(\s*)(\w+)(\s*)(=)', bygroups(Text, Name, Text, Operator)),
+            (r'}', Punctuation, '#pop'),
+            (r'.', Text)
+        ],
+    }
index 48feeb85af0c456d497b3b093198f4de4f18f09a..278ba54614f45ff449d857ec03830be9f5ea7b2c 100644 (file)
@@ -5,12 +5,13 @@
 
     Lexers for .net languages.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import re
 
-from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, using, this
+from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, \
+     using, this
 from pygments.token import Punctuation, \
      Text, Comment, Operator, Keyword, Name, String, Number, Literal, Other
 from pygments.util import get_choice_opt
@@ -18,8 +19,8 @@ from pygments import unistring as uni
 
 from pygments.lexers.web import XmlLexer
 
-__all__ = ['CSharpLexer', 'BooLexer', 'VbNetLexer', 'CSharpAspxLexer',
-           'VbNetAspxLexer']
+__all__ = ['CSharpLexer', 'NemerleLexer', 'BooLexer', 'VbNetLexer',
+           'CSharpAspxLexer', 'VbNetAspxLexer', 'FSharpLexer']
 
 
 def _escape(st):
@@ -91,7 +92,7 @@ class CSharpLexer(RegexLexer):
                 (r'\n', Text),
                 (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
                 (r'[{}]', Punctuation),
-                (r'@"(\\\\|\\"|[^"])*"', String),
+                (r'@"(""|[^"])*"', String),
                 (r'"(\\\\|\\"|[^"\n])*["\n]', String),
                 (r"'\\.'|'[^\\]'", String.Char),
                 (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
@@ -110,10 +111,12 @@ class CSharpLexer(RegexLexer):
                  r'ref|return|sealed|sizeof|stackalloc|static|'
                  r'switch|this|throw|true|try|typeof|'
                  r'unchecked|unsafe|virtual|void|while|'
-                 r'get|set|new|partial|yield|add|remove|value)\b', Keyword),
+                 r'get|set|new|partial|yield|add|remove|value|alias|ascending|'
+                 r'descending|from|group|into|orderby|select|where|'
+                 r'join|equals)\b', Keyword),
                 (r'(global)(::)', bygroups(Keyword, Punctuation)),
-                (r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|'
-                 r'short|string|uint|ulong|ushort)\b\??', Keyword.Type),
+                (r'(bool|byte|char|decimal|double|dynamic|float|int|long|object|'
+                 r'sbyte|short|string|uint|ulong|ushort|var)\b\??', Keyword.Type),
                 (r'(class|struct)(\s+)', bygroups(Keyword, Text), 'class'),
                 (r'(namespace|using)(\s+)', bygroups(Keyword, Text), 'namespace'),
                 (cs_ident, Name),
@@ -138,6 +141,166 @@ class CSharpLexer(RegexLexer):
         RegexLexer.__init__(self, **options)
 
 
+class NemerleLexer(RegexLexer):
+    """
+    For `Nemerle <http://nemerle.org>`_ source code.
+
+    Additional options accepted:
+
+    `unicodelevel`
+      Determines which Unicode characters this lexer allows for identifiers.
+      The possible values are:
+
+      * ``none`` -- only the ASCII letters and numbers are allowed. This
+        is the fastest selection.
+      * ``basic`` -- all Unicode characters from the specification except
+        category ``Lo`` are allowed.
+      * ``full`` -- all Unicode characters as specified in the C# specs
+        are allowed.  Note that this means a considerable slowdown since the
+        ``Lo`` category has more than 40,000 characters in it!
+
+      The default value is ``basic``.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Nemerle'
+    aliases = ['nemerle']
+    filenames = ['*.n']
+    mimetypes = ['text/x-nemerle'] # inferred
+
+    flags = re.MULTILINE | re.DOTALL | re.UNICODE
+
+    # for the range of allowed unicode characters in identifiers, see
+    # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
+
+    levels = dict(
+        none = '@?[_a-zA-Z][a-zA-Z0-9_]*',
+        basic = ('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' +
+                 '[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl +
+                 uni.Nd + uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*'),
+        full = ('@?(?:_|[^' + _escape(uni.allexcept('Lu', 'Ll', 'Lt', 'Lm',
+                                                    'Lo', 'Nl')) + '])'
+                + '[^' + _escape(uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo',
+                                               'Nl', 'Nd', 'Pc', 'Cf', 'Mn',
+                                               'Mc')) + ']*'),
+    )
+
+    tokens = {}
+    token_variants = True
+
+    for levelname, cs_ident in levels.items():
+        tokens[levelname] = {
+            'root': [
+                # method names
+                (r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
+                 r'(' + cs_ident + ')'                           # method name
+                 r'(\s*)(\()',                               # signature start
+                 bygroups(using(this), Name.Function, Text, Punctuation)),
+                (r'^\s*\[.*?\]', Name.Attribute),
+                (r'[^\S\n]+', Text),
+                (r'\\\n', Text), # line continuation
+                (r'//.*?\n', Comment.Single),
+                (r'/[*].*?[*]/', Comment.Multiline),
+                (r'\n', Text),
+                (r'\$\s*"', String, 'splice-string'),
+                (r'\$\s*<#', String, 'splice-string2'),
+                (r'<#', String, 'recursive-string'),
+
+                (r'(<\[)\s*(' + cs_ident + ':)?', Keyword),
+                (r'\]\>', Keyword),
+
+                # quasiquotation only
+                (r'\$' + cs_ident, Name),
+                (r'(\$)(\()', bygroups(Name, Punctuation),
+                 'splice-string-content'),
+
+                (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
+                (r'[{}]', Punctuation),
+                (r'@"(""|[^"])*"', String),
+                (r'"(\\\\|\\"|[^"\n])*["\n]', String),
+                (r"'\\.'|'[^\\]'", String.Char),
+                (r"0[xX][0-9a-fA-F]+[Ll]?", Number),
+                (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?[flFLdD]?", Number),
+                (r'#[ \t]*(if|endif|else|elif|define|undef|'
+                 r'line|error|warning|region|endregion|pragma)\b.*?\n',
+                 Comment.Preproc),
+                (r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Text,
+                 Keyword)),
+                (r'(abstract|and|as|base|catch|def|delegate|'
+                 r'enum|event|extern|false|finally|'
+                 r'fun|implements|interface|internal|'
+                 r'is|macro|match|matches|module|mutable|new|'
+                 r'null|out|override|params|partial|private|'
+                 r'protected|public|ref|sealed|static|'
+                 r'syntax|this|throw|true|try|type|typeof|'
+                 r'virtual|volatile|when|where|with|'
+                 r'assert|assert2|async|break|checked|continue|do|else|'
+                 r'ensures|for|foreach|if|late|lock|new|nolate|'
+                 r'otherwise|regexp|repeat|requires|return|surroundwith|'
+                 r'unchecked|unless|using|while|yield)\b', Keyword),
+                (r'(global)(::)', bygroups(Keyword, Punctuation)),
+                (r'(bool|byte|char|decimal|double|float|int|long|object|sbyte|'
+                 r'short|string|uint|ulong|ushort|void|array|list)\b\??',
+                 Keyword.Type),
+                (r'(:>?)\s*(' + cs_ident + r'\??)',
+                 bygroups(Punctuation, Keyword.Type)),
+                (r'(class|struct|variant|module)(\s+)',
+                 bygroups(Keyword, Text), 'class'),
+                (r'(namespace|using)(\s+)', bygroups(Keyword, Text),
+                 'namespace'),
+                (cs_ident, Name),
+            ],
+            'class': [
+                (cs_ident, Name.Class, '#pop')
+            ],
+            'namespace': [
+                (r'(?=\()', Text, '#pop'), # using (resource)
+                ('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop')
+            ],
+            'splice-string': [
+                (r'[^"$]',  String),
+                (r'\$' + cs_ident, Name),
+                (r'(\$)(\()', bygroups(Name, Punctuation),
+                 'splice-string-content'),
+                (r'\\"',  String),
+                (r'"',  String, '#pop')
+            ],
+            'splice-string2': [
+                (r'[^#<>$]',  String),
+                (r'\$' + cs_ident, Name),
+                (r'(\$)(\()', bygroups(Name, Punctuation),
+                 'splice-string-content'),
+                (r'<#',  String, '#push'),
+                (r'#>',  String, '#pop')
+            ],
+            'recursive-string': [
+                (r'[^#<>]',  String),
+                (r'<#',  String, '#push'),
+                (r'#>',  String, '#pop')
+            ],
+            'splice-string-content': [
+                (r'if|match', Keyword),
+                (r'[~!%^&*+=|\[\]:;,.<>/?-\\"$ ]', Punctuation),
+                (cs_ident, Name),
+                (r'\d+', Number),
+                (r'\(', Punctuation, '#push'),
+                (r'\)', Punctuation, '#pop')
+            ]
+        }
+
+    def __init__(self, **options):
+        level = get_choice_opt(options, 'unicodelevel', self.tokens.keys(),
+                               'basic')
+        if level not in self._all_tokens:
+            # compile the regexes now
+            self._tokens = self.__class__.process_tokendef(level)
+        else:
+            self._tokens = self._all_tokens[level]
+
+        RegexLexer.__init__(self, **options)
+
+
 class BooLexer(RegexLexer):
     """
     For `Boo <http://boo.codehaus.org/>`_ source code.
@@ -176,12 +339,12 @@ class BooLexer(RegexLexer):
              r'matrix|max|min|normalArrayIndexing|print|property|range|'
              r'rawArrayIndexing|required|typeof|unchecked|using|'
              r'yieldAll|zip)\b', Name.Builtin),
-            ('"""(\\\\|\\"|.*?)"""', String.Double),
-            ('"(\\\\|\\"|[^"]*?)"', String.Double),
-            ("'(\\\\|\\'|[^']*?)'", String.Single),
-            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            (r'"""(\\\\|\\"|.*?)"""', String.Double),
+            (r'"(\\\\|\\"|[^"]*?)"', String.Double),
+            (r"'(\\\\|\\'|[^']*?)'", String.Single),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
             (r'(\d+\.\d*|\d*\.\d+)([fF][+-]?[0-9]+)?', Number.Float),
-            (r'[0-9][0-9\.]*(m|ms|d|h|s)', Number),
+            (r'[0-9][0-9\.]*(ms?|d|h|s)', Number),
             (r'0\d+', Number.Oct),
             (r'0x[a-fA-F0-9]+', Number.Hex),
             (r'\d+L', Number.Integer.Long),
@@ -302,6 +465,7 @@ class VbNetLexer(RegexLexer):
         ]
     }
 
+
 class GenericAspxLexer(RegexLexer):
     """
     Lexer for ASP.NET pages.
@@ -324,6 +488,7 @@ class GenericAspxLexer(RegexLexer):
         ],
     }
 
+
 #TODO support multiple languages within the same source file
 class CSharpAspxLexer(DelegatingLexer):
     """
@@ -344,7 +509,7 @@ class CSharpAspxLexer(DelegatingLexer):
             return 0.2
         elif re.search(r'script[^>]+language=["\']C#', text, re.I) is not None:
             return 0.15
-        return 0.001 # TODO really only for when filename matched...
+
 
 class VbNetAspxLexer(DelegatingLexer):
     """
@@ -365,3 +530,107 @@ class VbNetAspxLexer(DelegatingLexer):
             return 0.2
         elif re.search(r'script[^>]+language=["\']vb', text, re.I) is not None:
             return 0.15
+
+
+# Very close to functional.OcamlLexer
+class FSharpLexer(RegexLexer):
+    """
+    For the F# language.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'FSharp'
+    aliases = ['fsharp']
+    filenames = ['*.fs', '*.fsi']
+    mimetypes = ['text/x-fsharp']
+
+    keywords = [
+      'abstract', 'and', 'as', 'assert', 'base', 'begin', 'class',
+      'default', 'delegate', 'do', 'do!', 'done', 'downcast',
+      'downto', 'elif', 'else', 'end', 'exception', 'extern',
+      'false', 'finally', 'for', 'fun', 'function', 'global', 'if',
+      'in', 'inherit', 'inline', 'interface', 'internal', 'lazy',
+      'let', 'let!', 'match', 'member', 'module', 'mutable',
+      'namespace', 'new', 'null', 'of', 'open', 'or', 'override',
+      'private', 'public', 'rec', 'return', 'return!', 'sig',
+      'static', 'struct', 'then', 'to', 'true', 'try', 'type',
+      'upcast', 'use', 'use!', 'val', 'void', 'when', 'while',
+      'with', 'yield', 'yield!'
+    ]
+    keyopts = [
+      '!=','#','&&','&','\(','\)','\*','\+',',','-\.',
+      '->','-','\.\.','\.','::',':=',':>',':',';;',';','<-',
+      '<','>]','>','\?\?','\?','\[<','\[>','\[\|','\[',
+      ']','_','`','{','\|\]','\|','}','~','<@','=','@>'
+    ]
+
+    operators = r'[!$%&*+\./:<=>?@^|~-]'
+    word_operators = ['and', 'asr', 'land', 'lor', 'lsl', 'lxor', 'mod', 'not', 'or']
+    prefix_syms = r'[!?~]'
+    infix_syms = r'[=<>@^|&+\*/$%-]'
+    primitives = ['unit', 'int', 'float', 'bool', 'string', 'char', 'list', 'array',
+                  'byte', 'sbyte', 'int16', 'uint16', 'uint32', 'int64', 'uint64'
+                  'nativeint', 'unativeint', 'decimal', 'void', 'float32', 'single',
+                  'double']
+
+    tokens = {
+        'escape-sequence': [
+            (r'\\[\\\"\'ntbr]', String.Escape),
+            (r'\\[0-9]{3}', String.Escape),
+            (r'\\x[0-9a-fA-F]{2}', String.Escape),
+        ],
+        'root': [
+            (r'\s+', Text),
+            (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo),
+            (r'\b([A-Z][A-Za-z0-9_\']*)(?=\s*\.)',
+             Name.Namespace, 'dotted'),
+            (r'\b([A-Z][A-Za-z0-9_\']*)', Name.Class),
+            (r'//.*?\n', Comment.Single),
+            (r'\(\*(?!\))', Comment, 'comment'),
+            (r'\b(%s)\b' % '|'.join(keywords), Keyword),
+            (r'(%s)' % '|'.join(keyopts), Operator),
+            (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
+            (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word),
+            (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type),
+
+            (r'#[ \t]*(if|endif|else|line|nowarn|light)\b.*?\n',
+             Comment.Preproc),
+
+            (r"[^\W\d][\w']*", Name),
+
+            (r'\d[\d_]*', Number.Integer),
+            (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
+            (r'0[oO][0-7][0-7_]*', Number.Oct),
+            (r'0[bB][01][01_]*', Number.Binary),
+            (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
+
+            (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
+             String.Char),
+            (r"'.'", String.Char),
+            (r"'", Keyword), # a stray quote is another syntax element
+
+            (r'"', String.Double, 'string'),
+
+            (r'[~?][a-z][\w\']*:', Name.Variable),
+        ],
+        'comment': [
+            (r'[^(*)]+', Comment),
+            (r'\(\*', Comment, '#push'),
+            (r'\*\)', Comment, '#pop'),
+            (r'[(*)]', Comment),
+        ],
+        'string': [
+            (r'[^\\"]+', String.Double),
+            include('escape-sequence'),
+            (r'\\\n', String.Double),
+            (r'"', String.Double, '#pop'),
+        ],
+        'dotted': [
+            (r'\s+', Text),
+            (r'\.', Punctuation),
+            (r'[A-Z][A-Za-z0-9_\']*(?=\s*\.)', Name.Namespace),
+            (r'[A-Z][A-Za-z0-9_\']*', Name.Class, '#pop'),
+            (r'[a-z_][A-Za-z0-9_\']*', Name, '#pop'),
+        ],
+    }
index e6d16b195abfafc154155302a422a7394d736ca6..ee44f7cef2ce3fbaf9bd750bac7a531347df2a75 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for functional languages.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -13,11 +13,12 @@ import re
 
 from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions
 from pygments.token import Text, Comment, Operator, Keyword, Name, \
-     String, Number, Punctuation, Literal, Generic
+     String, Number, Punctuation, Literal, Generic, Error
 
-
-__all__ = ['SchemeLexer', 'CommonLispLexer', 'HaskellLexer', 'LiterateHaskellLexer',
-           'OcamlLexer', 'ErlangLexer', 'ErlangShellLexer']
+__all__ = ['SchemeLexer', 'CommonLispLexer', 'HaskellLexer',
+           'LiterateHaskellLexer', 'SMLLexer', 'OcamlLexer', 'ErlangLexer',
+           'ErlangShellLexer', 'OpaLexer', 'CoqLexer', 'NewLispLexer',
+           'ElixirLexer', 'ElixirConsoleLexer']
 
 
 class SchemeLexer(RegexLexer):
@@ -36,7 +37,7 @@ class SchemeLexer(RegexLexer):
     """
     name = 'Scheme'
     aliases = ['scheme', 'scm']
-    filenames = ['*.scm']
+    filenames = ['*.scm', '*.ss', '*.rkt']
     mimetypes = ['text/x-scheme', 'application/x-scheme']
 
     # list of known keywords and builtins taken form vim 6.4 scheme.vim
@@ -112,7 +113,7 @@ class SchemeLexer(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),
@@ -406,7 +407,7 @@ class HaskellLexer(RegexLexer):
         'funclist': [
             (r'\s+', Text),
             (r'[A-Z][a-zA-Z0-9_]*', Keyword.Type),
-            (r'[_a-z][\w\']+', Name.Function),
+            (r'(_[\w\']+|[a-z][\w\']*)', Name.Function),
             (r'--.*$', Comment.Single),
             (r'{-', Comment.Multiline, 'comment'),
             (r',', Punctuation),
@@ -515,6 +516,332 @@ class LiterateHaskellLexer(Lexer):
             yield item
 
 
+class SMLLexer(RegexLexer):
+    """
+    For the Standard ML language.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Standard ML'
+    aliases = ['sml']
+    filenames = ['*.sml', '*.sig', '*.fun',]
+    mimetypes = ['text/x-standardml', 'application/x-standardml']
+
+    alphanumid_reserved = [
+        # Core
+        'abstype', 'and', 'andalso', 'as', 'case', 'datatype', 'do', 'else',
+        'end', 'exception', 'fn', 'fun', 'handle', 'if', 'in', 'infix',
+        'infixr', 'let', 'local', 'nonfix', 'of', 'op', 'open', 'orelse',
+        'raise', 'rec', 'then', 'type', 'val', 'with', 'withtype', 'while',
+        # Modules
+        'eqtype', 'functor', 'include', 'sharing', 'sig', 'signature',
+        'struct', 'structure', 'where',
+    ]
+
+    symbolicid_reserved = [
+        # Core
+        ':', '\|', '=', '=>', '->', '#',
+        # Modules
+        ':>',
+    ]
+
+    nonid_reserved = [ '(', ')', '[', ']', '{', '}', ',', ';', '...', '_' ]
+
+    alphanumid_re = r"[a-zA-Z][a-zA-Z0-9_']*"
+    symbolicid_re = r"[!%&$#+\-/:<=>?@\\~`^|*]+"
+
+    # A character constant is a sequence of the form #s, where s is a string
+    # constant denoting a string of size one character. This setup just parses
+    # the entire string as either a String.Double or a String.Char (depending
+    # on the argument), even if the String.Char is an erronous
+    # multiple-character string.
+    def stringy (whatkind):
+        return [
+            (r'[^"\\]', whatkind),
+            (r'\\[\\\"abtnvfr]', String.Escape),
+            # Control-character notation is used for codes < 32,
+            # where \^@ == \000
+            (r'\\\^[\x40-\x5e]', String.Escape),
+            # Docs say 'decimal digits'
+            (r'\\[0-9]{3}', String.Escape),
+            (r'\\u[0-9a-fA-F]{4}', String.Escape),
+            (r'\\\s+\\', String.Interpol),
+            (r'"', whatkind, '#pop'),
+        ]
+
+    # Callbacks for distinguishing tokens and reserved words
+    def long_id_callback(self, match):
+        if match.group(1) in self.alphanumid_reserved: token = Error
+        else: token = Name.Namespace
+        yield match.start(1), token, match.group(1)
+        yield match.start(2), Punctuation, match.group(2)
+
+    def end_id_callback(self, match):
+        if match.group(1) in self.alphanumid_reserved: token = Error
+        elif match.group(1) in self.symbolicid_reserved: token = Error
+        else: token = Name
+        yield match.start(1), token, match.group(1)
+
+    def id_callback(self, match):
+        str = match.group(1)
+        if str in self.alphanumid_reserved: token = Keyword.Reserved
+        elif str in self.symbolicid_reserved: token = Punctuation
+        else: token = Name
+        yield match.start(1), token, str
+
+    tokens = {
+        # Whitespace and comments are (almost) everywhere
+        'whitespace': [
+            (r'\s+', Text),
+            (r'\(\*', Comment.Multiline, 'comment'),
+        ],
+
+        'delimiters': [
+            # This lexer treats these delimiters specially:
+            # Delimiters define scopes, and the scope is how the meaning of
+            # the `|' is resolved - is it a case/handle expression, or function
+            # definition by cases? (This is not how the Definition works, but
+            # it's how MLton behaves, see http://mlton.org/SMLNJDeviations)
+            (r'\(|\[|{', Punctuation, 'main'),
+            (r'\)|\]|}', Punctuation, '#pop'),
+            (r'\b(let|if|local)\b(?!\')', Keyword.Reserved, ('main', 'main')),
+            (r'\b(struct|sig|while)\b(?!\')', Keyword.Reserved, 'main'),
+            (r'\b(do|else|end|in|then)\b(?!\')', Keyword.Reserved, '#pop'),
+        ],
+
+        'core': [
+            # Punctuation that doesn't overlap symbolic identifiers
+            (r'(%s)' % '|'.join([re.escape(z) for z in nonid_reserved]),
+             Punctuation),
+
+            # Special constants: strings, floats, numbers in decimal and hex
+            (r'#"', String.Char, 'char'),
+            (r'"', String.Double, 'string'),
+            (r'~?0x[0-9a-fA-F]+', Number.Hex),
+            (r'0wx[0-9a-fA-F]+', Number.Hex),
+            (r'0w\d+', Number.Integer),
+            (r'~?\d+\.\d+[eE]~?\d+', Number.Float),
+            (r'~?\d+\.\d+', Number.Float),
+            (r'~?\d+[eE]~?\d+', Number.Float),
+            (r'~?\d+', Number.Integer),
+
+            # Labels
+            (r'#\s*[1-9][0-9]*', Name.Label),
+            (r'#\s*(%s)' % alphanumid_re, Name.Label),
+            (r'#\s+(%s)' % symbolicid_re, Name.Label),
+            # Some reserved words trigger a special, local lexer state change
+            (r'\b(datatype|abstype)\b(?!\')', Keyword.Reserved, 'dname'),
+            (r'(?=\b(exception)\b(?!\'))', Text, ('ename')),
+            (r'\b(functor|include|open|signature|structure)\b(?!\')',
+             Keyword.Reserved, 'sname'),
+            (r'\b(type|eqtype)\b(?!\')', Keyword.Reserved, 'tname'),
+
+            # Regular identifiers, long and otherwise
+            (r'\'[0-9a-zA-Z_\']*', Name.Decorator),
+            (r'(%s)(\.)' % alphanumid_re, long_id_callback, "dotted"),
+            (r'(%s)' % alphanumid_re, id_callback),
+            (r'(%s)' % symbolicid_re, id_callback),
+        ],
+        'dotted': [
+            (r'(%s)(\.)' % alphanumid_re, long_id_callback),
+            (r'(%s)' % alphanumid_re, end_id_callback, "#pop"),
+            (r'(%s)' % symbolicid_re, end_id_callback, "#pop"),
+            (r'\s+', Error),
+            (r'\S+', Error),
+        ],
+
+
+        # Main parser (prevents errors in files that have scoping errors)
+        'root': [ (r'', Text, 'main') ],
+
+        # In this scope, I expect '|' to not be followed by a function name,
+        # and I expect 'and' to be followed by a binding site
+        'main': [
+            include('whitespace'),
+
+            # Special behavior of val/and/fun
+            (r'\b(val|and)\b(?!\')', Keyword.Reserved, 'vname'),
+            (r'\b(fun)\b(?!\')', Keyword.Reserved,
+             ('#pop', 'main-fun', 'fname')),
+
+            include('delimiters'),
+            include('core'),
+            (r'\S+', Error),
+        ],
+
+        # In this scope, I expect '|' and 'and' to be followed by a function
+        'main-fun': [
+            include('whitespace'),
+
+            (r'\s', Text),
+            (r'\(\*', Comment.Multiline, 'comment'),
+
+            # Special behavior of val/and/fun
+            (r'\b(fun|and)\b(?!\')', Keyword.Reserved, 'fname'),
+            (r'\b(val)\b(?!\')', Keyword.Reserved,
+             ('#pop', 'main', 'vname')),
+
+            # Special behavior of '|' and '|'-manipulating keywords
+            (r'\|', Punctuation, 'fname'),
+            (r'\b(case|handle)\b(?!\')', Keyword.Reserved,
+             ('#pop', 'main')),
+
+            include('delimiters'),
+            include('core'),
+            (r'\S+', Error),
+        ],
+
+        # Character and string parsers
+        'char': stringy(String.Char),
+        'string': stringy(String.Double),
+
+        'breakout': [
+            (r'(?=\b(%s)\b(?!\'))' % '|'.join(alphanumid_reserved), Text, '#pop'),
+        ],
+
+        # Dealing with what comes after module system keywords
+        'sname': [
+            include('whitespace'),
+            include('breakout'),
+
+            (r'(%s)' % alphanumid_re, Name.Namespace),
+            (r'', Text, '#pop'),
+        ],
+
+        # Dealing with what comes after the 'fun' (or 'and' or '|') keyword
+        'fname': [
+            include('whitespace'),
+            (r'\'[0-9a-zA-Z_\']*', Name.Decorator),
+            (r'\(', Punctuation, 'tyvarseq'),
+
+            (r'(%s)' % alphanumid_re, Name.Function, '#pop'),
+            (r'(%s)' % symbolicid_re, Name.Function, '#pop'),
+
+            # Ignore interesting function declarations like "fun (x + y) = ..."
+            (r'', Text, '#pop'),
+        ],
+
+        # Dealing with what comes after the 'val' (or 'and') keyword
+        'vname': [
+            include('whitespace'),
+            (r'\'[0-9a-zA-Z_\']*', Name.Decorator),
+            (r'\(', Punctuation, 'tyvarseq'),
+
+            (r'(%s)(\s*)(=(?!%s))' % (alphanumid_re, symbolicid_re),
+             bygroups(Name.Variable, Text, Punctuation), '#pop'),
+            (r'(%s)(\s*)(=(?!%s))' % (symbolicid_re, symbolicid_re),
+             bygroups(Name.Variable, Text, Punctuation), '#pop'),
+            (r'(%s)' % alphanumid_re, Name.Variable, '#pop'),
+            (r'(%s)' % symbolicid_re, Name.Variable, '#pop'),
+
+            # Ignore interesting patterns like 'val (x, y)'
+            (r'', Text, '#pop'),
+        ],
+
+        # Dealing with what comes after the 'type' (or 'and') keyword
+        'tname': [
+            include('whitespace'),
+            include('breakout'),
+
+            (r'\'[0-9a-zA-Z_\']*', Name.Decorator),
+            (r'\(', Punctuation, 'tyvarseq'),
+            (r'=(?!%s)' % symbolicid_re, Punctuation, ('#pop', 'typbind')),
+
+            (r'(%s)' % alphanumid_re, Keyword.Type),
+            (r'(%s)' % symbolicid_re, Keyword.Type),
+            (r'\S+', Error, '#pop'),
+        ],
+
+        # A type binding includes most identifiers
+        'typbind': [
+            include('whitespace'),
+
+            (r'\b(and)\b(?!\')', Keyword.Reserved, ('#pop', 'tname')),
+
+            include('breakout'),
+            include('core'),
+            (r'\S+', Error, '#pop'),
+        ],
+
+        # Dealing with what comes after the 'datatype' (or 'and') keyword
+        'dname': [
+            include('whitespace'),
+            include('breakout'),
+
+            (r'\'[0-9a-zA-Z_\']*', Name.Decorator),
+            (r'\(', Punctuation, 'tyvarseq'),
+            (r'(=)(\s*)(datatype)',
+             bygroups(Punctuation, Text, Keyword.Reserved), '#pop'),
+            (r'=(?!%s)' % symbolicid_re, Punctuation,
+             ('#pop', 'datbind', 'datcon')),
+
+            (r'(%s)' % alphanumid_re, Keyword.Type),
+            (r'(%s)' % symbolicid_re, Keyword.Type),
+            (r'\S+', Error, '#pop'),
+        ],
+
+        # common case - A | B | C of int
+        'datbind': [
+            include('whitespace'),
+
+            (r'\b(and)\b(?!\')', Keyword.Reserved, ('#pop', 'dname')),
+            (r'\b(withtype)\b(?!\')', Keyword.Reserved, ('#pop', 'tname')),
+            (r'\b(of)\b(?!\')', Keyword.Reserved),
+
+            (r'(\|)(\s*)(%s)' % alphanumid_re,
+             bygroups(Punctuation, Text, Name.Class)),
+            (r'(\|)(\s+)(%s)' % symbolicid_re,
+             bygroups(Punctuation, Text, Name.Class)),
+
+            include('breakout'),
+            include('core'),
+            (r'\S+', Error),
+        ],
+
+        # Dealing with what comes after an exception
+        'ename': [
+            include('whitespace'),
+
+            (r'(exception|and)\b(\s+)(%s)' % alphanumid_re,
+             bygroups(Keyword.Reserved, Text, Name.Class)),
+            (r'(exception|and)\b(\s*)(%s)' % symbolicid_re,
+             bygroups(Keyword.Reserved, Text, Name.Class)),
+            (r'\b(of)\b(?!\')', Keyword.Reserved),
+
+            include('breakout'),
+            include('core'),
+            (r'\S+', Error),
+        ],
+
+        'datcon': [
+            include('whitespace'),
+            (r'(%s)' % alphanumid_re, Name.Class, '#pop'),
+            (r'(%s)' % symbolicid_re, Name.Class, '#pop'),
+            (r'\S+', Error, '#pop'),
+        ],
+
+        # Series of type variables
+        'tyvarseq': [
+            (r'\s', Text),
+            (r'\(\*', Comment.Multiline, 'comment'),
+
+            (r'\'[0-9a-zA-Z_\']*', Name.Decorator),
+            (alphanumid_re, Name),
+            (r',', Punctuation),
+            (r'\)', Punctuation, '#pop'),
+            (symbolicid_re, Name),
+        ],
+
+        'comment': [
+            (r'[^(*)]', Comment.Multiline),
+            (r'\(\*', Comment.Multiline, '#push'),
+            (r'\*\)', Comment.Multiline, '#pop'),
+            (r'[(*)]', Comment.Multiline),
+        ],
+    }
+
+
 class OcamlLexer(RegexLexer):
     """
     For the OCaml language.
@@ -561,20 +888,20 @@ class OcamlLexer(RegexLexer):
             (r'\b([A-Z][A-Za-z0-9_\']*)(?=\s*\.)',
              Name.Namespace, 'dotted'),
             (r'\b([A-Z][A-Za-z0-9_\']*)', Name.Class),
-            (r'\(\*', Comment, 'comment'),
+            (r'\(\*(?![)])', Comment, 'comment'),
             (r'\b(%s)\b' % '|'.join(keywords), Keyword),
-            (r'(%s)' % '|'.join(keyopts), Operator),
+            (r'(%s)' % '|'.join(keyopts[::-1]), Operator),
             (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
             (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word),
             (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type),
 
             (r"[^\W\d][\w']*", Name),
 
-            (r'\d[\d_]*', Number.Integer),
+            (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
             (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
             (r'0[oO][0-7][0-7_]*', Number.Oct),
             (r'0[bB][01][01_]*', Number.Binary),
-            (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
+            (r'\d[\d_]*', Number.Integer),
 
             (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
              String.Char),
@@ -618,7 +945,7 @@ class ErlangLexer(RegexLexer):
 
     name = 'Erlang'
     aliases = ['erlang']
-    filenames = ['*.erl', '*.hrl']
+    filenames = ['*.erl', '*.hrl', '*.es', '*.escript']
     mimetypes = ['text/x-erlang']
 
     keywords = [
@@ -656,7 +983,7 @@ class ErlangLexer(RegexLexer):
         'universaltime_to_localtime', 'unlink', 'unregister', 'whereis'
         ]
 
-    operators = r'(\+|-|\*|/|<|>|=|==|/=|=:=|=/=|=<|>=|\+\+|--|<-|!)'
+    operators = r'(\+\+?|--?|\*|/|<|>|/=|=:=|=/=|=<|>=|==?|<-|!|\?)'
     word_operators = [
         'and', 'andalso', 'band', 'bnot', 'bor', 'bsl', 'bsr', 'bxor',
         'div', 'not', 'or', 'orelse', 'rem', 'xor'
@@ -755,3 +1082,723 @@ class ErlangShellLexer(Lexer):
                                       erlexer.get_tokens_unprocessed(curcode)):
                 yield item
 
+
+class OpaLexer(RegexLexer):
+    """
+    Lexer for the Opa language (http://opalang.org).
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Opa'
+    aliases = ['opa']
+    filenames = ['*.opa']
+    mimetypes = ['text/x-opa']
+
+    # most of these aren't strictly keywords
+    # but if you color only real keywords, you might just
+    # as well not color anything
+    keywords = [
+        'and', 'as', 'begin', 'css', 'database', 'db', 'do', 'else', 'end',
+        'external', 'forall', 'if', 'import', 'match', 'package', 'parser',
+        'rec', 'server', 'then', 'type', 'val', 'with', 'xml_parser'
+    ]
+
+    # matches both stuff and `stuff`
+    ident_re = r'(([a-zA-Z_]\w*)|(`[^`]*`))'
+
+    op_re = r'[.=\-<>,@~%/+?*&^!]'
+    punc_re = r'[()\[\],;|]' # '{' and '}' are treated elsewhere
+                               # because they are also used for inserts
+
+    tokens = {
+        # copied from the caml lexer, should be adapted
+        'escape-sequence': [
+            (r'\\[\\\"\'ntr}]', String.Escape),
+            (r'\\[0-9]{3}', String.Escape),
+            (r'\\x[0-9a-fA-F]{2}', String.Escape),
+        ],
+
+        # factorizing these rules, because they are inserted many times
+        'comments': [
+            (r'/\*', Comment, 'nested-comment'),
+            (r'//.*?$', Comment),
+        ],
+        'comments-and-spaces': [
+            include('comments'),
+            (r'\s+', Text),
+        ],
+
+        'root': [
+            include('comments-and-spaces'),
+            # keywords
+            (r'\b(%s)\b' % '|'.join(keywords), Keyword),
+            # directives
+            # we could parse the actual set of directives instead of anything
+            # starting with @, but this is troublesome
+            # because it needs to be adjusted all the time
+            # and assuming we parse only sources that compile, it is useless
+            (r'@'+ident_re+r'\b', Name.Builtin.Pseudo),
+
+            # number literals
+            (r'-?.[\d]+([eE][+\-]?\d+)', Number.Float),
+            (r'-?\d+.\d*([eE][+\-]?\d+)', Number.Float),
+            (r'-?\d+[eE][+\-]?\d+', Number.Float),
+            (r'0[xX][\da-fA-F]+', Number.Hex),
+            (r'0[oO][0-7]+', Number.Oct),
+            (r'0[bB][01]+', Number.Binary),
+            (r'\d+', Number.Integer),
+            # color literals
+            (r'#[\da-fA-F]{3,6}', Number.Integer),
+
+            # string literals
+            (r'"', String.Double, 'string'),
+            # char literal, should be checked because this is the regexp from
+            # the caml lexer
+            (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2})|.)'",
+             String.Char),
+
+            # this is meant to deal with embedded exprs in strings
+            # every time we find a '}' we pop a state so that if we were
+            # inside a string, we are back in the string state
+            # as a consequence, we must also push a state every time we find a
+            # '{' or else we will have errors when parsing {} for instance
+            (r'{', Operator, '#push'),
+            (r'}', Operator, '#pop'),
+
+            # html literals
+            # this is a much more strict that the actual parser,
+            # since a<b would not be parsed as html
+            # but then again, the parser is way too lax, and we can't hope
+            # to have something as tolerant
+            (r'<(?=[a-zA-Z>])', String.Single, 'html-open-tag'),
+
+            # db path
+            # matching the '[_]' in '/a[_]' because it is a part
+            # of the syntax of the db path definition
+            # unfortunately, i don't know how to match the ']' in
+            # /a[1], so this is somewhat inconsistent
+            (r'[@?!]?(/\w+)+(\[_\])?', Name.Variable),
+            # putting the same color on <- as on db path, since
+            # it can be used only to mean Db.write
+            (r'<-(?!'+op_re+r')', Name.Variable),
+
+            # 'modules'
+            # although modules are not distinguished by their names as in caml
+            # the standard library seems to follow the convention that modules
+            # only area capitalized
+            (r'\b([A-Z]\w*)(?=\.)', Name.Namespace),
+
+            # operators
+            # = has a special role because this is the only
+            # way to syntactic distinguish binding constructions
+            # unfortunately, this colors the equal in {x=2} too
+            (r'=(?!'+op_re+r')', Keyword),
+            (r'(%s)+' % op_re, Operator),
+            (r'(%s)+' % punc_re, Operator),
+
+            # coercions
+            (r':', Operator, 'type'),
+            # type variables
+            # we need this rule because we don't parse specially type
+            # definitions so in "type t('a) = ...", "'a" is parsed by 'root'
+            ("'"+ident_re, Keyword.Type),
+
+            # id literal, #something, or #{expr}
+            (r'#'+ident_re, String.Single),
+            (r'#(?={)', String.Single),
+
+            # identifiers
+            # this avoids to color '2' in 'a2' as an integer
+            (ident_re, Text),
+
+            # default, not sure if that is needed or not
+            # (r'.', Text),
+        ],
+
+        # it is quite painful to have to parse types to know where they end
+        # this is the general rule for a type
+        # a type is either:
+        # * -> ty
+        # * type-with-slash
+        # * type-with-slash -> ty
+        # * type-with-slash (, type-with-slash)+ -> ty
+        #
+        # the code is pretty funky in here, but this code would roughly
+        # translate in caml to:
+        # let rec type stream =
+        # match stream with
+        # | [< "->";  stream >] -> type stream
+        # | [< "";  stream >] ->
+        #   type_with_slash stream
+        #   type_lhs_1 stream;
+        # and type_1 stream = ...
+        'type': [
+            include('comments-and-spaces'),
+            (r'->', Keyword.Type),
+            (r'', Keyword.Type, ('#pop', 'type-lhs-1', 'type-with-slash')),
+        ],
+
+        # parses all the atomic or closed constructions in the syntax of type
+        # expressions: record types, tuple types, type constructors, basic type
+        # and type variables
+        'type-1': [
+            include('comments-and-spaces'),
+            (r'\(', Keyword.Type, ('#pop', 'type-tuple')),
+            (r'~?{', Keyword.Type, ('#pop', 'type-record')),
+            (ident_re+r'\(', Keyword.Type, ('#pop', 'type-tuple')),
+            (ident_re, Keyword.Type, '#pop'),
+            ("'"+ident_re, Keyword.Type),
+            # this case is not in the syntax but sometimes
+            # we think we are parsing types when in fact we are parsing
+            # some css, so we just pop the states until we get back into
+            # the root state
+            (r'', Keyword.Type, '#pop'),
+        ],
+
+        # type-with-slash is either:
+        # * type-1
+        # * type-1 (/ type-1)+
+        'type-with-slash': [
+            include('comments-and-spaces'),
+            (r'', Keyword.Type, ('#pop', 'slash-type-1', 'type-1')),
+        ],
+        'slash-type-1': [
+            include('comments-and-spaces'),
+            ('/', Keyword.Type, ('#pop', 'type-1')),
+            # same remark as above
+            (r'', Keyword.Type, '#pop'),
+        ],
+
+        # we go in this state after having parsed a type-with-slash
+        # while trying to parse a type
+        # and at this point we must determine if we are parsing an arrow
+        # type (in which case we must continue parsing) or not (in which
+        # case we stop)
+        'type-lhs-1': [
+            include('comments-and-spaces'),
+            (r'->', Keyword.Type, ('#pop', 'type')),
+            (r'(?=,)', Keyword.Type, ('#pop', 'type-arrow')),
+            (r'', Keyword.Type, '#pop'),
+        ],
+        'type-arrow': [
+            include('comments-and-spaces'),
+            # the look ahead here allows to parse f(x : int, y : float -> truc)
+            # correctly
+            (r',(?=[^:]*?->)', Keyword.Type, 'type-with-slash'),
+            (r'->', Keyword.Type, ('#pop', 'type')),
+            # same remark as above
+            (r'', Keyword.Type, '#pop'),
+        ],
+
+        # no need to do precise parsing for tuples and records
+        # because they are closed constructions, so we can simply
+        # find the closing delimiter
+        # note that this function would be not work if the source
+        # contained identifiers like `{)` (although it could be patched
+        # to support it)
+        'type-tuple': [
+            include('comments-and-spaces'),
+            (r'[^\(\)/*]+', Keyword.Type),
+            (r'[/*]', Keyword.Type),
+            (r'\(', Keyword.Type, '#push'),
+            (r'\)', Keyword.Type, '#pop'),
+        ],
+        'type-record': [
+            include('comments-and-spaces'),
+            (r'[^{}/*]+', Keyword.Type),
+            (r'[/*]', Keyword.Type),
+            (r'{', Keyword.Type, '#push'),
+            (r'}', Keyword.Type, '#pop'),
+        ],
+
+#        'type-tuple': [
+#            include('comments-and-spaces'),
+#            (r'\)', Keyword.Type, '#pop'),
+#            (r'', Keyword.Type, ('#pop', 'type-tuple-1', 'type-1')),
+#        ],
+#        'type-tuple-1': [
+#            include('comments-and-spaces'),
+#            (r',?\s*\)', Keyword.Type, '#pop'), # ,) is a valid end of tuple, in (1,)
+#            (r',', Keyword.Type, 'type-1'),
+#        ],
+#        'type-record':[
+#            include('comments-and-spaces'),
+#            (r'}', Keyword.Type, '#pop'),
+#            (r'~?(?:\w+|`[^`]*`)', Keyword.Type, 'type-record-field-expr'),
+#        ],
+#        'type-record-field-expr': [
+#
+#        ],
+
+        'nested-comment': [
+            (r'[^/*]+', Comment),
+            (r'/\*', Comment, '#push'),
+            (r'\*/', Comment, '#pop'),
+            (r'[/*]', Comment),
+        ],
+
+        # the coy pasting between string and single-string
+        # is kinda sad. Is there a way to avoid that??
+        'string': [
+            (r'[^\\"{]+', String.Double),
+            (r'"', String.Double, '#pop'),
+            (r'{', Operator, 'root'),
+            include('escape-sequence'),
+        ],
+        'single-string': [
+            (r'[^\\\'{]+', String.Double),
+            (r'\'', String.Double, '#pop'),
+            (r'{', Operator, 'root'),
+            include('escape-sequence'),
+        ],
+
+        # all the html stuff
+        # can't really reuse some existing html parser
+        # because we must be able to parse embedded expressions
+
+        # we are in this state after someone parsed the '<' that
+        # started the html literal
+        'html-open-tag': [
+            (r'[\w\-:]+', String.Single, ('#pop', 'html-attr')),
+            (r'>', String.Single, ('#pop', 'html-content')),
+        ],
+
+        # we are in this state after someone parsed the '</' that
+        # started the end of the closing tag
+        'html-end-tag': [
+            # this is a star, because </> is allowed
+            (r'[\w\-:]*>', String.Single, '#pop'),
+        ],
+
+        # we are in this state after having parsed '<ident(:ident)?'
+        # we thus parse a possibly empty list of attributes
+        'html-attr': [
+            (r'\s+', Text),
+            (r'[\w\-:]+=', String.Single, 'html-attr-value'),
+            (r'/>', String.Single, '#pop'),
+            (r'>', String.Single, ('#pop', 'html-content')),
+        ],
+
+        'html-attr-value': [
+            (r"'", String.Single, ('#pop', 'single-string')),
+            (r'"', String.Single, ('#pop', 'string')),
+            (r'#'+ident_re, String.Single, '#pop'),
+            (r'#(?={)', String.Single, ('#pop', 'root')),
+            (r'{', Operator, ('#pop', 'root')), # this is a tail call!
+        ],
+
+        # we should probably deal with '\' escapes here
+        'html-content': [
+            (r'<!--', Comment, 'html-comment'),
+            (r'</', String.Single, ('#pop', 'html-end-tag')),
+            (r'<', String.Single, 'html-open-tag'),
+            (r'{', Operator, 'root'),
+            (r'.|\s+', String.Single),
+        ],
+
+        'html-comment': [
+            (r'-->', Comment, '#pop'),
+            (r'[^\-]+|-', Comment),
+        ],
+    }
+
+
+class CoqLexer(RegexLexer):
+    """
+    For the `Coq <http://coq.inria.fr/>`_ theorem prover.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Coq'
+    aliases = ['coq']
+    filenames = ['*.v']
+    mimetypes = ['text/x-coq']
+
+    keywords1 = [
+        # Vernacular commands
+        'Section', 'Module', 'End', 'Require', 'Import', 'Export', 'Variable',
+        'Variables', 'Parameter', 'Parameters', 'Axiom', 'Hypothesis',
+        'Hypotheses', 'Notation', 'Local', 'Tactic', 'Reserved', 'Scope',
+        'Open', 'Close', 'Bind', 'Delimit', 'Definition', 'Let', 'Ltac',
+        'Fixpoint', 'CoFixpoint', 'Morphism', 'Relation', 'Implicit',
+        'Arguments', 'Set', 'Unset', 'Contextual', 'Strict', 'Prenex',
+        'Implicits', 'Inductive', 'CoInductive', 'Record', 'Structure',
+        'Canonical', 'Coercion', 'Theorem', 'Lemma', 'Corollary',
+        'Proposition', 'Fact', 'Remark', 'Example', 'Proof', 'Goal', 'Save',
+        'Qed', 'Defined', 'Hint', 'Resolve', 'Rewrite', 'View', 'Search',
+        'Show', 'Print', 'Printing', 'All', 'Graph', 'Projections', 'inside',
+        'outside',
+    ]
+    keywords2 = [
+        # Gallina
+        'forall', 'exists', 'exists2', 'fun', 'fix', 'cofix', 'struct',
+        'match', 'end',  'in', 'return', 'let', 'if', 'is', 'then', 'else',
+        'for', 'of', 'nosimpl', 'with', 'as',
+    ]
+    keywords3 = [
+        # Sorts
+        'Type', 'Prop',
+    ]
+    keywords4 = [
+        # Tactics
+        'pose', 'set', 'move', 'case', 'elim', 'apply', 'clear', 'hnf', 'intro',
+        'intros', 'generalize', 'rename', 'pattern', 'after', 'destruct',
+        'induction', 'using', 'refine', 'inversion', 'injection', 'rewrite',
+        'congr', 'unlock', 'compute', 'ring', 'field', 'replace', 'fold',
+        'unfold', 'change', 'cutrewrite', 'simpl', 'have', 'suff', 'wlog',
+        'suffices', 'without', 'loss', 'nat_norm', 'assert', 'cut', 'trivial',
+        'revert', 'bool_congr', 'nat_congr', 'symmetry', 'transitivity', 'auto',
+        'split', 'left', 'right', 'autorewrite',
+    ]
+    keywords5 = [
+        # Terminators
+        'by', 'done', 'exact', 'reflexivity', 'tauto', 'romega', 'omega',
+        'assumption', 'solve', 'contradiction', 'discriminate',
+    ]
+    keywords6 = [
+        # Control
+        'do', 'last', 'first', 'try', 'idtac', 'repeat',
+    ]
+      # 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done',
+      # 'downto', 'else', 'end', 'exception', 'external', 'false',
+      # 'for', 'fun', 'function', 'functor', 'if', 'in', 'include',
+      # 'inherit', 'initializer', 'lazy', 'let', 'match', 'method',
+      # 'module', 'mutable', 'new', 'object', 'of', 'open', 'private',
+      # 'raise', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try',
+      # 'type', 'val', 'virtual', 'when', 'while', 'with'
+    keyopts = [
+        '!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-',
+        r'-\.', '->', r'\.', r'\.\.', ':', '::', ':=', ':>', ';', ';;', '<',
+        '<-', '=', '>', '>]', '>}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>',
+        r'\[\|', ']', '_', '`', '{', '{<', r'\|', r'\|]', '}', '~', '=>',
+        r'/\\', r'\\/',
+        u'Π', u'λ',
+    ]
+    operators = r'[!$%&*+\./:<=>?@^|~-]'
+    word_operators = ['and', 'asr', 'land', 'lor', 'lsl', 'lxor', 'mod', 'or']
+    prefix_syms = r'[!?~]'
+    infix_syms = r'[=<>@^|&+\*/$%-]'
+    primitives = ['unit', 'int', 'float', 'bool', 'string', 'char', 'list',
+                  'array']
+
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo),
+            (r'\(\*', Comment, 'comment'),
+            (r'\b(%s)\b' % '|'.join(keywords1), Keyword.Namespace),
+            (r'\b(%s)\b' % '|'.join(keywords2), Keyword),
+            (r'\b(%s)\b' % '|'.join(keywords3), Keyword.Type),
+            (r'\b(%s)\b' % '|'.join(keywords4), Keyword),
+            (r'\b(%s)\b' % '|'.join(keywords5), Keyword.Pseudo),
+            (r'\b(%s)\b' % '|'.join(keywords6), Keyword.Reserved),
+            (r'\b([A-Z][A-Za-z0-9_\']*)(?=\s*\.)',
+             Name.Namespace, 'dotted'),
+            (r'\b([A-Z][A-Za-z0-9_\']*)', Name.Class),
+            (r'(%s)' % '|'.join(keyopts[::-1]), Operator),
+            (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator),
+            (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word),
+            (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type),
+
+            (r"[^\W\d][\w']*", Name),
+
+            (r'\d[\d_]*', Number.Integer),
+            (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex),
+            (r'0[oO][0-7][0-7_]*', Number.Oct),
+            (r'0[bB][01][01_]*', Number.Binary),
+            (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float),
+
+            (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'",
+             String.Char),
+            (r"'.'", String.Char),
+            (r"'", Keyword), # a stray quote is another syntax element
+
+            (r'"', String.Double, 'string'),
+
+            (r'[~?][a-z][\w\']*:', Name.Variable),
+        ],
+        'comment': [
+            (r'[^(*)]+', Comment),
+            (r'\(\*', Comment, '#push'),
+            (r'\*\)', Comment, '#pop'),
+            (r'[(*)]', Comment),
+        ],
+        'string': [
+            (r'[^"]+', String.Double),
+            (r'""', String.Double),
+            (r'"', String.Double, '#pop'),
+        ],
+        'dotted': [
+            (r'\s+', Text),
+            (r'\.', Punctuation),
+            (r'[A-Z][A-Za-z0-9_\']*(?=\s*\.)', Name.Namespace),
+            (r'[A-Z][A-Za-z0-9_\']*', Name.Class, '#pop'),
+            (r'[a-z][a-z0-9_\']*', Name, '#pop'),
+            (r'', Text, '#pop')
+        ],
+    }
+
+    def analyse_text(text):
+        if text.startswith('(*'):
+            return True
+
+
+class NewLispLexer(RegexLexer):
+    """
+    For `newLISP. <www.newlisp.org>`_ source code (version 10.3.0).
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'NewLisp'
+    aliases = ['newlisp']
+    filenames = ['*.lsp', '*.nl']
+    mimetypes = ['text/x-newlisp', 'application/x-newlisp']
+
+    flags = re.IGNORECASE | re.MULTILINE | re.UNICODE
+
+    # list of built-in functions for newLISP version 10.3
+    builtins = [
+        '^', '--', '-', ':', '!', '!=', '?', '@', '*', '/', '&', '%', '+', '++',
+        '<', '<<', '<=', '=', '>', '>=', '>>', '|', '~', '$', '$0', '$1', '$10',
+        '$11', '$12', '$13', '$14', '$15', '$2', '$3', '$4', '$5', '$6', '$7',
+        '$8', '$9', '$args', '$idx', '$it', '$main-args', 'abort', 'abs',
+        'acos', 'acosh', 'add', 'address', 'amb', 'and',  'and', 'append-file',
+        'append', 'apply', 'args', 'array-list', 'array?', 'array', 'asin',
+        'asinh', 'assoc', 'atan', 'atan2', 'atanh', 'atom?', 'base64-dec',
+        'base64-enc', 'bayes-query', 'bayes-train', 'begin', 'begin', 'begin',
+        'beta', 'betai', 'bind', 'binomial', 'bits', 'callback', 'case', 'case',
+        'case', 'catch', 'ceil', 'change-dir', 'char', 'chop', 'Class', 'clean',
+        'close', 'command-event', 'cond', 'cond', 'cond', 'cons', 'constant',
+        'context?', 'context', 'copy-file', 'copy', 'cos', 'cosh', 'count',
+        'cpymem', 'crc32', 'crit-chi2', 'crit-z', 'current-line', 'curry',
+        'date-list', 'date-parse', 'date-value', 'date', 'debug', 'dec',
+        'def-new', 'default', 'define-macro', 'define-macro', 'define',
+        'delete-file', 'delete-url', 'delete', 'destroy', 'det', 'device',
+        'difference', 'directory?', 'directory', 'div', 'do-until', 'do-while',
+        'doargs',  'dolist',  'dostring', 'dotimes',  'dotree', 'dump', 'dup',
+        'empty?', 'encrypt', 'ends-with', 'env', 'erf', 'error-event',
+        'eval-string', 'eval', 'exec', 'exists', 'exit', 'exp', 'expand',
+        'explode', 'extend', 'factor', 'fft', 'file-info', 'file?', 'filter',
+        'find-all', 'find', 'first', 'flat', 'float?', 'float', 'floor', 'flt',
+        'fn', 'for-all', 'for', 'fork', 'format', 'fv', 'gammai', 'gammaln',
+        'gcd', 'get-char', 'get-float', 'get-int', 'get-long', 'get-string',
+        'get-url', 'global?', 'global', 'if-not', 'if', 'ifft', 'import', 'inc',
+        'index', 'inf?', 'int', 'integer?', 'integer', 'intersect', 'invert',
+        'irr', 'join', 'lambda-macro', 'lambda?', 'lambda', 'last-error',
+        'last', 'legal?', 'length', 'let', 'let', 'let', 'letex', 'letn',
+        'letn', 'letn', 'list?', 'list', 'load', 'local', 'log', 'lookup',
+        'lower-case', 'macro?', 'main-args', 'MAIN', 'make-dir', 'map', 'mat',
+        'match', 'max', 'member', 'min', 'mod', 'module', 'mul', 'multiply',
+        'NaN?', 'net-accept', 'net-close', 'net-connect', 'net-error',
+        'net-eval', 'net-interface', 'net-ipv', 'net-listen', 'net-local',
+        'net-lookup', 'net-packet', 'net-peek', 'net-peer', 'net-ping',
+        'net-receive-from', 'net-receive-udp', 'net-receive', 'net-select',
+        'net-send-to', 'net-send-udp', 'net-send', 'net-service',
+        'net-sessions', 'new', 'nil?', 'nil', 'normal', 'not', 'now', 'nper',
+        'npv', 'nth', 'null?', 'number?', 'open', 'or', 'ostype', 'pack',
+        'parse-date', 'parse', 'peek', 'pipe', 'pmt', 'pop-assoc', 'pop',
+        'post-url', 'pow', 'prefix', 'pretty-print', 'primitive?', 'print',
+        'println', 'prob-chi2', 'prob-z', 'process', 'prompt-event',
+        'protected?', 'push', 'put-url', 'pv', 'quote?', 'quote', 'rand',
+        'random', 'randomize', 'read', 'read-char', 'read-expr', 'read-file',
+        'read-key', 'read-line', 'read-utf8', 'read', 'reader-event',
+        'real-path', 'receive', 'ref-all', 'ref', 'regex-comp', 'regex',
+        'remove-dir', 'rename-file', 'replace', 'reset', 'rest', 'reverse',
+        'rotate', 'round', 'save', 'search', 'seed', 'seek', 'select', 'self',
+        'semaphore', 'send', 'sequence', 'series', 'set-locale', 'set-ref-all',
+        'set-ref', 'set', 'setf',  'setq', 'sgn', 'share', 'signal', 'silent',
+        'sin', 'sinh', 'sleep', 'slice', 'sort', 'source', 'spawn', 'sqrt',
+        'starts-with', 'string?', 'string', 'sub', 'swap', 'sym', 'symbol?',
+        'symbols', 'sync', 'sys-error', 'sys-info', 'tan', 'tanh', 'term',
+        'throw-error', 'throw', 'time-of-day', 'time', 'timer', 'title-case',
+        'trace-highlight', 'trace', 'transpose', 'Tree', 'trim', 'true?',
+        'true', 'unicode', 'unify', 'unique', 'unless', 'unpack', 'until',
+        'upper-case', 'utf8', 'utf8len', 'uuid', 'wait-pid', 'when', 'while',
+        'write', 'write-char', 'write-file', 'write-line', 'write',
+        'xfer-event', 'xml-error', 'xml-parse', 'xml-type-tags', 'zero?',
+    ]
+
+    # valid names
+    valid_name = r'([a-zA-Z0-9!$%&*+.,/<=>?@^_~|-])+|(\[.*?\])+'
+
+    tokens = {
+        'root': [
+            # shebang
+            (r'#!(.*?)$', Comment.Preproc),
+            # comments starting with semicolon
+            (r';.*$', Comment.Single),
+            # comments starting with #
+            (r'#.*$', Comment.Single),
+
+            # whitespace
+            (r'\s+', Text),
+
+            # strings, symbols and characters
+            (r'"(\\\\|\\"|[^"])*"', String),
+
+            # braces
+            (r"{", String, "bracestring"),
+
+            # [text] ... [/text] delimited strings
+            (r'\[text\]*', String, "tagstring"),
+
+            # 'special' operators...
+            (r"('|:)", Operator),
+
+            # highlight the builtins
+            ('(%s)' % '|'.join(re.escape(entry) + '\\b' for entry in builtins),
+             Keyword),
+
+            # the remaining functions
+            (r'(?<=\()' + valid_name, Name.Variable),
+
+            # the remaining variables
+            (valid_name, String.Symbol),
+
+            # parentheses
+            (r'(\(|\))', Punctuation),
+        ],
+
+        # braced strings...
+        'bracestring': [
+             ("{", String, "#push"),
+             ("}", String, "#pop"),
+             ("[^{}]+", String),
+        ],
+
+        # tagged [text]...[/text] delimited strings...
+        'tagstring': [
+            (r'(?s)(.*?)(\[/text\])', String, '#pop'),
+        ],
+    }
+
+
+class ElixirLexer(RegexLexer):
+    """
+    For the `Elixir language <http://elixir-lang.org>`_.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Elixir'
+    aliases = ['elixir', 'ex', 'exs']
+    filenames = ['*.ex', '*.exs']
+    mimetypes = ['text/x-elixir']
+
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r'#.*$', Comment.Single),
+            (r'\b(case|end|bc|lc|if|unless|try|loop|receive|fn|defmodule|'
+             r'defp|def|defprotocol|defimpl|defrecord|defmacro|defdelegate|'
+             r'defexception|exit|raise|throw)\b(?![?!])|'
+             r'(?<!\.)\b(do|\-\>)\b\s*', Keyword),
+            (r'\b(import|require|use|recur|quote|unquote|super)\b(?![?!])',
+                Keyword.Namespace),
+            (r'(?<!\.)\b(and|not|or|when|xor|in)\b', Operator.Word),
+            (r'%=|\*=|\*\*=|\+=|\-=|\^=|\|\|=|'
+             r'<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?=[ \t])\?|'
+             r'(?<=[ \t])!+|&&|\|\||\^|\*|\+|\-|/|'
+             r'\||\+\+|\-\-|\*\*|\/\/|\<\-|\<\>|<<|>>|=|\.', Operator),
+            (r'(?<!:)(:)([a-zA-Z_]\w*([?!]|=(?![>=]))?|\<\>|===?|>=?|<=?|'
+             r'<=>|&&?|%\(\)|%\[\]|%\{\}|\+\+?|\-\-?|\|\|?|\!|//|[%&`/\|]|'
+             r'\*\*?|=?~|<\-)|([a-zA-Z_]\w*([?!])?)(:)(?!:)', String.Symbol),
+            (r':"', String.Symbol, 'interpoling_symbol'),
+            (r'\b(nil|true|false)\b(?![?!])', Name.Constant),
+            (r'\b[A-Z]\w*\b', Name.Constant),
+            (r'\b(__(FILE|LINE|MODULE|STOP_ITERATOR|EXCEPTION|OP|REF|FUNCTION|'
+             r'BLOCK|KVBLOCK)__)\b(?![?!])', Name.Builtin.Pseudo),
+            (r'[a-zA-Z_!]\w*[!\?]?', Name),
+            (r'[(){};,/\|:\\\[\]]', Punctuation),
+            (r'@[a-zA-Z_]\w*|&\d', Name.Variable),
+            (r'\b(0[xX][0-9A-Fa-f]+|\d(_?\d)*(\.(?![^\d\s])'
+             r'(_?\d)*)?([eE][-+]?\d(_?\d)*)?|0[bB][01]+)\b', Number),
+            include('strings'),
+        ],
+        'strings': [
+            (r'"""(?:.|\n)*?"""', String.Doc),
+            (r"'''(?:.|\n)*?'''", String.Doc),
+            (r'"', String.Double, 'dqs'),
+            (r"'.*'", String.Single),
+            (r'(?<!\w)\?(\\(x\d{1,2}|\h{1,2}(?!\h)\b|0[0-7]{0,2}(?![0-7])\b|'
+             r'[^x0MC])|(\\[MC]-)+\w|[^\s\\])', String.Other)
+        ],
+        'dqs': [
+            (r'"', String.Double, "#pop"),
+            include('interpoling'),
+            (r'[^#"]+', String.Double),
+        ],
+        'interpoling': [
+            (r'#{', String.Interpol, 'interpoling_string'),
+        ],
+        'interpoling_string' : [
+            (r'}', String.Interpol, "#pop"),
+            include('root')
+        ],
+        'interpoling_symbol': [
+            (r'"', String.Symbol, "#pop"),
+            include('interpoling'),
+            (r'[^#"]+', String.Symbol),
+        ],
+    }
+
+
+class ElixirConsoleLexer(Lexer):
+    """
+    For Elixir interactive console (iex) output like:
+
+    .. sourcecode:: iex
+
+        iex> [head | tail] = [1,2,3]
+        [1,2,3]
+        iex> head
+        1
+        iex> tail
+        [2,3]
+        iex> [head | tail]
+        [1,2,3]
+        iex> length [head | tail]
+        3
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Elixir iex session'
+    aliases = ['iex']
+    mimetypes = ['text/x-elixir-shellsession']
+
+    _prompt_re = re.compile('(iex|\.{3})> ')
+
+    def get_tokens_unprocessed(self, text):
+        exlexer = ElixirLexer(**self.options)
+
+        curcode = ''
+        insertions = []
+        for match in line_re.finditer(text):
+            line = match.group()
+            if line.startswith(u'** '):
+                insertions.append((len(curcode),
+                                   [(0, Generic.Error, line[:-1])]))
+                curcode += line[-1:]
+            else:
+                m = self._prompt_re.match(line)
+                if m is not None:
+                    end = m.end()
+                    insertions.append((len(curcode),
+                                       [(0, Generic.Prompt, line[:end])]))
+                    curcode += line[end:]
+                else:
+                    if curcode:
+                        for item in do_insertions(insertions,
+                                        exlexer.get_tokens_unprocessed(curcode)):
+                            yield item
+                        curcode = ''
+                        insertions = []
+                    yield match.start(), Generic.Output, line
+        if curcode:
+            for item in do_insertions(insertions,
+                                      exlexer.get_tokens_unprocessed(curcode)):
+                yield item
index b176cac1d72aa913d37e7759b9d98c7df88ff987..0db35e740d72942811b7ca411dc0d622edfb9b87 100644 (file)
@@ -5,18 +5,17 @@
 
     Lexers for hardware descriptor languages.
 
-    :copyright: Copyright 2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
 import re
-
-from pygments.lexer import RegexLexer, include, bygroups
+from pygments.lexer import RegexLexer, bygroups, include, using, this
 from pygments.token import \
      Text, Comment, Operator, Keyword, Name, String, Number, Punctuation, \
      Error
 
-__all__ = ['VerilogLexer']
+__all__ = ['VerilogLexer', 'SystemVerilogLexer', 'VhdlLexer']
 
 
 class VerilogLexer(RegexLexer):
@@ -27,7 +26,7 @@ class VerilogLexer(RegexLexer):
     """
     name = 'verilog'
     aliases = ['v']
-    filenames = ['*.v', '*.sv']
+    filenames = ['*.v']
     mimetypes = ['text/x-verilog']
 
     #: optional Comment or Whitespace
@@ -57,8 +56,9 @@ class VerilogLexer(RegexLexer):
             (r'[()\[\],.;\']', Punctuation),
             (r'`[a-zA-Z_][a-zA-Z0-9_]*', Name.Constant),
 
-            (r'^\s*(package)(\s+)', bygroups(Keyword.Namespace, Text)),
-            (r'^\s*(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
+            (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)),
+            (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text),
+             'import'),
 
             (r'(always|always_comb|always_ff|always_latch|and|assign|automatic|'
              r'begin|break|buf|bufif0|bufif1|case|casex|casez|cmos|const|'
@@ -76,24 +76,157 @@ class VerilogLexer(RegexLexer):
              r'unsigned|var|vectored|void|wait|weak0|weak1|while|'
              r'xnor|xor)\b', Keyword),
 
-            (r'(`accelerate|`autoexpand_vectornets|`celldefine|`default_nettype|'
-             r'`else|`elsif|`endcelldefine|`endif|`endprotect|`endprotected|'
-             r'`expand_vectornets|`ifdef|`ifndef|`include|`noaccelerate|`noexpand_vectornets|'
-             r'`noremove_gatenames|`noremove_netnames|`nounconnected_drive|'
-             r'`protect|`protected|`remove_gatenames|`remove_netnames|`resetall|'
-             r'`timescale|`unconnected_drive|`undef)\b', Comment.Preproc),
-
-            (r'(\$bits|\$bitstoreal|\$bitstoshortreal|\$countdrivers|\$display|\$fclose|'
-             r'\$fdisplay|\$finish|\$floor|\$fmonitor|\$fopen|\$fstrobe|\$fwrite|'
-             r'\$getpattern|\$history|\$incsave|\$input|\$itor|\$key|\$list|\$log|'
-             r'\$monitor|\$monitoroff|\$monitoron|\$nokey|\$nolog|\$printtimescale|'
-             r'\$random|\$readmemb|\$readmemh|\$realtime|\$realtobits|\$reset|\$reset_count|'
-             r'\$reset_value|\$restart|\$rtoi|\$save|\$scale|\$scope|\$shortrealtobits|'
-             r'\$showscopes|\$showvariables|\$showvars|\$sreadmemb|\$sreadmemh|'
-             r'\$stime|\$stop|\$strobe|\$time|\$timeformat|\$write)\b', Name.Builtin),
+            (r'`(accelerate|autoexpand_vectornets|celldefine|default_nettype|'
+             r'else|elsif|endcelldefine|endif|endprotect|endprotected|'
+             r'expand_vectornets|ifdef|ifndef|include|noaccelerate|noexpand_vectornets|'
+             r'noremove_gatenames|noremove_netnames|nounconnected_drive|'
+             r'protect|protected|remove_gatenames|remove_netnames|resetall|'
+             r'timescale|unconnected_drive|undef)\b', Comment.Preproc),
+
+            (r'\$(bits|bitstoreal|bitstoshortreal|countdrivers|display|fclose|'
+             r'fdisplay|finish|floor|fmonitor|fopen|fstrobe|fwrite|'
+             r'getpattern|history|incsave|input|itor|key|list|log|'
+             r'monitor|monitoroff|monitoron|nokey|nolog|printtimescale|'
+             r'random|readmemb|readmemh|realtime|realtobits|reset|reset_count|'
+             r'reset_value|restart|rtoi|save|scale|scope|shortrealtobits|'
+             r'showscopes|showvariables|showvars|sreadmemb|sreadmemh|'
+             r'stime|stop|strobe|time|timeformat|write)\b', Name.Builtin),
+
+            (r'(byte|shortint|int|longint|integer|time|'
+             r'bit|logic|reg|'
+             r'supply0|supply1|tri|triand|trior|tri0|tri1|trireg|uwire|wire|wand|wor'
+             r'shortreal|real|realtime)\b', Keyword.Type),
+            ('[a-zA-Z_][a-zA-Z0-9_]*:(?!:)', Name.Label),
+            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
+        ],
+        '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'),
+        ],
+        'import': [
+            (r'[a-zA-Z0-9_:]+\*?', Name.Namespace, '#pop')
+        ]
+    }
+
+    def get_tokens_unprocessed(self, text):
+        for index, token, value in \
+            RegexLexer.get_tokens_unprocessed(self, text):
+            # Convention: mark all upper case names as constants
+            if token is Name:
+                if value.isupper():
+                    token = Name.Constant
+            yield index, token, value
+
+
+class SystemVerilogLexer(RegexLexer):
+    """
+    Extends verilog lexer to recognise all SystemVerilog keywords from IEEE
+    1800-2009 standard.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'systemverilog'
+    aliases = ['sv']
+    filenames = ['*.sv', '*.svh']
+    mimetypes = ['text/x-systemverilog']
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'root': [
+            (r'^\s*`define', Comment.Preproc, 'macro'),
+            (r'^(\s*)(package)(\s+)', bygroups(Text, Keyword.Namespace, Text)),
+            (r'^(\s*)(import)(\s+)', bygroups(Text, Keyword.Namespace, Text), 'import'),
+
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text), # line continuation
+            (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+            (r'[{}#@]', Punctuation),
+            (r'L?"', String, 'string'),
+            (r"L?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'", String.Char),
+            (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
+            (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
+            (r'([0-9]+)|(\'h)[0-9a-fA-F]+', Number.Hex),
+            (r'([0-9]+)|(\'b)[0-1]+', Number.Hex),   # should be binary
+            (r'([0-9]+)|(\'d)[0-9]+', Number.Integer),
+            (r'([0-9]+)|(\'o)[0-7]+', Number.Oct),
+            (r'\'[01xz]', Number),
+            (r'\d+[Ll]?', Number.Integer),
+            (r'\*/', Error),
+            (r'[~!%^&*+=|?:<>/-]', Operator),
+            (r'[()\[\],.;\']', Punctuation),
+            (r'`[a-zA-Z_][a-zA-Z0-9_]*', Name.Constant),
+
+            (r'(accept_on|alias|always|always_comb|always_ff|always_latch|'
+             r'and|assert|assign|assume|automatic|before|begin|bind|bins|'
+             r'binsof|bit|break|buf|bufif0|bufif1|byte|case|casex|casez|'
+             r'cell|chandle|checker|class|clocking|cmos|config|const|constraint|'
+             r'context|continue|cover|covergroup|coverpoint|cross|deassign|'
+             r'default|defparam|design|disable|dist|do|edge|else|end|endcase|'
+             r'endchecker|endclass|endclocking|endconfig|endfunction|endgenerate|'
+             r'endgroup|endinterface|endmodule|endpackage|endprimitive|'
+             r'endprogram|endproperty|endsequence|endspecify|endtable|'
+             r'endtask|enum|event|eventually|expect|export|extends|extern|'
+             r'final|first_match|for|force|foreach|forever|fork|forkjoin|'
+             r'function|generate|genvar|global|highz0|highz1|if|iff|ifnone|'
+             r'ignore_bins|illegal_bins|implies|import|incdir|include|'
+             r'initial|inout|input|inside|instance|int|integer|interface|'
+             r'intersect|join|join_any|join_none|large|let|liblist|library|'
+             r'local|localparam|logic|longint|macromodule|matches|medium|'
+             r'modport|module|nand|negedge|new|nexttime|nmos|nor|noshowcancelled|'
+             r'not|notif0|notif1|null|or|output|package|packed|parameter|'
+             r'pmos|posedge|primitive|priority|program|property|protected|'
+             r'pull0|pull1|pulldown|pullup|pulsestyle_ondetect|pulsestyle_onevent|'
+             r'pure|rand|randc|randcase|randsequence|rcmos|real|realtime|'
+             r'ref|reg|reject_on|release|repeat|restrict|return|rnmos|'
+             r'rpmos|rtran|rtranif0|rtranif1|s_always|s_eventually|s_nexttime|'
+             r's_until|s_until_with|scalared|sequence|shortint|shortreal|'
+             r'showcancelled|signed|small|solve|specify|specparam|static|'
+             r'string|strong|strong0|strong1|struct|super|supply0|supply1|'
+             r'sync_accept_on|sync_reject_on|table|tagged|task|this|throughout|'
+             r'time|timeprecision|timeunit|tran|tranif0|tranif1|tri|tri0|'
+             r'tri1|triand|trior|trireg|type|typedef|union|unique|unique0|'
+             r'unsigned|until|until_with|untyped|use|uwire|var|vectored|'
+             r'virtual|void|wait|wait_order|wand|weak|weak0|weak1|while|'
+             r'wildcard|wire|with|within|wor|xnor|xor)\b', Keyword ),
+
+            (r'(`__FILE__|`__LINE__|`begin_keywords|`celldefine|`default_nettype|'
+             r'`define|`else|`elsif|`end_keywords|`endcelldefine|`endif|'
+             r'`ifdef|`ifndef|`include|`line|`nounconnected_drive|`pragma|'
+             r'`resetall|`timescale|`unconnected_drive|`undef|`undefineall)\b',
+             Comment.Preproc ),
+
+            (r'(\$display|\$displayb|\$displayh|\$displayo|\$dumpall|\$dumpfile|'
+             r'\$dumpflush|\$dumplimit|\$dumpoff|\$dumpon|\$dumpports|'
+             r'\$dumpportsall|\$dumpportsflush|\$dumpportslimit|\$dumpportsoff|'
+             r'\$dumpportson|\$dumpvars|\$fclose|\$fdisplay|\$fdisplayb|'
+             r'\$fdisplayh|\$fdisplayo|\$feof|\$ferror|\$fflush|\$fgetc|'
+             r'\$fgets|\$fmonitor|\$fmonitorb|\$fmonitorh|\$fmonitoro|'
+             r'\$fopen|\$fread|\$fscanf|\$fseek|\$fstrobe|\$fstrobeb|\$fstrobeh|'
+             r'\$fstrobeo|\$ftell|\$fwrite|\$fwriteb|\$fwriteh|\$fwriteo|'
+             r'\$monitor|\$monitorb|\$monitorh|\$monitoro|\$monitoroff|'
+             r'\$monitoron|\$plusargs|\$readmemb|\$readmemh|\$rewind|\$sformat|'
+             r'\$sformatf|\$sscanf|\$strobe|\$strobeb|\$strobeh|\$strobeo|'
+             r'\$swrite|\$swriteb|\$swriteh|\$swriteo|\$test|\$ungetc|'
+             r'\$value\$plusargs|\$write|\$writeb|\$writeh|\$writememb|'
+             r'\$writememh|\$writeo)\b' , Name.Builtin ),
 
             (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
-            (r'(byte|shortint|int|longint|interger|time|'
+            (r'(byte|shortint|int|longint|integer|time|'
              r'bit|logic|reg|'
              r'supply0|supply1|tri|triand|trior|tri0|tri1|trireg|uwire|wire|wand|wor'
              r'shortreal|real|realtime)\b', Keyword.Type),
@@ -132,4 +265,92 @@ class VerilogLexer(RegexLexer):
                     token = Name.Constant
             yield index, token, value
 
+    def analyse_text(text):
+        if text.startswith('//') or text.startswith('/*'):
+            return 0.5
+
+
+class VhdlLexer(RegexLexer):
+    """
+    For VHDL source code.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'vhdl'
+    aliases = ['vhdl']
+    filenames = ['*.vhdl', '*.vhd']
+    mimetypes = ['text/x-vhdl']
+    flags = re.MULTILINE | re.IGNORECASE
 
+    tokens = {
+        'root': [
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text), # line continuation
+            (r'--(?![!#$%&*+./<=>?@\^|_~]).*?$', Comment.Single),
+            (r"'(U|X|0|1|Z|W|L|H|-)'", String.Char),
+            (r'[~!%^&*+=|?:<>/-]', Operator),
+            (r"'[a-zA-Z_][a-zA-Z0-9_]*", Name.Attribute),
+            (r'[()\[\],.;\']', Punctuation),
+            (r'"[^\n\\]*"', String),
+
+            (r'(library)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)',
+             bygroups(Keyword, Text, Name.Namespace)),
+            (r'(use)(\s+)(entity)', bygroups(Keyword, Text, Keyword)),
+            (r'(use)(\s+)([a-zA-Z_][\.a-zA-Z0-9_]*)',
+             bygroups(Keyword, Text, Name.Namespace)),
+            (r'(entity|component)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)',
+             bygroups(Keyword, Text, Name.Class)),
+            (r'(architecture|configuration)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s+)'
+             r'(of)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)(\s+)(is)',
+             bygroups(Keyword, Text, Name.Class, Text, Keyword, Text,
+                      Name.Class, Text, Keyword)),
+
+            (r'(end)(\s+)', bygroups(using(this), Text), 'endblock'),
+
+            include('types'),
+            include('keywords'),
+            include('numbers'),
+
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
+        ],
+        'endblock': [
+            include('keywords'),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class),
+            (r'(\s+)', Text),
+            (r';', Punctuation, '#pop'),
+        ],
+        'types': [
+            (r'(boolean|bit|character|severity_level|integer|time|delay_length|'
+             r'natural|positive|string|bit_vector|file_open_kind|'
+             r'file_open_status|std_ulogic|std_ulogic_vector|std_logic|'
+             r'std_logic_vector)\b', Keyword.Type),
+        ],
+        'keywords': [
+            (r'(abs|access|after|alias|all|and|'
+             r'architecture|array|assert|attribute|begin|block|'
+             r'body|buffer|bus|case|component|configuration|'
+             r'constant|disconnect|downto|else|elsif|end|'
+             r'entity|exit|file|for|function|generate|'
+             r'generic|group|guarded|if|impure|in|'
+             r'inertial|inout|is|label|library|linkage|'
+             r'literal|loop|map|mod|nand|new|'
+             r'next|nor|not|null|of|on|'
+             r'open|or|others|out|package|port|'
+             r'postponed|procedure|process|pure|range|record|'
+             r'register|reject|return|rol|ror|select|'
+             r'severity|signal|shared|sla|sli|sra|'
+             r'srl|subtype|then|to|transport|type|'
+             r'units|until|use|variable|wait|when|'
+             r'while|with|xnor|xor)\b', Keyword),
+        ],
+        'numbers': [
+            (r'\d{1,2}#[0-9a-fA-F_]+#?', Number.Integer),
+            (r'[0-1_]+(\.[0-1_])', Number.Integer),
+            (r'\d+', Number.Integer),
+            (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
+            (r'H"[0-9a-fA-F_]+"', Number.Oct),
+            (r'O"[0-7_]+"', Number.Oct),
+            (r'B"[0-1_]+"', Number.Oct),
+        ],
+    }
diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py
new file mode 100644 (file)
index 0000000..b56d458
--- /dev/null
@@ -0,0 +1,847 @@
+# -*- coding: utf-8 -*-
+"""
+    pygments.lexers.jvm
+    ~~~~~~~~~~~~~~~~~~~
+
+    Pygments lexers for JVM languages.
+
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
+     this
+from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
+     Number, Punctuation
+from pygments.util import get_choice_opt
+from pygments import unistring as uni
+
+
+__all__ = ['JavaLexer', 'ScalaLexer', 'GosuLexer', 'GosuTemplateLexer',
+           'GroovyLexer', 'IokeLexer', 'ClojureLexer', 'KotlinLexer']
+
+
+class JavaLexer(RegexLexer):
+    """
+    For `Java <http://www.sun.com/java/>`_ source code.
+    """
+
+    name = 'Java'
+    aliases = ['java']
+    filenames = ['*.java']
+    mimetypes = ['text/x-java']
+
+    flags = re.MULTILINE | re.DOTALL
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'root': [
+            # method names
+            (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
+             r'([a-zA-Z_][a-zA-Z0-9_]*)'                    # method name
+             r'(\s*)(\()',                                  # signature start
+             bygroups(using(this), Name.Function, Text, Operator)),
+            (r'[^\S\n]+', Text),
+            (r'//.*?\n', Comment.Single),
+            (r'/\*.*?\*/', Comment.Multiline),
+            (r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
+            (r'(assert|break|case|catch|continue|default|do|else|finally|for|'
+             r'if|goto|instanceof|new|return|switch|this|throw|try|while)\b',
+             Keyword),
+            (r'(abstract|const|enum|extends|final|implements|native|private|'
+             r'protected|public|static|strictfp|super|synchronized|throws|'
+             r'transient|volatile)\b', Keyword.Declaration),
+            (r'(boolean|byte|char|double|float|int|long|short|void)\b',
+             Keyword.Type),
+            (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
+            (r'(true|false|null)\b', Keyword.Constant),
+            (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text), 'class'),
+            (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
+            (r'"(\\\\|\\"|[^"])*"', String),
+            (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
+            (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
+            (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
+            (r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r'0x[0-9a-f]+', Number.Hex),
+            (r'[0-9]+L?', Number.Integer),
+            (r'\n', Text)
+        ],
+        'class': [
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
+        ],
+        'import': [
+            (r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
+        ],
+    }
+
+
+class ScalaLexer(RegexLexer):
+    """
+    For `Scala <http://www.scala-lang.org>`_ source code.
+    """
+
+    name = 'Scala'
+    aliases = ['scala']
+    filenames = ['*.scala']
+    mimetypes = ['text/x-scala']
+
+    flags = re.MULTILINE | re.DOTALL
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    # don't use raw unicode strings!
+    op = u'[-~\\^\\*!%&\\\\<>\\|+=:/?@\u00a6-\u00a7\u00a9\u00ac\u00ae\u00b0-\u00b1\u00b6\u00d7\u00f7\u03f6\u0482\u0606-\u0608\u060e-\u060f\u06e9\u06fd-\u06fe\u07f6\u09fa\u0b70\u0bf3-\u0bf8\u0bfa\u0c7f\u0cf1-\u0cf2\u0d79\u0f01-\u0f03\u0f13-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcf\u109e-\u109f\u1360\u1390-\u1399\u1940\u19e0-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u2044\u2052\u207a-\u207c\u208a-\u208c\u2100-\u2101\u2103-\u2106\u2108-\u2109\u2114\u2116-\u2118\u211e-\u2123\u2125\u2127\u2129\u212e\u213a-\u213b\u2140-\u2144\u214a-\u214d\u214f\u2190-\u2328\u232b-\u244a\u249c-\u24e9\u2500-\u2767\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2b54\u2ce5-\u2cea\u2e80-\u2ffb\u3004\u3012-\u3013\u3020\u3036-\u3037\u303e-\u303f\u3190-\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua828-\ua82b\ufb29\ufdfd\ufe62\ufe64-\ufe66\uff0b\uff1c-\uff1e\uff5c\uff5e\uffe2\uffe4\uffe8-\uffee\ufffc-\ufffd]+'
+
+    letter = u'[a-zA-Z\\$_\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02af\u0370-\u0373\u0376-\u0377\u037b-\u037d\u0386\u0388-\u03f5\u03f7-\u0481\u048a-\u0556\u0561-\u0587\u05d0-\u05f2\u0621-\u063f\u0641-\u064a\u066e-\u066f\u0671-\u06d3\u06d5\u06ee-\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u0904-\u0939\u093d\u0950\u0958-\u0961\u0972-\u097f\u0985-\u09b9\u09bd\u09ce\u09dc-\u09e1\u09f0-\u09f1\u0a05-\u0a39\u0a59-\u0a5e\u0a72-\u0a74\u0a85-\u0ab9\u0abd\u0ad0-\u0ae1\u0b05-\u0b39\u0b3d\u0b5c-\u0b61\u0b71\u0b83-\u0bb9\u0bd0\u0c05-\u0c3d\u0c58-\u0c61\u0c85-\u0cb9\u0cbd\u0cde-\u0ce1\u0d05-\u0d3d\u0d60-\u0d61\u0d7a-\u0d7f\u0d85-\u0dc6\u0e01-\u0e30\u0e32-\u0e33\u0e40-\u0e45\u0e81-\u0eb0\u0eb2-\u0eb3\u0ebd-\u0ec4\u0edc-\u0f00\u0f40-\u0f6c\u0f88-\u0f8b\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065-\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10fa\u1100-\u135a\u1380-\u138f\u13a0-\u166c\u166f-\u1676\u1681-\u169a\u16a0-\u16ea\u16ee-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u1770\u1780-\u17b3\u17dc\u1820-\u1842\u1844-\u18a8\u18aa-\u191c\u1950-\u19a9\u19c1-\u19c7\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae-\u1baf\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c77\u1d00-\u1d2b\u1d62-\u1d77\u1d79-\u1d9a\u1e00-\u1fbc\u1fbe\u1fc2-\u1fcc\u1fd0-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ffc\u2071\u207f\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c7c\u2c80-\u2ce4\u2d00-\u2d65\u2d80-\u2dde\u3006-\u3007\u3021-\u3029\u3038-\u303a\u303c\u3041-\u3096\u309f\u30a1-\u30fa\u30ff-\u318e\u31a0-\u31b7\u31f0-\u31ff\u3400-\u4db5\u4e00-\ua014\ua016-\ua48c\ua500-\ua60b\ua610-\ua61f\ua62a-\ua66e\ua680-\ua697\ua722-\ua76f\ua771-\ua787\ua78b-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua90a-\ua925\ua930-\ua946\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uac00-\ud7a3\uf900-\ufb1d\ufb1f-\ufb28\ufb2a-\ufd3d\ufd50-\ufdfb\ufe70-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uff6f\uff71-\uff9d\uffa0-\uffdc]'
+
+    upper = u'[A-Z\\$_\u00c0-\u00d6\u00d8-\u00de\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132\u0134\u0136\u0139\u013b\u013d\u013f\u0141\u0143\u0145\u0147\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178-\u0179\u017b\u017d\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018b\u018e-\u0191\u0193-\u0194\u0196-\u0198\u019c-\u019d\u019f-\u01a0\u01a2\u01a4\u01a6-\u01a7\u01a9\u01ac\u01ae-\u01af\u01b1-\u01b3\u01b5\u01b7-\u01b8\u01bc\u01c4\u01c7\u01ca\u01cd\u01cf\u01d1\u01d3\u01d5\u01d7\u01d9\u01db\u01de\u01e0\u01e2\u01e4\u01e6\u01e8\u01ea\u01ec\u01ee\u01f1\u01f4\u01f6-\u01f8\u01fa\u01fc\u01fe\u0200\u0202\u0204\u0206\u0208\u020a\u020c\u020e\u0210\u0212\u0214\u0216\u0218\u021a\u021c\u021e\u0220\u0222\u0224\u0226\u0228\u022a\u022c\u022e\u0230\u0232\u023a-\u023b\u023d-\u023e\u0241\u0243-\u0246\u0248\u024a\u024c\u024e\u0370\u0372\u0376\u0386\u0388-\u038f\u0391-\u03ab\u03cf\u03d2-\u03d4\u03d8\u03da\u03dc\u03de\u03e0\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03f9-\u03fa\u03fd-\u042f\u0460\u0462\u0464\u0466\u0468\u046a\u046c\u046e\u0470\u0472\u0474\u0476\u0478\u047a\u047c\u047e\u0480\u048a\u048c\u048e\u0490\u0492\u0494\u0496\u0498\u049a\u049c\u049e\u04a0\u04a2\u04a4\u04a6\u04a8\u04aa\u04ac\u04ae\u04b0\u04b2\u04b4\u04b6\u04b8\u04ba\u04bc\u04be\u04c0-\u04c1\u04c3\u04c5\u04c7\u04c9\u04cb\u04cd\u04d0\u04d2\u04d4\u04d6\u04d8\u04da\u04dc\u04de\u04e0\u04e2\u04e4\u04e6\u04e8\u04ea\u04ec\u04ee\u04f0\u04f2\u04f4\u04f6\u04f8\u04fa\u04fc\u04fe\u0500\u0502\u0504\u0506\u0508\u050a\u050c\u050e\u0510\u0512\u0514\u0516\u0518\u051a\u051c\u051e\u0520\u0522\u0531-\u0556\u10a0-\u10c5\u1e00\u1e02\u1e04\u1e06\u1e08\u1e0a\u1e0c\u1e0e\u1e10\u1e12\u1e14\u1e16\u1e18\u1e1a\u1e1c\u1e1e\u1e20\u1e22\u1e24\u1e26\u1e28\u1e2a\u1e2c\u1e2e\u1e30\u1e32\u1e34\u1e36\u1e38\u1e3a\u1e3c\u1e3e\u1e40\u1e42\u1e44\u1e46\u1e48\u1e4a\u1e4c\u1e4e\u1e50\u1e52\u1e54\u1e56\u1e58\u1e5a\u1e5c\u1e5e\u1e60\u1e62\u1e64\u1e66\u1e68\u1e6a\u1e6c\u1e6e\u1e70\u1e72\u1e74\u1e76\u1e78\u1e7a\u1e7c\u1e7e\u1e80\u1e82\u1e84\u1e86\u1e88\u1e8a\u1e8c\u1e8e\u1e90\u1e92\u1e94\u1e9e\u1ea0\u1ea2\u1ea4\u1ea6\u1ea8\u1eaa\u1eac\u1eae\u1eb0\u1eb2\u1eb4\u1eb6\u1eb8\u1eba\u1ebc\u1ebe\u1ec0\u1ec2\u1ec4\u1ec6\u1ec8\u1eca\u1ecc\u1ece\u1ed0\u1ed2\u1ed4\u1ed6\u1ed8\u1eda\u1edc\u1ede\u1ee0\u1ee2\u1ee4\u1ee6\u1ee8\u1eea\u1eec\u1eee\u1ef0\u1ef2\u1ef4\u1ef6\u1ef8\u1efa\u1efc\u1efe\u1f08-\u1f0f\u1f18-\u1f1d\u1f28-\u1f2f\u1f38-\u1f3f\u1f48-\u1f4d\u1f59-\u1f5f\u1f68-\u1f6f\u1fb8-\u1fbb\u1fc8-\u1fcb\u1fd8-\u1fdb\u1fe8-\u1fec\u1ff8-\u1ffb\u2102\u2107\u210b-\u210d\u2110-\u2112\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u2130-\u2133\u213e-\u213f\u2145\u2183\u2c00-\u2c2e\u2c60\u2c62-\u2c64\u2c67\u2c69\u2c6b\u2c6d-\u2c6f\u2c72\u2c75\u2c80\u2c82\u2c84\u2c86\u2c88\u2c8a\u2c8c\u2c8e\u2c90\u2c92\u2c94\u2c96\u2c98\u2c9a\u2c9c\u2c9e\u2ca0\u2ca2\u2ca4\u2ca6\u2ca8\u2caa\u2cac\u2cae\u2cb0\u2cb2\u2cb4\u2cb6\u2cb8\u2cba\u2cbc\u2cbe\u2cc0\u2cc2\u2cc4\u2cc6\u2cc8\u2cca\u2ccc\u2cce\u2cd0\u2cd2\u2cd4\u2cd6\u2cd8\u2cda\u2cdc\u2cde\u2ce0\u2ce2\ua640\ua642\ua644\ua646\ua648\ua64a\ua64c\ua64e\ua650\ua652\ua654\ua656\ua658\ua65a\ua65c\ua65e\ua662\ua664\ua666\ua668\ua66a\ua66c\ua680\ua682\ua684\ua686\ua688\ua68a\ua68c\ua68e\ua690\ua692\ua694\ua696\ua722\ua724\ua726\ua728\ua72a\ua72c\ua72e\ua732\ua734\ua736\ua738\ua73a\ua73c\ua73e\ua740\ua742\ua744\ua746\ua748\ua74a\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]'
+
+    idrest = ur'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op)
+
+    tokens = {
+        'root': [
+            # method names
+            (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'),
+            (ur"'%s" % idrest, Text.Symbol),
+            (r'[^\S\n]+', Text),
+            (r'//.*?\n', Comment.Single),
+            (r'/\*', Comment.Multiline, 'comment'),
+            (ur'@%s' % idrest, Name.Decorator),
+            (ur'(abstract|ca(?:se|tch)|d(?:ef|o)|e(?:lse|xtends)|'
+             ur'f(?:inal(?:ly)?|or(?:Some)?)|i(?:f|mplicit)|'
+             ur'lazy|match|new|override|pr(?:ivate|otected)'
+             ur'|re(?:quires|turn)|s(?:ealed|uper)|'
+             ur't(?:h(?:is|row)|ry)|va[lr]|w(?:hile|ith)|yield)\b|'
+             u'(<[%:-]|=>|>:|[#=@_\u21D2\u2190])(\\b|(?=\\s)|$)', Keyword),
+            (ur':(?!%s)' % op, Keyword, 'type'),
+            (ur'%s%s\b' % (upper, idrest), Name.Class),
+            (r'(true|false|null)\b', Keyword.Constant),
+            (r'(import|package)(\s+)', bygroups(Keyword, Text), 'import'),
+            (r'(type)(\s+)', bygroups(Keyword, Text), 'type'),
+            (r'""".*?"""', String),
+            (r'"(\\\\|\\"|[^"])*"', String),
+            (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
+#            (ur'(\.)(%s|%s|`[^`]+`)' % (idrest, op), bygroups(Operator,
+#             Name.Attribute)),
+            (idrest, Name),
+            (r'`[^`]+`', Name),
+            (r'\[', Operator, 'typeparam'),
+            (r'[\(\)\{\};,.#]', Operator),
+            (op, Operator),
+            (r'([0-9][0-9]*\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?',
+             Number.Float),
+            (r'0x[0-9a-f]+', Number.Hex),
+            (r'[0-9]+L?', Number.Integer),
+            (r'\n', Text)
+        ],
+        'class': [
+            (ur'(%s|%s|`[^`]+`)(\s*)(\[)' % (idrest, op),
+             bygroups(Name.Class, Text, Operator), 'typeparam'),
+            (r'\s+', Text),
+            (r'{', Operator, '#pop'),
+            (r'\(', Operator, '#pop'),
+            (r'//.*?\n', Comment.Single, '#pop'),
+            (ur'%s|%s|`[^`]+`' % (idrest, op), Name.Class, '#pop'),
+        ],
+        'type': [
+            (r'\s+', Text),
+            (u'<[%:]|>:|[#_\u21D2]|forSome|type', Keyword),
+            (r'([,\);}]|=>|=)(\s*)', bygroups(Operator, Text), '#pop'),
+            (r'[\(\{]', Operator, '#push'),
+            (ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)(\[)' %
+             (idrest, op, idrest, op),
+             bygroups(Keyword.Type, Text, Operator), ('#pop', 'typeparam')),
+            (ur'((?:%s|%s|`[^`]+`)(?:\.(?:%s|%s|`[^`]+`))*)(\s*)$' %
+             (idrest, op, idrest, op),
+             bygroups(Keyword.Type, Text), '#pop'),
+            (r'//.*?\n', Comment.Single, '#pop'),
+            (ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
+        ],
+        'typeparam': [
+            (r'[\s,]+', Text),
+            (u'<[%:]|=>|>:|[#_\u21D2]|forSome|type', Keyword),
+            (r'([\]\)\}])', Operator, '#pop'),
+            (r'[\(\[\{]', Operator, '#push'),
+            (ur'\.|%s|%s|`[^`]+`' % (idrest, op), Keyword.Type)
+        ],
+        'comment': [
+            (r'[^/\*]+', Comment.Multiline),
+            (r'/\*', Comment.Multiline, '#push'),
+            (r'\*/', Comment.Multiline, '#pop'),
+            (r'[*/]', Comment.Multiline)
+        ],
+        'import': [
+            (ur'(%s|\.)+' % idrest, Name.Namespace, '#pop')
+        ],
+    }
+
+
+class GosuLexer(RegexLexer):
+    """
+    For Gosu source code.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Gosu'
+    aliases = ['gosu']
+    filenames = ['*.gs', '*.gsx', '*.gsp', '*.vark']
+    mimetypes = ['text/x-gosu']
+
+    flags = re.MULTILINE | re.DOTALL
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'root': [
+            # method names
+            (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # modifiers etc.
+             r'([a-zA-Z_][a-zA-Z0-9_]*)'                    # method name
+             r'(\s*)(\()',                                  # signature start
+             bygroups(using(this), Name.Function, Text, Operator)),
+            (r'[^\S\n]+', Text),
+            (r'//.*?\n', Comment.Single),
+            (r'/\*.*?\*/', Comment.Multiline),
+            (r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
+            (r'(in|as|typeof|statictypeof|typeis|typeas|if|else|foreach|for|'
+             r'index|while|do|continue|break|return|try|catch|finally|this|'
+             r'throw|new|switch|case|default|eval|super|outer|classpath|'
+             r'using)\b', Keyword),
+            (r'(var|delegate|construct|function|private|internal|protected|'
+             r'public|abstract|override|final|static|extends|transient|'
+             r'implements|represents|readonly)\b', Keyword.Declaration),
+            (r'(property\s+)(get|set|)', Keyword.Declaration),
+            (r'(boolean|byte|char|double|float|int|long|short|void|block)\b',
+             Keyword.Type),
+            (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
+            (r'(true|false|null|NaN|Infinity)\b', Keyword.Constant),
+            (r'(class|interface|enhancement|enum)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)',
+             bygroups(Keyword.Declaration, Text, Name.Class)),
+            (r'(uses)(\s+)([a-zA-Z0-9_.]+\*?)',
+             bygroups(Keyword.Namespace, Text, Name.Namespace)),
+            (r'"', String, 'string'),
+            (r'(\??[\.#])([a-zA-Z_][a-zA-Z0-9_]*)',
+             bygroups(Operator, Name.Attribute)),
+            (r'(:)([a-zA-Z_][a-zA-Z0-9_]*)',
+             bygroups(Operator, Name.Attribute)),
+            (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
+            (r'and|or|not|[\\~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r'[0-9]+', Number.Integer),
+            (r'\n', Text)
+        ],
+        'templateText': [
+          (r'(\\<)|(\\\$)', String),
+          (r'(<%@\s+)(extends|params)',
+           bygroups(Operator, Name.Decorator), 'stringTemplate'),
+          (r'<%!--.*?--%>', Comment.Multiline),
+          (r'(<%)|(<%=)', Operator, 'stringTemplate'),
+          (r'\$\{', Operator, 'stringTemplateShorthand'),
+          (r'.', String)
+        ],
+        'string': [
+          (r'"', String, '#pop'),
+          include('templateText')
+        ],
+        'stringTemplate': [
+          (r'"', String, 'string'),
+          (r'%>', Operator, '#pop'),
+          include('root')
+        ],
+        'stringTemplateShorthand': [
+          (r'"', String, 'string'),
+          (r'\{', Operator, 'stringTemplateShorthand'),
+          (r'\}', Operator, '#pop'),
+          include('root')
+        ],
+    }
+
+
+class GosuTemplateLexer(Lexer):
+    """
+    For Gosu templates.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Gosu Template'
+    aliases = ['gst']
+    filenames = ['*.gst']
+    mimetypes = ['text/x-gosu-template']
+    lexer = GosuLexer()
+
+    def get_tokens_unprocessed(self, text):
+        stack = ['templateText']
+        for item in self.lexer.get_tokens_unprocessed(text, stack):
+            yield item
+
+
+class GroovyLexer(RegexLexer):
+    """
+    For `Groovy <http://groovy.codehaus.org/>`_ source code.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Groovy'
+    aliases = ['groovy']
+    filenames = ['*.groovy']
+    mimetypes = ['text/x-groovy']
+
+    flags = re.MULTILINE | re.DOTALL
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'root': [
+            # method names
+            (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
+             r'([a-zA-Z_][a-zA-Z0-9_]*)'                    # method name
+             r'(\s*)(\()',                                  # signature start
+             bygroups(using(this), Name.Function, Text, Operator)),
+            (r'[^\S\n]+', Text),
+            (r'//.*?\n', Comment.Single),
+            (r'/\*.*?\*/', Comment.Multiline),
+            (r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
+            (r'(assert|break|case|catch|continue|default|do|else|finally|for|'
+             r'if|goto|instanceof|new|return|switch|this|throw|try|while|in|as)\b',
+             Keyword),
+            (r'(abstract|const|enum|extends|final|implements|native|private|'
+             r'protected|public|static|strictfp|super|synchronized|throws|'
+             r'transient|volatile)\b', Keyword.Declaration),
+            (r'(def|boolean|byte|char|double|float|int|long|short|void)\b',
+             Keyword.Type),
+            (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
+            (r'(true|false|null)\b', Keyword.Constant),
+            (r'(class|interface)(\s+)', bygroups(Keyword.Declaration, Text),
+             'class'),
+            (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+            (r'\$/((?!/\$).)*/\$', String),
+            (r'/(\\\\|\\"|[^/])*/', String),
+            (r"'\\.'|'[^\\]'|'\\u[0-9a-f]{4}'", String.Char),
+            (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
+            (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
+            (r'[~\^\*!%&\[\]\(\)\{\}<>\|+=:;,./?-]', Operator),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r'0x[0-9a-f]+', Number.Hex),
+            (r'[0-9]+L?', Number.Integer),
+            (r'\n', Text)
+        ],
+        'class': [
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
+        ],
+        'import': [
+            (r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
+        ],
+    }
+
+
+class IokeLexer(RegexLexer):
+    """
+    For `Ioke <http://ioke.org/>`_ (a strongly typed, dynamic,
+    prototype based programming language) source.
+
+    *New in Pygments 1.4.*
+    """
+    name = 'Ioke'
+    filenames = ['*.ik']
+    aliases = ['ioke', 'ik']
+    mimetypes = ['text/x-iokesrc']
+    tokens = {
+        'interpolatableText': [
+            (r'(\\b|\\e|\\t|\\n|\\f|\\r|\\"|\\\\|\\#|\\\Z|\\u[0-9a-fA-F]{1,4}'
+             r'|\\[0-3]?[0-7]?[0-7])', String.Escape),
+            (r'#{', Punctuation, 'textInterpolationRoot')
+            ],
+
+        'text': [
+            (r'(?<!\\)"', String, '#pop'),
+            include('interpolatableText'),
+            (r'[^"]', String)
+            ],
+
+        'documentation': [
+            (r'(?<!\\)"', String.Doc, '#pop'),
+            include('interpolatableText'),
+            (r'[^"]', String.Doc)
+            ],
+
+        'textInterpolationRoot': [
+            (r'}', Punctuation, '#pop'),
+            include('root')
+            ],
+
+        'slashRegexp': [
+            (r'(?<!\\)/[oxpniums]*', String.Regex, '#pop'),
+            include('interpolatableText'),
+            (r'\\/', String.Regex),
+            (r'[^/]', String.Regex)
+            ],
+
+        'squareRegexp': [
+            (r'(?<!\\)][oxpniums]*', String.Regex, '#pop'),
+            include('interpolatableText'),
+            (r'\\]', String.Regex),
+            (r'[^\]]', String.Regex)
+            ],
+
+        'squareText': [
+            (r'(?<!\\)]', String, '#pop'),
+            include('interpolatableText'),
+            (r'[^\]]', String)
+            ],
+
+        'root': [
+            (r'\n', Text),
+            (r'\s+', Text),
+
+            # Comments
+            (r';(.*?)\n', Comment),
+            (r'\A#!(.*?)\n', Comment),
+
+            #Regexps
+            (r'#/', String.Regex, 'slashRegexp'),
+            (r'#r\[', String.Regex, 'squareRegexp'),
+
+            #Symbols
+            (r':[a-zA-Z0-9_!:?]+', String.Symbol),
+            (r'[a-zA-Z0-9_!:?]+:(?![a-zA-Z0-9_!?])', String.Other),
+            (r':"(\\\\|\\"|[^"])*"', String.Symbol),
+
+            #Documentation
+            (r'((?<=fn\()|(?<=fnx\()|(?<=method\()|(?<=macro\()|(?<=lecro\()'
+             r'|(?<=syntax\()|(?<=dmacro\()|(?<=dlecro\()|(?<=dlecrox\()'
+             r'|(?<=dsyntax\())\s*"', String.Doc, 'documentation'),
+
+            #Text
+            (r'"', String, 'text'),
+            (r'#\[', String, 'squareText'),
+
+            #Mimic
+            (r'[a-zA-Z0-9_][a-zA-Z0-9!?_:]+(?=\s*=.*mimic\s)', Name.Entity),
+
+            #Assignment
+            (r'[a-zA-Z_][a-zA-Z0-9_!:?]*(?=[\s]*[+*/-]?=[^=].*($|\.))',
+             Name.Variable),
+
+            # keywords
+            (r'(break|cond|continue|do|ensure|for|for:dict|for:set|if|let|'
+             r'loop|p:for|p:for:dict|p:for:set|return|unless|until|while|'
+             r'with)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
+
+            # Origin
+            (r'(eval|mimic|print|println)(?![a-zA-Z0-9!:_?])', Keyword),
+
+            # Base
+            (r'(cell\?|cellNames|cellOwner\?|cellOwner|cells|cell|'
+             r'documentation|hash|identity|mimic|removeCell\!|undefineCell\!)'
+             r'(?![a-zA-Z0-9!:_?])', Keyword),
+
+            # Ground
+            (r'(stackTraceAsText)(?![a-zA-Z0-9!:_?])', Keyword),
+
+            #DefaultBehaviour Literals
+            (r'(dict|list|message|set)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
+
+            #DefaultBehaviour Case
+            (r'(case|case:and|case:else|case:nand|case:nor|case:not|case:or|'
+             r'case:otherwise|case:xor)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
+
+            #DefaultBehaviour Reflection
+            (r'(asText|become\!|derive|freeze\!|frozen\?|in\?|is\?|kind\?|'
+             r'mimic\!|mimics|mimics\?|prependMimic\!|removeAllMimics\!|'
+             r'removeMimic\!|same\?|send|thaw\!|uniqueHexId)'
+             r'(?![a-zA-Z0-9!:_?])', Keyword),
+
+            #DefaultBehaviour Aspects
+            (r'(after|around|before)(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
+
+            # DefaultBehaviour
+            (r'(kind|cellDescriptionDict|cellSummary|genSym|inspect|notice)'
+             r'(?![a-zA-Z0-9!:_?])', Keyword),
+            (r'(use|destructuring)', Keyword.Reserved),
+
+            #DefaultBehavior BaseBehavior
+            (r'(cell\?|cellOwner\?|cellOwner|cellNames|cells|cell|'
+             r'documentation|identity|removeCell!|undefineCell)'
+             r'(?![a-zA-Z0-9!:_?])', Keyword),
+
+            #DefaultBehavior Internal
+            (r'(internal:compositeRegexp|internal:concatenateText|'
+             r'internal:createDecimal|internal:createNumber|'
+             r'internal:createRegexp|internal:createText)'
+             r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
+
+            #DefaultBehaviour Conditions
+            (r'(availableRestarts|bind|error\!|findRestart|handle|'
+             r'invokeRestart|rescue|restart|signal\!|warn\!)'
+             r'(?![a-zA-Z0-9!:_?])', Keyword.Reserved),
+
+            # constants
+            (r'(nil|false|true)(?![a-zA-Z0-9!:_?])', Name.Constant),
+
+            # names
+            (r'(Arity|Base|Call|Condition|DateTime|Aspects|Pointcut|'
+             r'Assignment|BaseBehavior|Boolean|Case|AndCombiner|Else|'
+             r'NAndCombiner|NOrCombiner|NotCombiner|OrCombiner|XOrCombiner|'
+             r'Conditions|Definitions|FlowControl|Internal|Literals|'
+             r'Reflection|DefaultMacro|DefaultMethod|DefaultSyntax|Dict|'
+             r'FileSystem|Ground|Handler|Hook|IO|IokeGround|Struct|'
+             r'LexicalBlock|LexicalMacro|List|Message|Method|Mixins|'
+             r'NativeMethod|Number|Origin|Pair|Range|Reflector|Regexp Match|'
+             r'Regexp|Rescue|Restart|Runtime|Sequence|Set|Symbol|'
+             r'System|Text|Tuple)(?![a-zA-Z0-9!:_?])', Name.Builtin),
+
+            # functions
+            (ur'(generateMatchMethod|aliasMethod|\u03bb|\u028E|fnx|fn|method|'
+             ur'dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)'
+             ur'(?![a-zA-Z0-9!:_?])', Name.Function),
+
+            # Numbers
+            (r'-?0[xX][0-9a-fA-F]+', Number.Hex),
+            (r'-?(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
+            (r'-?\d+', Number.Integer),
+
+            (r'#\(', Punctuation),
+
+             # Operators
+            (ur'(&&>>|\|\|>>|\*\*>>|:::|::|\.\.\.|===|\*\*>|\*\*=|&&>|&&=|'
+             ur'\|\|>|\|\|=|\->>|\+>>|!>>|<>>>|<>>|&>>|%>>|#>>|@>>|/>>|\*>>|'
+             ur'\?>>|\|>>|\^>>|~>>|\$>>|=>>|<<=|>>=|<=>|<\->|=~|!~|=>|\+\+|'
+             ur'\-\-|<=|>=|==|!=|&&|\.\.|\+=|\-=|\*=|\/=|%=|&=|\^=|\|=|<\-|'
+             ur'\+>|!>|<>|&>|%>|#>|\@>|\/>|\*>|\?>|\|>|\^>|~>|\$>|<\->|\->|'
+             ur'<<|>>|\*\*|\?\||\?&|\|\||>|<|\*|\/|%|\+|\-|&|\^|\||=|\$|!|~|'
+             ur'\?|#|\u2260|\u2218|\u2208|\u2209)', Operator),
+            (r'(and|nand|or|xor|nor|return|import)(?![a-zA-Z0-9_!?])',
+             Operator),
+
+            # Punctuation
+            (r'(\`\`|\`|\'\'|\'|\.|\,|@@|@|\[|\]|\(|\)|{|})', Punctuation),
+
+            #kinds
+            (r'[A-Z][a-zA-Z0-9_!:?]*', Name.Class),
+
+            #default cellnames
+            (r'[a-z_][a-zA-Z0-9_!:?]*', Name)
+        ]
+    }
+
+
+class ClojureLexer(RegexLexer):
+    """
+    Lexer for `Clojure <http://clojure.org/>`_ source code.
+
+    *New in Pygments 0.11.*
+    """
+    name = 'Clojure'
+    aliases = ['clojure', 'clj']
+    filenames = ['*.clj']
+    mimetypes = ['text/x-clojure', 'application/x-clojure']
+
+    special_forms = [
+        '.', 'def', 'do', 'fn', 'if', 'let', 'new', 'quote', 'var', 'loop'
+    ]
+
+    # It's safe to consider 'ns' a declaration thing because it defines a new
+    # namespace.
+    declarations = [
+        'def-', 'defn', 'defn-', 'defmacro', 'defmulti', 'defmethod',
+        'defstruct', 'defonce', 'declare', 'definline', 'definterface',
+        'defprotocol', 'defrecord', 'deftype', 'defproject', 'ns'
+    ]
+
+    builtins = [
+        '*', '+', '-', '->', '/', '<', '<=', '=', '==', '>', '>=', '..',
+        'accessor', 'agent', 'agent-errors', 'aget', 'alength', 'all-ns',
+        'alter', 'and', 'append-child', 'apply', 'array-map', 'aset',
+        'aset-boolean', 'aset-byte', 'aset-char', 'aset-double', 'aset-float',
+        'aset-int', 'aset-long', 'aset-short', 'assert', 'assoc', 'await',
+        'await-for', 'bean', 'binding', 'bit-and', 'bit-not', 'bit-or',
+        'bit-shift-left', 'bit-shift-right', 'bit-xor', 'boolean', 'branch?',
+        'butlast', 'byte', 'cast', 'char', 'children', 'class',
+        'clear-agent-errors', 'comment', 'commute', 'comp', 'comparator',
+        'complement', 'concat', 'conj', 'cons', 'constantly', 'cond', 'if-not',
+        'construct-proxy', 'contains?', 'count', 'create-ns', 'create-struct',
+        'cycle', 'dec',  'deref', 'difference', 'disj', 'dissoc', 'distinct',
+        'doall', 'doc', 'dorun', 'doseq', 'dosync', 'dotimes', 'doto',
+        'double', 'down', 'drop', 'drop-while', 'edit', 'end?', 'ensure',
+        'eval', 'every?', 'false?', 'ffirst', 'file-seq', 'filter', 'find',
+        'find-doc', 'find-ns', 'find-var', 'first', 'float', 'flush', 'for',
+        'fnseq', 'frest', 'gensym', 'get-proxy-class', 'get',
+        'hash-map', 'hash-set', 'identical?', 'identity', 'if-let', 'import',
+        'in-ns', 'inc', 'index', 'insert-child', 'insert-left', 'insert-right',
+        'inspect-table', 'inspect-tree', 'instance?', 'int', 'interleave',
+        'intersection', 'into', 'into-array', 'iterate', 'join', 'key', 'keys',
+        'keyword', 'keyword?', 'last', 'lazy-cat', 'lazy-cons', 'left',
+        'lefts', 'line-seq', 'list*', 'list', 'load', 'load-file',
+        'locking', 'long', 'loop', 'macroexpand', 'macroexpand-1',
+        'make-array', 'make-node', 'map', 'map-invert', 'map?', 'mapcat',
+        'max', 'max-key', 'memfn', 'merge', 'merge-with', 'meta', 'min',
+        'min-key', 'name', 'namespace', 'neg?', 'new', 'newline', 'next',
+        'nil?', 'node', 'not', 'not-any?', 'not-every?', 'not=', 'ns-imports',
+        'ns-interns', 'ns-map', 'ns-name', 'ns-publics', 'ns-refers',
+        'ns-resolve', 'ns-unmap', 'nth', 'nthrest', 'or', 'parse', 'partial',
+        'path', 'peek', 'pop', 'pos?', 'pr', 'pr-str', 'print', 'print-str',
+        'println', 'println-str', 'prn', 'prn-str', 'project', 'proxy',
+        'proxy-mappings', 'quot', 'rand', 'rand-int', 'range', 're-find',
+        're-groups', 're-matcher', 're-matches', 're-pattern', 're-seq',
+        'read', 'read-line', 'reduce', 'ref', 'ref-set', 'refer', 'rem',
+        'remove', 'remove-method', 'remove-ns', 'rename', 'rename-keys',
+        'repeat', 'replace', 'replicate', 'resolve', 'rest', 'resultset-seq',
+        'reverse', 'rfirst', 'right', 'rights', 'root', 'rrest', 'rseq',
+        'second', 'select', 'select-keys', 'send', 'send-off', 'seq',
+        'seq-zip', 'seq?', 'set', 'short', 'slurp', 'some', 'sort',
+        'sort-by', 'sorted-map', 'sorted-map-by', 'sorted-set',
+        'special-symbol?', 'split-at', 'split-with', 'str', 'string?',
+        'struct', 'struct-map', 'subs', 'subvec', 'symbol', 'symbol?',
+        'sync', 'take', 'take-nth', 'take-while', 'test', 'time', 'to-array',
+        'to-array-2d', 'tree-seq', 'true?', 'union', 'up', 'update-proxy',
+        'val', 'vals', 'var-get', 'var-set', 'var?', 'vector', 'vector-zip',
+        'vector?', 'when', 'when-first', 'when-let', 'when-not',
+        'with-local-vars', 'with-meta', 'with-open', 'with-out-str',
+        'xml-seq', 'xml-zip', 'zero?', 'zipmap', 'zipper']
+
+    # valid names for identifiers
+    # well, names can only not consist fully of numbers
+    # but this should be good enough for now
+
+    # TODO / should divide keywords/symbols into namespace/rest
+    # but that's hard, so just pretend / is part of the name
+    valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+'
+
+    def _multi_escape(entries):
+        return '(%s)' % ('|'.join(re.escape(entry) + ' ' for entry in entries))
+
+    tokens = {
+        'root': [
+            # the comments - always starting with semicolon
+            # and going to the end of the line
+            (r';.*$', Comment.Single),
+
+            # whitespaces - usually not relevant
+            (r'[,\s]+', Text),
+
+            # numbers
+            (r'-?\d+\.\d+', Number.Float),
+            (r'-?\d+', Number.Integer),
+            (r'0x-?[abcdef\d]+', Number.Hex),
+
+            # strings, symbols and characters
+            (r'"(\\\\|\\"|[^"])*"', String),
+            (r"'" + valid_name, String.Symbol),
+            (r"\\(.|[a-z]+)", String.Char),
+
+            # keywords
+            (r':' + valid_name, String.Symbol),
+
+            # special operators
+            (r'~@|[`\'#^~&]', Operator),
+
+            # highlight the special forms
+            (_multi_escape(special_forms), Keyword),
+
+            # Technically, only the special forms are 'keywords'. The problem
+            # is that only treating them as keywords means that things like
+            # 'defn' and 'ns' need to be highlighted as builtins. This is ugly
+            # and weird for most styles. So, as a compromise we're going to
+            # highlight them as Keyword.Declarations.
+            (_multi_escape(declarations), Keyword.Declaration),
+
+            # highlight the builtins
+            (_multi_escape(builtins), Name.Builtin),
+
+            # the remaining functions
+            (r'(?<=\()' + valid_name, Name.Function),
+
+            # find the remaining variables
+            (valid_name, Name.Variable),
+
+            # Clojure accepts vector notation
+            (r'(\[|\])', Punctuation),
+
+            # Clojure accepts map notation
+            (r'(\{|\})', Punctuation),
+
+            # the famous parentheses!
+            (r'(\(|\))', Punctuation),
+        ],
+    }
+
+
+class TeaLangLexer(RegexLexer):
+    """
+    For `Tea <http://teatrove.org/>`_ source code. Only used within a
+    TeaTemplateLexer.
+
+    *New in Pygments 1.5.*
+    """
+
+    flags = re.MULTILINE | re.DOTALL
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'root': [
+            # method names
+            (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9_\.\[\]]*\s+)+?)' # return arguments
+             r'([a-zA-Z_][a-zA-Z0-9_]*)'                    # method name
+             r'(\s*)(\()',                                  # signature start
+             bygroups(using(this), Name.Function, Text, Operator)),
+            (r'[^\S\n]+', Text),
+            (r'//.*?\n', Comment.Single),
+            (r'/\*.*?\*/', Comment.Multiline),
+            (r'@[a-zA-Z_][a-zA-Z0-9_\.]*', Name.Decorator),
+            (r'(and|break|else|foreach|if|in|not|or|reverse)\b',
+             Keyword),
+            (r'(as|call|define)\b', Keyword.Declaration),
+            (r'(true|false|null)\b', Keyword.Constant),
+            (r'(template)(\s+)', bygroups(Keyword.Declaration, Text), 'template'),
+            (r'(import)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
+            (r'"(\\\\|\\"|[^"])*"', String),
+            (r'\'(\\\\|\\\'|[^\'])*\'', String),
+            (r'(\.)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(Operator, Name.Attribute)),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*:', Name.Label),
+            (r'[a-zA-Z_\$][a-zA-Z0-9_]*', Name),
+            (r'(isa|[.]{3}|[.]{2}|[=#!<>+-/%&;,.\*\\\(\)\[\]\{\}])', Operator),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r'0x[0-9a-f]+', Number.Hex),
+            (r'[0-9]+L?', Number.Integer),
+            (r'\n', Text)
+        ],
+        'template': [
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
+        ],
+        'import': [
+            (r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
+        ],
+    }
+
+
+class KotlinLexer(RegexLexer):
+    """
+    For `Kotlin <http://confluence.jetbrains.net/display/Kotlin/>`_
+    source code.
+
+    Additional options accepted:
+
+    `unicodelevel`
+      Determines which Unicode characters this lexer allows for identifiers.
+      The possible values are:
+
+      * ``none`` -- only the ASCII letters and numbers are allowed. This
+        is the fastest selection.
+      * ``basic`` -- all Unicode characters from the specification except
+        category ``Lo`` are allowed.
+      * ``full`` -- all Unicode characters as specified in the C# specs
+        are allowed.  Note that this means a considerable slowdown since the
+        ``Lo`` category has more than 40,000 characters in it!
+
+      The default value is ``basic``.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Kotlin'
+    aliases = ['kotlin']
+    filenames = ['*.kt']
+    mimetypes = ['text/x-kotlin'] # inferred
+
+    flags = re.MULTILINE | re.DOTALL | re.UNICODE
+
+    # for the range of allowed unicode characters in identifiers,
+    # see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf
+
+    def _escape(st):
+        return st.replace(u'\\', ur'\\').replace(u'-', ur'\-').\
+               replace(u'[', ur'\[').replace(u']', ur'\]')
+
+    levels = {
+        'none': '@?[_a-zA-Z][a-zA-Z0-9_]*',
+        'basic': ('@?[_' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl + ']' +
+                  '[' + uni.Lu + uni.Ll + uni.Lt + uni.Lm + uni.Nl +
+                  uni.Nd + uni.Pc + uni.Cf + uni.Mn + uni.Mc + ']*'),
+        'full': ('@?(?:_|[^' +
+                 _escape(uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl')) + '])'
+                 + '[^' + _escape(uni.allexcept('Lu', 'Ll', 'Lt', 'Lm', 'Lo',
+                                                'Nl', 'Nd', 'Pc', 'Cf', 'Mn',
+                                                'Mc')) + ']*'),
+    }
+
+    tokens = {}
+    token_variants = True
+
+    for levelname, cs_ident in levels.items():
+        tokens[levelname] = {
+            'root': [
+                # method names
+                (r'^([ \t]*(?:' + cs_ident + r'(?:\[\])?\s+)+?)' # return type
+                 r'(' + cs_ident + ')'                           # method name
+                 r'(\s*)(\()',                               # signature start
+                 bygroups(using(this), Name.Function, Text, Punctuation)),
+                (r'^\s*\[.*?\]', Name.Attribute),
+                (r'[^\S\n]+', Text),
+                (r'\\\n', Text), # line continuation
+                (r'//.*?\n', Comment.Single),
+                (r'/[*](.|\n)*?[*]/', Comment.Multiline),
+                (r'\n', Text),
+                (r'[~!%^&*()+=|\[\]:;,.<>/?-]', Punctuation),
+                (r'[{}]', Punctuation),
+                (r'@"(""|[^"])*"', String),
+                (r'"(\\\\|\\"|[^"\n])*["\n]', String),
+                (r"'\\.'|'[^\\]'", String.Char),
+                (r"[0-9](\.[0-9]*)?([eE][+-][0-9]+)?"
+                 r"[flFLdD]?|0[xX][0-9a-fA-F]+[Ll]?", Number),
+                (r'#[ \t]*(if|endif|else|elif|define|undef|'
+                 r'line|error|warning|region|endregion|pragma)\b.*?\n',
+                 Comment.Preproc),
+                (r'\b(extern)(\s+)(alias)\b', bygroups(Keyword, Text,
+                 Keyword)),
+                (r'(abstract|as|break|catch|'
+                 r'fun|continue|default|delegate|'
+                 r'do|else|enum|extern|false|finally|'
+                 r'fixed|for|goto|if|implicit|in|interface|'
+                 r'internal|is|lock|null|'
+                 r'out|override|private|protected|public|readonly|'
+                 r'ref|return|sealed|sizeof|'
+                 r'when|this|throw|true|try|typeof|'
+                 r'unchecked|unsafe|virtual|void|while|'
+                 r'get|set|new|partial|yield|val|var)\b', Keyword),
+                (r'(global)(::)', bygroups(Keyword, Punctuation)),
+                (r'(bool|byte|char|decimal|double|dynamic|float|int|long|'
+                 r'short)\b\??', Keyword.Type),
+                (r'(class|struct)(\s+)', bygroups(Keyword, Text), 'class'),
+                (r'(package|using)(\s+)', bygroups(Keyword, Text), 'package'),
+                (cs_ident, Name),
+            ],
+            'class': [
+                (cs_ident, Name.Class, '#pop')
+            ],
+            'package': [
+                (r'(?=\()', Text, '#pop'), # using (resource)
+                ('(' + cs_ident + r'|\.)+', Name.Namespace, '#pop')
+            ]
+        }
+
+    def __init__(self, **options):
+        level = get_choice_opt(options, 'unicodelevel', self.tokens.keys(),
+                               'basic')
+        if level not in self._all_tokens:
+            # compile the regexes now
+            self._tokens = self.__class__.process_tokendef(level)
+        else:
+            self._tokens = self._all_tokens[level]
+
+        RegexLexer.__init__(self, **options)
index 5f00c08ef8bcce52d46400943e8320a14e59c57e..f500231fbe62446d4f490ee6959a37933dc43ee9 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for math languages.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -16,9 +16,10 @@ from pygments.token import Comment, String, Punctuation, Keyword, Name, \
     Operator, Number, Text, Generic
 
 from pygments.lexers.agile import PythonLexer
+from pygments.lexers import _scilab_builtins
 
-__all__ = ['MuPADLexer', 'MatlabLexer', 'MatlabSessionLexer', 'NumPyLexer',
-           'RConsoleLexer', 'SLexer']
+__all__ = ['MuPADLexer', 'MatlabLexer', 'MatlabSessionLexer', 'OctaveLexer',
+           'ScilabLexer', 'NumPyLexer', 'RConsoleLexer', 'SLexer']
 
 
 class MuPADLexer(RegexLexer):
@@ -74,8 +75,8 @@ class MuPADLexer(RegexLexer):
         #(r'\b(?:adt|linalg|newDomain|hold)\b', Name.Builtin),
         (r'''(?x)
           ((?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)
-          (?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*)\s*([(])''',
-          bygroups(Name.Function, Punctuation)),
+          (?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*)(\s*)([(])''',
+          bygroups(Name.Function, Text, Punctuation)),
         (r'''(?x)
           (?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)
           (?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*''', Name.Variable),
@@ -94,13 +95,13 @@ class MuPADLexer(RegexLexer):
 
 class MatlabLexer(RegexLexer):
     """
-    For Matlab (or GNU Octave) source code.
+    For Matlab source code.
     Contributed by Ken Schutte <kschutte@csail.mit.edu>.
 
     *New in Pygments 0.10.*
     """
     name = 'Matlab'
-    aliases = ['matlab', 'octave']
+    aliases = ['matlab']
     filenames = ['*.m']
     mimetypes = ['text/matlab']
 
@@ -195,11 +196,12 @@ class MatlabLexer(RegexLexer):
             return 0.9
         return 0.1
 
+
 line_re  = re.compile('.*?\n')
 
 class MatlabSessionLexer(Lexer):
     """
-    For Matlab (or GNU Octave) sessions.  Modeled after PythonConsoleLexer.
+    For Matlab sessions.  Modeled after PythonConsoleLexer.
     Contributed by Ken Schutte <kschutte@csail.mit.edu>.
 
     *New in Pygments 0.10.*
@@ -246,12 +248,466 @@ class MatlabSessionLexer(Lexer):
                 yield item
 
 
+class OctaveLexer(RegexLexer):
+    """
+    For GNU Octave source code.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'Octave'
+    aliases = ['octave']
+    filenames = ['*.m']
+    mimetypes = ['text/octave']
+
+    # These lists are generated automatically.
+    # Run the following in bash shell:
+    #
+    # First dump all of the Octave manual into a plain text file:
+    #
+    #   $ info octave --subnodes -o octave-manual
+    #
+    # Now grep through it:
+
+    # for i in \
+    #     "Built-in Function" "Command" "Function File" \
+    #     "Loadable Function" "Mapping Function";
+    # do
+    #     perl -e '@name = qw('"$i"');
+    #              print lc($name[0]),"_kw = [\n"';
+    #
+    #     perl -n -e 'print "\"$1\",\n" if /-- '"$i"': .* (\w*) \(/;' \
+    #         octave-manual | sort | uniq ;
+    #     echo "]" ;
+    #     echo;
+    # done
+
+    # taken from Octave Mercurial changeset 8cc154f45e37 (30-jan-2011)
+
+    builtin_kw = [ "addlistener", "addpath", "addproperty", "all",
+                   "and", "any", "argnames", "argv", "assignin",
+                   "atexit", "autoload",
+                   "available_graphics_toolkits", "beep_on_error",
+                   "bitand", "bitmax", "bitor", "bitshift", "bitxor",
+                   "cat", "cell", "cellstr", "char", "class", "clc",
+                   "columns", "command_line_path",
+                   "completion_append_char", "completion_matches",
+                   "complex", "confirm_recursive_rmdir", "cputime",
+                   "crash_dumps_octave_core", "ctranspose", "cumprod",
+                   "cumsum", "debug_on_error", "debug_on_interrupt",
+                   "debug_on_warning", "default_save_options",
+                   "dellistener", "diag", "diff", "disp",
+                   "doc_cache_file", "do_string_escapes", "double",
+                   "drawnow", "e", "echo_executing_commands", "eps",
+                   "eq", "errno", "errno_list", "error", "eval",
+                   "evalin", "exec", "exist", "exit", "eye", "false",
+                   "fclear", "fclose", "fcntl", "fdisp", "feof",
+                   "ferror", "feval", "fflush", "fgetl", "fgets",
+                   "fieldnames", "file_in_loadpath", "file_in_path",
+                   "filemarker", "filesep", "find_dir_in_path",
+                   "fixed_point_format", "fnmatch", "fopen", "fork",
+                   "formula", "fprintf", "fputs", "fread", "freport",
+                   "frewind", "fscanf", "fseek", "fskipl", "ftell",
+                   "functions", "fwrite", "ge", "genpath", "get",
+                   "getegid", "getenv", "geteuid", "getgid",
+                   "getpgrp", "getpid", "getppid", "getuid", "glob",
+                   "gt", "gui_mode", "history_control",
+                   "history_file", "history_size",
+                   "history_timestamp_format_string", "home",
+                   "horzcat", "hypot", "ifelse",
+                   "ignore_function_time_stamp", "inferiorto",
+                   "info_file", "info_program", "inline", "input",
+                   "intmax", "intmin", "ipermute",
+                   "is_absolute_filename", "isargout", "isbool",
+                   "iscell", "iscellstr", "ischar", "iscomplex",
+                   "isempty", "isfield", "isfloat", "isglobal",
+                   "ishandle", "isieee", "isindex", "isinteger",
+                   "islogical", "ismatrix", "ismethod", "isnull",
+                   "isnumeric", "isobject", "isreal",
+                   "is_rooted_relative_filename", "issorted",
+                   "isstruct", "isvarname", "kbhit", "keyboard",
+                   "kill", "lasterr", "lasterror", "lastwarn",
+                   "ldivide", "le", "length", "link", "linspace",
+                   "logical", "lstat", "lt", "make_absolute_filename",
+                   "makeinfo_program", "max_recursion_depth", "merge",
+                   "methods", "mfilename", "minus", "mislocked",
+                   "mkdir", "mkfifo", "mkstemp", "mldivide", "mlock",
+                   "mouse_wheel_zoom", "mpower", "mrdivide", "mtimes",
+                   "munlock", "nargin", "nargout",
+                   "native_float_format", "ndims", "ne", "nfields",
+                   "nnz", "norm", "not", "numel", "nzmax",
+                   "octave_config_info", "octave_core_file_limit",
+                   "octave_core_file_name",
+                   "octave_core_file_options", "ones", "or",
+                   "output_max_field_width", "output_precision",
+                   "page_output_immediately", "page_screen_output",
+                   "path", "pathsep", "pause", "pclose", "permute",
+                   "pi", "pipe", "plus", "popen", "power",
+                   "print_empty_dimensions", "printf",
+                   "print_struct_array_contents", "prod",
+                   "program_invocation_name", "program_name",
+                   "putenv", "puts", "pwd", "quit", "rats", "rdivide",
+                   "readdir", "readlink", "read_readline_init_file",
+                   "realmax", "realmin", "rehash", "rename",
+                   "repelems", "re_read_readline_init_file", "reset",
+                   "reshape", "resize", "restoredefaultpath",
+                   "rethrow", "rmdir", "rmfield", "rmpath", "rows",
+                   "save_header_format_string", "save_precision",
+                   "saving_history", "scanf", "set", "setenv",
+                   "shell_cmd", "sighup_dumps_octave_core",
+                   "sigterm_dumps_octave_core", "silent_functions",
+                   "single", "size", "size_equal", "sizemax",
+                   "sizeof", "sleep", "source", "sparse_auto_mutate",
+                   "split_long_rows", "sprintf", "squeeze", "sscanf",
+                   "stat", "stderr", "stdin", "stdout", "strcmp",
+                   "strcmpi", "string_fill_char", "strncmp",
+                   "strncmpi", "struct", "struct_levels_to_print",
+                   "strvcat", "subsasgn", "subsref", "sum", "sumsq",
+                   "superiorto", "suppress_verbose_help_message",
+                   "symlink", "system", "tic", "tilde_expand",
+                   "times", "tmpfile", "tmpnam", "toc", "toupper",
+                   "transpose", "true", "typeinfo", "umask", "uminus",
+                   "uname", "undo_string_escapes", "unlink", "uplus",
+                   "upper", "usage", "usleep", "vec", "vectorize",
+                   "vertcat", "waitpid", "warning", "warranty",
+                   "whos_line_format", "yes_or_no", "zeros",
+                   "inf", "Inf", "nan", "NaN"]
+
+    command_kw = [ "close", "load", "who", "whos", ]
+
+    function_kw = [ "accumarray", "accumdim", "acosd", "acotd",
+                   "acscd", "addtodate", "allchild", "ancestor",
+                   "anova", "arch_fit", "arch_rnd", "arch_test",
+                   "area", "arma_rnd", "arrayfun", "ascii", "asctime",
+                   "asecd", "asind", "assert", "atand",
+                   "autoreg_matrix", "autumn", "axes", "axis", "bar",
+                   "barh", "bartlett", "bartlett_test", "beep",
+                   "betacdf", "betainv", "betapdf", "betarnd",
+                   "bicgstab", "bicubic", "binary", "binocdf",
+                   "binoinv", "binopdf", "binornd", "bitcmp",
+                   "bitget", "bitset", "blackman", "blanks",
+                   "blkdiag", "bone", "box", "brighten", "calendar",
+                   "cast", "cauchy_cdf", "cauchy_inv", "cauchy_pdf",
+                   "cauchy_rnd", "caxis", "celldisp", "center", "cgs",
+                   "chisquare_test_homogeneity",
+                   "chisquare_test_independence", "circshift", "cla",
+                   "clabel", "clf", "clock", "cloglog", "closereq",
+                   "colon", "colorbar", "colormap", "colperm",
+                   "comet", "common_size", "commutation_matrix",
+                   "compan", "compare_versions", "compass",
+                   "computer", "cond", "condest", "contour",
+                   "contourc", "contourf", "contrast", "conv",
+                   "convhull", "cool", "copper", "copyfile", "cor",
+                   "corrcoef", "cor_test", "cosd", "cotd", "cov",
+                   "cplxpair", "cross", "cscd", "cstrcat", "csvread",
+                   "csvwrite", "ctime", "cumtrapz", "curl", "cut",
+                   "cylinder", "date", "datenum", "datestr",
+                   "datetick", "datevec", "dblquad", "deal",
+                   "deblank", "deconv", "delaunay", "delaunayn",
+                   "delete", "demo", "detrend", "diffpara", "diffuse",
+                   "dir", "discrete_cdf", "discrete_inv",
+                   "discrete_pdf", "discrete_rnd", "display",
+                   "divergence", "dlmwrite", "dos", "dsearch",
+                   "dsearchn", "duplication_matrix", "durbinlevinson",
+                   "ellipsoid", "empirical_cdf", "empirical_inv",
+                   "empirical_pdf", "empirical_rnd", "eomday",
+                   "errorbar", "etime", "etreeplot", "example",
+                   "expcdf", "expinv", "expm", "exppdf", "exprnd",
+                   "ezcontour", "ezcontourf", "ezmesh", "ezmeshc",
+                   "ezplot", "ezpolar", "ezsurf", "ezsurfc", "factor",
+                   "factorial", "fail", "fcdf", "feather", "fftconv",
+                   "fftfilt", "fftshift", "figure", "fileattrib",
+                   "fileparts", "fill", "findall", "findobj",
+                   "findstr", "finv", "flag", "flipdim", "fliplr",
+                   "flipud", "fpdf", "fplot", "fractdiff", "freqz",
+                   "freqz_plot", "frnd", "fsolve",
+                   "f_test_regression", "ftp", "fullfile", "fzero",
+                   "gamcdf", "gaminv", "gampdf", "gamrnd", "gca",
+                   "gcbf", "gcbo", "gcf", "genvarname", "geocdf",
+                   "geoinv", "geopdf", "geornd", "getfield", "ginput",
+                   "glpk", "gls", "gplot", "gradient",
+                   "graphics_toolkit", "gray", "grid", "griddata",
+                   "griddatan", "gtext", "gunzip", "gzip", "hadamard",
+                   "hamming", "hankel", "hanning", "hggroup",
+                   "hidden", "hilb", "hist", "histc", "hold", "hot",
+                   "hotelling_test", "housh", "hsv", "hurst",
+                   "hygecdf", "hygeinv", "hygepdf", "hygernd",
+                   "idivide", "ifftshift", "image", "imagesc",
+                   "imfinfo", "imread", "imshow", "imwrite", "index",
+                   "info", "inpolygon", "inputname", "interpft",
+                   "interpn", "intersect", "invhilb", "iqr", "isa",
+                   "isdefinite", "isdir", "is_duplicate_entry",
+                   "isequal", "isequalwithequalnans", "isfigure",
+                   "ishermitian", "ishghandle", "is_leap_year",
+                   "isletter", "ismac", "ismember", "ispc", "isprime",
+                   "isprop", "isscalar", "issquare", "isstrprop",
+                   "issymmetric", "isunix", "is_valid_file_id",
+                   "isvector", "jet", "kendall",
+                   "kolmogorov_smirnov_cdf",
+                   "kolmogorov_smirnov_test", "kruskal_wallis_test",
+                   "krylov", "kurtosis", "laplace_cdf", "laplace_inv",
+                   "laplace_pdf", "laplace_rnd", "legend", "legendre",
+                   "license", "line", "linkprop", "list_primes",
+                   "loadaudio", "loadobj", "logistic_cdf",
+                   "logistic_inv", "logistic_pdf", "logistic_rnd",
+                   "logit", "loglog", "loglogerr", "logm", "logncdf",
+                   "logninv", "lognpdf", "lognrnd", "logspace",
+                   "lookfor", "ls_command", "lsqnonneg", "magic",
+                   "mahalanobis", "manova", "matlabroot",
+                   "mcnemar_test", "mean", "meansq", "median", "menu",
+                   "mesh", "meshc", "meshgrid", "meshz", "mexext",
+                   "mget", "mkpp", "mode", "moment", "movefile",
+                   "mpoles", "mput", "namelengthmax", "nargchk",
+                   "nargoutchk", "nbincdf", "nbininv", "nbinpdf",
+                   "nbinrnd", "nchoosek", "ndgrid", "newplot", "news",
+                   "nonzeros", "normcdf", "normest", "norminv",
+                   "normpdf", "normrnd", "now", "nthroot", "null",
+                   "ocean", "ols", "onenormest", "optimget",
+                   "optimset", "orderfields", "orient", "orth",
+                   "pack", "pareto", "parseparams", "pascal", "patch",
+                   "pathdef", "pcg", "pchip", "pcolor", "pcr",
+                   "peaks", "periodogram", "perl", "perms", "pie",
+                   "pink", "planerot", "playaudio", "plot",
+                   "plotmatrix", "plotyy", "poisscdf", "poissinv",
+                   "poisspdf", "poissrnd", "polar", "poly",
+                   "polyaffine", "polyarea", "polyderiv", "polyfit",
+                   "polygcd", "polyint", "polyout", "polyreduce",
+                   "polyval", "polyvalm", "postpad", "powerset",
+                   "ppder", "ppint", "ppjumps", "ppplot", "ppval",
+                   "pqpnonneg", "prepad", "primes", "print",
+                   "print_usage", "prism", "probit", "qp", "qqplot",
+                   "quadcc", "quadgk", "quadl", "quadv", "quiver",
+                   "qzhess", "rainbow", "randi", "range", "rank",
+                   "ranks", "rat", "reallog", "realpow", "realsqrt",
+                   "record", "rectangle_lw", "rectangle_sw",
+                   "rectint", "refresh", "refreshdata",
+                   "regexptranslate", "repmat", "residue", "ribbon",
+                   "rindex", "roots", "rose", "rosser", "rotdim",
+                   "rref", "run", "run_count", "rundemos", "run_test",
+                   "runtests", "saveas", "saveaudio", "saveobj",
+                   "savepath", "scatter", "secd", "semilogx",
+                   "semilogxerr", "semilogy", "semilogyerr",
+                   "setaudio", "setdiff", "setfield", "setxor",
+                   "shading", "shift", "shiftdim", "sign_test",
+                   "sinc", "sind", "sinetone", "sinewave", "skewness",
+                   "slice", "sombrero", "sortrows", "spaugment",
+                   "spconvert", "spdiags", "spearman", "spectral_adf",
+                   "spectral_xdf", "specular", "speed", "spencer",
+                   "speye", "spfun", "sphere", "spinmap", "spline",
+                   "spones", "sprand", "sprandn", "sprandsym",
+                   "spring", "spstats", "spy", "sqp", "stairs",
+                   "statistics", "std", "stdnormal_cdf",
+                   "stdnormal_inv", "stdnormal_pdf", "stdnormal_rnd",
+                   "stem", "stft", "strcat", "strchr", "strjust",
+                   "strmatch", "strread", "strsplit", "strtok",
+                   "strtrim", "strtrunc", "structfun", "studentize",
+                   "subplot", "subsindex", "subspace", "substr",
+                   "substruct", "summer", "surf", "surface", "surfc",
+                   "surfl", "surfnorm", "svds", "swapbytes",
+                   "sylvester_matrix", "symvar", "synthesis", "table",
+                   "tand", "tar", "tcdf", "tempdir", "tempname",
+                   "test", "text", "textread", "textscan", "tinv",
+                   "title", "toeplitz", "tpdf", "trace", "trapz",
+                   "treelayout", "treeplot", "triangle_lw",
+                   "triangle_sw", "tril", "trimesh", "triplequad",
+                   "triplot", "trisurf", "triu", "trnd", "tsearchn",
+                   "t_test", "t_test_regression", "type", "unidcdf",
+                   "unidinv", "unidpdf", "unidrnd", "unifcdf",
+                   "unifinv", "unifpdf", "unifrnd", "union", "unique",
+                   "unix", "unmkpp", "unpack", "untabify", "untar",
+                   "unwrap", "unzip", "u_test", "validatestring",
+                   "vander", "var", "var_test", "vech", "ver",
+                   "version", "view", "voronoi", "voronoin",
+                   "waitforbuttonpress", "wavread", "wavwrite",
+                   "wblcdf", "wblinv", "wblpdf", "wblrnd", "weekday",
+                   "welch_test", "what", "white", "whitebg",
+                   "wienrnd", "wilcoxon_test", "wilkinson", "winter",
+                   "xlabel", "xlim", "ylabel", "yulewalker", "zip",
+                   "zlabel", "z_test", ]
+
+    loadable_kw = [ "airy", "amd", "balance", "besselh", "besseli",
+                   "besselj", "besselk", "bessely", "bitpack",
+                   "bsxfun", "builtin", "ccolamd", "cellfun",
+                   "cellslices", "chol", "choldelete", "cholinsert",
+                   "cholinv", "cholshift", "cholupdate", "colamd",
+                   "colloc", "convhulln", "convn", "csymamd",
+                   "cummax", "cummin", "daspk", "daspk_options",
+                   "dasrt", "dasrt_options", "dassl", "dassl_options",
+                   "dbclear", "dbdown", "dbstack", "dbstatus",
+                   "dbstop", "dbtype", "dbup", "dbwhere", "det",
+                   "dlmread", "dmperm", "dot", "eig", "eigs",
+                   "endgrent", "endpwent", "etree", "fft", "fftn",
+                   "fftw", "filter", "find", "full", "gcd",
+                   "getgrent", "getgrgid", "getgrnam", "getpwent",
+                   "getpwnam", "getpwuid", "getrusage", "givens",
+                   "gmtime", "gnuplot_binary", "hess", "ifft",
+                   "ifftn", "inv", "isdebugmode", "issparse", "kron",
+                   "localtime", "lookup", "lsode", "lsode_options",
+                   "lu", "luinc", "luupdate", "matrix_type", "max",
+                   "min", "mktime", "pinv", "qr", "qrdelete",
+                   "qrinsert", "qrshift", "qrupdate", "quad",
+                   "quad_options", "qz", "rand", "rande", "randg",
+                   "randn", "randp", "randperm", "rcond", "regexp",
+                   "regexpi", "regexprep", "schur", "setgrent",
+                   "setpwent", "sort", "spalloc", "sparse", "spparms",
+                   "sprank", "sqrtm", "strfind", "strftime",
+                   "strptime", "strrep", "svd", "svd_driver", "syl",
+                   "symamd", "symbfact", "symrcm", "time", "tsearch",
+                   "typecast", "urlread", "urlwrite", ]
+
+    mapping_kw = [ "abs", "acos", "acosh", "acot", "acoth", "acsc",
+                  "acsch", "angle", "arg", "asec", "asech", "asin",
+                  "asinh", "atan", "atanh", "beta", "betainc",
+                  "betaln", "bincoeff", "cbrt", "ceil", "conj", "cos",
+                  "cosh", "cot", "coth", "csc", "csch", "erf", "erfc",
+                  "erfcx", "erfinv", "exp", "finite", "fix", "floor",
+                  "fmod", "gamma", "gammainc", "gammaln", "imag",
+                  "isalnum", "isalpha", "isascii", "iscntrl",
+                  "isdigit", "isfinite", "isgraph", "isinf",
+                  "islower", "isna", "isnan", "isprint", "ispunct",
+                  "isspace", "isupper", "isxdigit", "lcm", "lgamma",
+                  "log", "lower", "mod", "real", "rem", "round",
+                  "roundb", "sec", "sech", "sign", "sin", "sinh",
+                  "sqrt", "tan", "tanh", "toascii", "tolower", "xor",
+                  ]
+
+    builtin_consts = [ "EDITOR", "EXEC_PATH", "I", "IMAGE_PATH", "NA",
+                   "OCTAVE_HOME", "OCTAVE_VERSION", "PAGER",
+                   "PAGER_FLAGS", "SEEK_CUR", "SEEK_END", "SEEK_SET",
+                   "SIG", "S_ISBLK", "S_ISCHR", "S_ISDIR", "S_ISFIFO",
+                   "S_ISLNK", "S_ISREG", "S_ISSOCK", "WCONTINUE",
+                   "WCOREDUMP", "WEXITSTATUS", "WIFCONTINUED",
+                   "WIFEXITED", "WIFSIGNALED", "WIFSTOPPED", "WNOHANG",
+                   "WSTOPSIG", "WTERMSIG", "WUNTRACED", ]
+
+    tokens = {
+        'root': [
+            #We should look into multiline comments
+            (r'[%#].*$', Comment),
+            (r'^\s*function', Keyword, 'deffunc'),
+
+            # from 'iskeyword' on hg changeset 8cc154f45e37
+            (r'(__FILE__|__LINE__|break|case|catch|classdef|continue|do|else|'
+             r'elseif|end|end_try_catch|end_unwind_protect|endclassdef|'
+             r'endevents|endfor|endfunction|endif|endmethods|endproperties|'
+             r'endswitch|endwhile|events|for|function|get|global|if|methods|'
+             r'otherwise|persistent|properties|return|set|static|switch|try|'
+             r'until|unwind_protect|unwind_protect_cleanup|while)\b', Keyword),
+
+            ("(" + "|".join(  builtin_kw + command_kw
+                            + function_kw + loadable_kw
+                            + mapping_kw) + r')\b',  Name.Builtin),
+
+            ("(" + "|".join(builtin_consts) + r')\b', Name.Constant),
+
+            # operators in Octave but not Matlab:
+            (r'-=|!=|!|/=|--', Operator),
+            # operators:
+            (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
+            # operators in Octave but not Matlab requiring escape for re:
+            (r'\*=|\+=|\^=|\/=|\\=|\*\*|\+\+|\.\*\*',Operator),
+            # operators requiring escape for re:
+            (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
+
+
+            # punctuation:
+            (r'\[|\]|\(|\)|\{|\}|:|@|\.|,', Punctuation),
+            (r'=|:|;', Punctuation),
+
+            (r'"[^"]*"', String),
+
+            # quote can be transpose, instead of string:
+            # (not great, but handles common cases...)
+            (r'(?<=[\w\)\]])\'', Operator),
+            (r'(?<![\w\)\]])\'', String, 'string'),
+
+            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            (r'.', Text),
+        ],
+        'string': [
+            (r"[^']*'", String, '#pop'),
+        ],
+        'deffunc': [
+            (r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
+             bygroups(Text.Whitespace, Text, Text.Whitespace, Punctuation,
+                      Text.Whitespace, Name.Function, Punctuation, Text,
+                      Punctuation, Text.Whitespace), '#pop'),
+        ],
+    }
+
+    def analyse_text(text):
+        if re.match('^\s*[%#]', text, re.M): #Comment
+            return 0.9
+        return 0.1
+
+
+class ScilabLexer(RegexLexer):
+    """
+    For Scilab source code.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'Scilab'
+    aliases = ['scilab']
+    filenames = ['*.sci', '*.sce', '*.tst']
+    mimetypes = ['text/scilab']
+
+    tokens = {
+        'root': [
+            (r'//.*?$', Comment.Single),
+            (r'^\s*function', Keyword, 'deffunc'),
+
+            (r'(__FILE__|__LINE__|break|case|catch|classdef|continue|do|else|'
+             r'elseif|end|end_try_catch|end_unwind_protect|endclassdef|'
+             r'endevents|endfor|endfunction|endif|endmethods|endproperties|'
+             r'endswitch|endwhile|events|for|function|get|global|if|methods|'
+             r'otherwise|persistent|properties|return|set|static|switch|try|'
+             r'until|unwind_protect|unwind_protect_cleanup|while)\b', Keyword),
+
+            ("(" + "|".join(_scilab_builtins.functions_kw +
+                            _scilab_builtins.commands_kw +
+                            _scilab_builtins.macros_kw
+                            ) + r')\b',  Name.Builtin),
+
+            (r'(%s)\b' % "|".join(map(re.escape, _scilab_builtins.builtin_consts)),
+             Name.Constant),
+
+            # operators:
+            (r'-|==|~=|<|>|<=|>=|&&|&|~|\|\|?', Operator),
+            # operators requiring escape for re:
+            (r'\.\*|\*|\+|\.\^|\.\\|\.\/|\/|\\', Operator),
+
+            # punctuation:
+            (r'[\[\](){}@.,=:;]', Punctuation),
+
+            (r'"[^"]*"', String),
+
+            # quote can be transpose, instead of string:
+            # (not great, but handles common cases...)
+            (r'(?<=[\w\)\]])\'', Operator),
+            (r'(?<![\w\)\]])\'', String, 'string'),
+
+            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            (r'.', Text),
+        ],
+        'string': [
+            (r"[^']*'", String, '#pop'),
+            (r'.', String, '#pop'),
+        ],
+        'deffunc': [
+            (r'(\s*)(?:(.+)(\s*)(=)(\s*))?(.+)(\()(.*)(\))(\s*)',
+             bygroups(Text.Whitespace, Text, Text.Whitespace, Punctuation,
+                      Text.Whitespace, Name.Function, Punctuation, Text,
+                      Punctuation, Text.Whitespace), '#pop'),
+        ],
+    }
+
+
 class NumPyLexer(PythonLexer):
-    '''
+    """
     A Python lexer recognizing Numerical Python builtins.
 
     *New in Pygments 0.10.*
-    '''
+    """
 
     name = 'NumPy'
     aliases = ['numpy']
index 69e4ccb76a4533d0a6261cb17f972cbb81cab1be..c971814226ecc3d73194b22d89541eddcd83721a 100644 (file)
 
     Lexers for other languages.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
 import re
 
-from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
-     this, do_insertions
+from pygments.lexer import RegexLexer, include, bygroups, using, \
+     this, combined, ExtendedRegexLexer
 from pygments.token import Error, Punctuation, Literal, Token, \
      Text, Comment, Operator, Keyword, Name, String, Number, Generic
-from pygments.util import shebang_matches
 from pygments.lexers.web import HtmlLexer
 
 
-__all__ = ['SqlLexer', 'MySqlLexer', 'SqliteConsoleLexer', 'BrainfuckLexer',
-           'BashLexer', 'BatchLexer', 'BefungeLexer', 'RedcodeLexer',
-           'MOOCodeLexer', 'SmalltalkLexer', 'TcshLexer', 'LogtalkLexer',
-           'GnuplotLexer', 'PovrayLexer', 'AppleScriptLexer',
-           'BashSessionLexer', 'ModelicaLexer', 'RebolLexer', 'ABAPLexer',
-           'NewspeakLexer', 'GherkinLexer', 'AsymptoteLexer',
-           'PostScriptLexer', 'AutohotkeyLexer', 'GoodDataCLLexer',
-           'MaqlLexer', 'ProtoBufLexer', 'HybrisLexer']
+# backwards compatibility
+from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer
+from pygments.lexers.shell import BashLexer, BashSessionLexer, BatchLexer, \
+     TcshLexer
 
-line_re  = re.compile('.*?\n')
+__all__ = ['BrainfuckLexer', 'BefungeLexer', 'RedcodeLexer', 'MOOCodeLexer',
+           'SmalltalkLexer', 'LogtalkLexer', 'GnuplotLexer', 'PovrayLexer',
+           'AppleScriptLexer', 'ModelicaLexer', 'RebolLexer', 'ABAPLexer',
+           'NewspeakLexer', 'GherkinLexer', 'AsymptoteLexer', 'PostScriptLexer',
+           'AutohotkeyLexer', 'GoodDataCLLexer', 'MaqlLexer', 'ProtoBufLexer',
+           'HybrisLexer', 'AwkLexer', 'Cfengine3Lexer', 'SnobolLexer',
+           'ECLLexer', 'UrbiscriptLexer', 'OpenEdgeLexer', 'BroLexer']
 
 
-class SqlLexer(RegexLexer):
+class ECLLexer(RegexLexer):
     """
-    Lexer for Structured Query Language. Currently, this lexer does
-    not recognize any special syntax except ANSI SQL.
-    """
-
-    name = 'SQL'
-    aliases = ['sql']
-    filenames = ['*.sql']
-    mimetypes = ['text/x-sql']
-
-    flags = re.IGNORECASE
-    tokens = {
-        'root': [
-            (r'\s+', Text),
-            (r'--.*?\n', Comment.Single),
-            (r'/\*', Comment.Multiline, 'multiline-comments'),
-            (r'(ABORT|ABS|ABSOLUTE|ACCESS|ADA|ADD|ADMIN|AFTER|AGGREGATE|'
-             r'ALIAS|ALL|ALLOCATE|ALTER|ANALYSE|ANALYZE|AND|ANY|ARE|AS|'
-             r'ASC|ASENSITIVE|ASSERTION|ASSIGNMENT|ASYMMETRIC|AT|ATOMIC|'
-             r'AUTHORIZATION|AVG|BACKWARD|BEFORE|BEGIN|BETWEEN|BITVAR|'
-             r'BIT_LENGTH|BOTH|BREADTH|BY|C|CACHE|CALL|CALLED|CARDINALITY|'
-             r'CASCADE|CASCADED|CASE|CAST|CATALOG|CATALOG_NAME|CHAIN|'
-             r'CHARACTERISTICS|CHARACTER_LENGTH|CHARACTER_SET_CATALOG|'
-             r'CHARACTER_SET_NAME|CHARACTER_SET_SCHEMA|CHAR_LENGTH|CHECK|'
-             r'CHECKED|CHECKPOINT|CLASS|CLASS_ORIGIN|CLOB|CLOSE|CLUSTER|'
-             r'COALSECE|COBOL|COLLATE|COLLATION|COLLATION_CATALOG|'
-             r'COLLATION_NAME|COLLATION_SCHEMA|COLUMN|COLUMN_NAME|'
-             r'COMMAND_FUNCTION|COMMAND_FUNCTION_CODE|COMMENT|COMMIT|'
-             r'COMMITTED|COMPLETION|CONDITION_NUMBER|CONNECT|CONNECTION|'
-             r'CONNECTION_NAME|CONSTRAINT|CONSTRAINTS|CONSTRAINT_CATALOG|'
-             r'CONSTRAINT_NAME|CONSTRAINT_SCHEMA|CONSTRUCTOR|CONTAINS|'
-             r'CONTINUE|CONVERSION|CONVERT|COPY|CORRESPONTING|COUNT|'
-             r'CREATE|CREATEDB|CREATEUSER|CROSS|CUBE|CURRENT|CURRENT_DATE|'
-             r'CURRENT_PATH|CURRENT_ROLE|CURRENT_TIME|CURRENT_TIMESTAMP|'
-             r'CURRENT_USER|CURSOR|CURSOR_NAME|CYCLE|DATA|DATABASE|'
-             r'DATETIME_INTERVAL_CODE|DATETIME_INTERVAL_PRECISION|DAY|'
-             r'DEALLOCATE|DECLARE|DEFAULT|DEFAULTS|DEFERRABLE|DEFERRED|'
-             r'DEFINED|DEFINER|DELETE|DELIMITER|DELIMITERS|DEREF|DESC|'
-             r'DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DETERMINISTIC|'
-             r'DIAGNOSTICS|DICTIONARY|DISCONNECT|DISPATCH|DISTINCT|DO|'
-             r'DOMAIN|DROP|DYNAMIC|DYNAMIC_FUNCTION|DYNAMIC_FUNCTION_CODE|'
-             r'EACH|ELSE|ENCODING|ENCRYPTED|END|END-EXEC|EQUALS|ESCAPE|EVERY|'
-             r'EXCEPT|ESCEPTION|EXCLUDING|EXCLUSIVE|EXEC|EXECUTE|EXISTING|'
-             r'EXISTS|EXPLAIN|EXTERNAL|EXTRACT|FALSE|FETCH|FINAL|FIRST|FOR|'
-             r'FORCE|FOREIGN|FORTRAN|FORWARD|FOUND|FREE|FREEZE|FROM|FULL|'
-             r'FUNCTION|G|GENERAL|GENERATED|GET|GLOBAL|GO|GOTO|GRANT|GRANTED|'
-             r'GROUP|GROUPING|HANDLER|HAVING|HIERARCHY|HOLD|HOST|IDENTITY|'
-             r'IGNORE|ILIKE|IMMEDIATE|IMMUTABLE|IMPLEMENTATION|IMPLICIT|IN|'
-             r'INCLUDING|INCREMENT|INDEX|INDITCATOR|INFIX|INHERITS|INITIALIZE|'
-             r'INITIALLY|INNER|INOUT|INPUT|INSENSITIVE|INSERT|INSTANTIABLE|'
-             r'INSTEAD|INTERSECT|INTO|INVOKER|IS|ISNULL|ISOLATION|ITERATE|JOIN|'
-             r'KEY|KEY_MEMBER|KEY_TYPE|LANCOMPILER|LANGUAGE|LARGE|LAST|'
-             r'LATERAL|LEADING|LEFT|LENGTH|LESS|LEVEL|LIKE|LIMIT|LISTEN|LOAD|'
-             r'LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCATION|LOCATOR|LOCK|LOWER|'
-             r'MAP|MATCH|MAX|MAXVALUE|MESSAGE_LENGTH|MESSAGE_OCTET_LENGTH|'
-             r'MESSAGE_TEXT|METHOD|MIN|MINUTE|MINVALUE|MOD|MODE|MODIFIES|'
-             r'MODIFY|MONTH|MORE|MOVE|MUMPS|NAMES|NATIONAL|NATURAL|NCHAR|'
-             r'NCLOB|NEW|NEXT|NO|NOCREATEDB|NOCREATEUSER|NONE|NOT|NOTHING|'
-             r'NOTIFY|NOTNULL|NULL|NULLABLE|NULLIF|OBJECT|OCTET_LENGTH|OF|OFF|'
-             r'OFFSET|OIDS|OLD|ON|ONLY|OPEN|OPERATION|OPERATOR|OPTION|OPTIONS|'
-             r'OR|ORDER|ORDINALITY|OUT|OUTER|OUTPUT|OVERLAPS|OVERLAY|OVERRIDING|'
-             r'OWNER|PAD|PARAMETER|PARAMETERS|PARAMETER_MODE|PARAMATER_NAME|'
-             r'PARAMATER_ORDINAL_POSITION|PARAMETER_SPECIFIC_CATALOG|'
-             r'PARAMETER_SPECIFIC_NAME|PARAMATER_SPECIFIC_SCHEMA|PARTIAL|'
-             r'PASCAL|PENDANT|PLACING|PLI|POSITION|POSTFIX|PRECISION|PREFIX|'
-             r'PREORDER|PREPARE|PRESERVE|PRIMARY|PRIOR|PRIVILEGES|PROCEDURAL|'
-             r'PROCEDURE|PUBLIC|READ|READS|RECHECK|RECURSIVE|REF|REFERENCES|'
-             r'REFERENCING|REINDEX|RELATIVE|RENAME|REPEATABLE|REPLACE|RESET|'
-             r'RESTART|RESTRICT|RESULT|RETURN|RETURNED_LENGTH|'
-             r'RETURNED_OCTET_LENGTH|RETURNED_SQLSTATE|RETURNS|REVOKE|RIGHT|'
-             r'ROLE|ROLLBACK|ROLLUP|ROUTINE|ROUTINE_CATALOG|ROUTINE_NAME|'
-             r'ROUTINE_SCHEMA|ROW|ROWS|ROW_COUNT|RULE|SAVE_POINT|SCALE|SCHEMA|'
-             r'SCHEMA_NAME|SCOPE|SCROLL|SEARCH|SECOND|SECURITY|SELECT|SELF|'
-             r'SENSITIVE|SERIALIZABLE|SERVER_NAME|SESSION|SESSION_USER|SET|'
-             r'SETOF|SETS|SHARE|SHOW|SIMILAR|SIMPLE|SIZE|SOME|SOURCE|SPACE|'
-             r'SPECIFIC|SPECIFICTYPE|SPECIFIC_NAME|SQL|SQLCODE|SQLERROR|'
-             r'SQLEXCEPTION|SQLSTATE|SQLWARNINIG|STABLE|START|STATE|STATEMENT|'
-             r'STATIC|STATISTICS|STDIN|STDOUT|STORAGE|STRICT|STRUCTURE|STYPE|'
-             r'SUBCLASS_ORIGIN|SUBLIST|SUBSTRING|SUM|SYMMETRIC|SYSID|SYSTEM|'
-             r'SYSTEM_USER|TABLE|TABLE_NAME| TEMP|TEMPLATE|TEMPORARY|TERMINATE|'
-             r'THAN|THEN|TIMESTAMP|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TOAST|'
-             r'TRAILING|TRANSATION|TRANSACTIONS_COMMITTED|'
-             r'TRANSACTIONS_ROLLED_BACK|TRANSATION_ACTIVE|TRANSFORM|'
-             r'TRANSFORMS|TRANSLATE|TRANSLATION|TREAT|TRIGGER|TRIGGER_CATALOG|'
-             r'TRIGGER_NAME|TRIGGER_SCHEMA|TRIM|TRUE|TRUNCATE|TRUSTED|TYPE|'
-             r'UNCOMMITTED|UNDER|UNENCRYPTED|UNION|UNIQUE|UNKNOWN|UNLISTEN|'
-             r'UNNAMED|UNNEST|UNTIL|UPDATE|UPPER|USAGE|USER|'
-             r'USER_DEFINED_TYPE_CATALOG|USER_DEFINED_TYPE_NAME|'
-             r'USER_DEFINED_TYPE_SCHEMA|USING|VACUUM|VALID|VALIDATOR|VALUES|'
-             r'VARIABLE|VERBOSE|VERSION|VIEW|VOLATILE|WHEN|WHENEVER|WHERE|'
-             r'WITH|WITHOUT|WORK|WRITE|YEAR|ZONE)\b', Keyword),
-            (r'(ARRAY|BIGINT|BINARY|BIT|BLOB|BOOLEAN|CHAR|CHARACTER|DATE|'
-             r'DEC|DECIMAL|FLOAT|INT|INTEGER|INTERVAL|NUMBER|NUMERIC|REAL|'
-             r'SERIAL|SMALLINT|VARCHAR|VARYING|INT8|SERIAL8|TEXT)\b',
-             Name.Builtin),
-            (r'[+*/<>=~!@#%^&|`?^-]', Operator),
-            (r'[0-9]+', Number.Integer),
-            # TODO: Backslash escapes?
-            (r"'(''|[^'])*'", String.Single),
-            (r'"(""|[^"])*"', String.Symbol), # not a real string literal in ANSI SQL
-            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
-            (r'[;:()\[\],\.]', Punctuation)
-        ],
-        'multiline-comments': [
-            (r'/\*', Comment.Multiline, 'multiline-comments'),
-            (r'\*/', Comment.Multiline, '#pop'),
-            (r'[^/\*]+', Comment.Multiline),
-            (r'[/*]', Comment.Multiline)
-        ]
-    }
-
+    Lexer for the declarative big-data `ECL
+    <http://hpccsystems.com/community/docs/ecl-language-reference/html>`_
+    language.
 
-class MySqlLexer(RegexLexer):
-    """
-    Special lexer for MySQL.
+    *New in Pygments 1.5.*
     """
 
-    name = 'MySQL'
-    aliases = ['mysql']
-    mimetypes = ['text/x-mysql']
+    name = 'ECL'
+    aliases = ['ecl']
+    filenames = ['*.ecl']
+    mimetypes = ['application/x-ecl']
+
+    flags = re.IGNORECASE | re.MULTILINE
 
-    flags = re.IGNORECASE
     tokens = {
         'root': [
+            include('whitespace'),
+            include('statements'),
+        ],
+        'whitespace': [
             (r'\s+', Text),
-            (r'(#|--\s+).*?\n', Comment.Single),
-            (r'/\*', Comment.Multiline, 'multiline-comments'),
-            (r'[0-9]+', Number.Integer),
-            (r'[0-9]*\.[0-9]+(e[+-][0-9]+)', Number.Float),
-            # TODO: add backslash escapes
-            (r"'(''|[^'])*'", String.Single),
-            (r'"(""|[^"])*"', String.Double),
-            (r"`(``|[^`])*`", String.Symbol),
-            (r'[+*/<>=~!@#%^&|`?^-]', Operator),
-            (r'\b(tinyint|smallint|mediumint|int|integer|bigint|date|'
-             r'datetime|time|bit|bool|tinytext|mediumtext|longtext|text|'
-             r'tinyblob|mediumblob|longblob|blob|float|double|double\s+'
-             r'precision|real|numeric|dec|decimal|timestamp|year|char|'
-             r'varchar|varbinary|varcharacter|enum|set)(\b\s*)(\()?',
-             bygroups(Keyword.Type, Text, Punctuation)),
-            (r'\b(add|all|alter|analyze|and|as|asc|asensitive|before|between|'
-             r'bigint|binary|blob|both|by|call|cascade|case|change|char|'
-             r'character|check|collate|column|condition|constraint|continue|'
-             r'convert|create|cross|current_date|current_time|'
-             r'current_timestamp|current_user|cursor|database|databases|'
-             r'day_hour|day_microsecond|day_minute|day_second|dec|decimal|'
-             r'declare|default|delayed|delete|desc|describe|deterministic|'
-             r'distinct|distinctrow|div|double|drop|dual|each|else|elseif|'
-             r'enclosed|escaped|exists|exit|explain|fetch|float|float4|float8'
-             r'|for|force|foreign|from|fulltext|grant|group|having|'
-             r'high_priority|hour_microsecond|hour_minute|hour_second|if|'
-             r'ignore|in|index|infile|inner|inout|insensitive|insert|int|'
-             r'int1|int2|int3|int4|int8|integer|interval|into|is|iterate|'
-             r'join|key|keys|kill|leading|leave|left|like|limit|lines|load|'
-             r'localtime|localtimestamp|lock|long|loop|low_priority|match|'
-             r'minute_microsecond|minute_second|mod|modifies|natural|'
-             r'no_write_to_binlog|not|numeric|on|optimize|option|optionally|'
-             r'or|order|out|outer|outfile|precision|primary|procedure|purge|'
-             r'raid0|read|reads|real|references|regexp|release|rename|repeat|'
-             r'replace|require|restrict|return|revoke|right|rlike|schema|'
-             r'schemas|second_microsecond|select|sensitive|separator|set|'
-             r'show|smallint|soname|spatial|specific|sql|sql_big_result|'
-             r'sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|'
-             r'sqlwarning|ssl|starting|straight_join|table|terminated|then|'
-             r'to|trailing|trigger|undo|union|unique|unlock|unsigned|update|'
-             r'usage|use|using|utc_date|utc_time|utc_timestamp|values|'
-             r'varying|when|where|while|with|write|x509|xor|year_month|'
-             r'zerofill)\b', Keyword),
-            # TODO: this list is not complete
-            (r'\b(auto_increment|engine|charset|tables)\b', Keyword.Pseudo),
-            (r'(true|false|null)', Name.Constant),
-            (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\()',
-             bygroups(Name.Function, Text, Punctuation)),
+            (r'\/\/.*', Comment.Single),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+        ],
+        'statements': [
+            include('types'),
+            include('keywords'),
+            include('functions'),
+            include('hash'),
+            (r'"', String, 'string'),
+            (r'\'', String, 'string'),
+            (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
+            (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
+            (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
+            (r'0[0-7]+[LlUu]*', Number.Oct),
+            (r'\d+[LlUu]*', Number.Integer),
+            (r'\*/', Error),
+            (r'[~!%^&*+=|?:<>/-]+', Operator),
+            (r'[{}()\[\],.;]', Punctuation),
             (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
-            (r'@[A-Za-z0-9]*[._]*[A-Za-z0-9]*', Name.Variable),
-            (r'[;:()\[\],\.]', Punctuation)
         ],
-        'multiline-comments': [
-            (r'/\*', Comment.Multiline, 'multiline-comments'),
-            (r'\*/', Comment.Multiline, '#pop'),
-            (r'[^/\*]+', Comment.Multiline),
-            (r'[/*]', Comment.Multiline)
-        ]
+        'hash': [
+            (r'^#.*$', Comment.Preproc),
+        ],
+        'types': [
+            (r'(RECORD|END)\D', Keyword.Declaration),
+            (r'((?:ASCII|BIG_ENDIAN|BOOLEAN|DATA|DECIMAL|EBCDIC|INTEGER|PATTERN|'
+             r'QSTRING|REAL|RECORD|RULE|SET OF|STRING|TOKEN|UDECIMAL|UNICODE|'
+             r'UNSIGNED|VARSTRING|VARUNICODE)\d*)(\s+)',
+             bygroups(Keyword.Type, Text)),
+        ],
+        'keywords': [
+            (r'(APPLY|ASSERT|BUILD|BUILDINDEX|EVALUATE|FAIL|KEYDIFF|KEYPATCH|'
+             r'LOADXML|NOTHOR|NOTIFY|OUTPUT|PARALLEL|SEQUENTIAL|SOAPCALL|WAIT'
+             r'CHECKPOINT|DEPRECATED|FAILCODE|FAILMESSAGE|FAILURE|GLOBAL|'
+             r'INDEPENDENT|ONWARNING|PERSIST|PRIORITY|RECOVERY|STORED|SUCCESS|'
+             r'WAIT|WHEN)\b', Keyword.Reserved),
+            # These are classed differently, check later
+            (r'(ALL|AND|ANY|AS|ATMOST|BEFORE|BEGINC\+\+|BEST|BETWEEN|CASE|CONST|'
+             r'COUNTER|CSV|DESCEND|ENCRYPT|ENDC\+\+|ENDMACRO|EXCEPT|EXCLUSIVE|'
+             r'EXPIRE|EXPORT|EXTEND|FALSE|FEW|FIRST|FLAT|FULL|FUNCTION|GROUP|'
+             r'HEADER|HEADING|HOLE|IFBLOCK|IMPORT|IN|JOINED|KEEP|KEYED|LAST|'
+             r'LEFT|LIMIT|LOAD|LOCAL|LOCALE|LOOKUP|MACRO|MANY|MAXCOUNT|'
+             r'MAXLENGTH|MIN SKEW|MODULE|INTERFACE|NAMED|NOCASE|NOROOT|NOSCAN|'
+             r'NOSORT|NOT|OF|ONLY|OPT|OR|OUTER|OVERWRITE|PACKED|PARTITION|'
+             r'PENALTY|PHYSICALLENGTH|PIPE|QUOTE|RELATIONSHIP|REPEAT|RETURN|'
+             r'RIGHT|SCAN|SELF|SEPARATOR|SERVICE|SHARED|SKEW|SKIP|SQL|STORE|'
+             r'TERMINATOR|THOR|THRESHOLD|TOKEN|TRANSFORM|TRIM|TRUE|TYPE|'
+             r'UNICODEORDER|UNSORTED|VALIDATE|VIRTUAL|WHOLE|WILD|WITHIN|XML|'
+             r'XPATH|__COMPRESSED__)\b', Keyword.Reserved),
+        ],
+        'functions': [
+            (r'(ABS|ACOS|ALLNODES|ASCII|ASIN|ASSTRING|ATAN|ATAN2|AVE|CASE|'
+             r'CHOOSE|CHOOSEN|CHOOSESETS|CLUSTERSIZE|COMBINE|CORRELATION|COS|'
+             r'COSH|COUNT|COVARIANCE|CRON|DATASET|DEDUP|DEFINE|DENORMALIZE|'
+             r'DISTRIBUTE|DISTRIBUTED|DISTRIBUTION|EBCDIC|ENTH|ERROR|EVALUATE|'
+             r'EVENT|EVENTEXTRA|EVENTNAME|EXISTS|EXP|FAILCODE|FAILMESSAGE|'
+             r'FETCH|FROMUNICODE|GETISVALID|GLOBAL|GRAPH|GROUP|HASH|HASH32|'
+             r'HASH64|HASHCRC|HASHMD5|HAVING|IF|INDEX|INTFORMAT|ISVALID|'
+             r'ITERATE|JOIN|KEYUNICODE|LENGTH|LIBRARY|LIMIT|LN|LOCAL|LOG|LOOP|'
+             r'MAP|MATCHED|MATCHLENGTH|MATCHPOSITION|MATCHTEXT|MATCHUNICODE|'
+             r'MAX|MERGE|MERGEJOIN|MIN|NOLOCAL|NONEMPTY|NORMALIZE|PARSE|PIPE|'
+             r'POWER|PRELOAD|PROCESS|PROJECT|PULL|RANDOM|RANGE|RANK|RANKED|'
+             r'REALFORMAT|RECORDOF|REGEXFIND|REGEXREPLACE|REGROUP|REJECTED|'
+             r'ROLLUP|ROUND|ROUNDUP|ROW|ROWDIFF|SAMPLE|SET|SIN|SINH|SIZEOF|'
+             r'SOAPCALL|SORT|SORTED|SQRT|STEPPED|STORED|SUM|TABLE|TAN|TANH|'
+             r'THISNODE|TOPN|TOUNICODE|TRANSFER|TRIM|TRUNCATE|TYPEOF|UNGROUP|'
+             r'UNICODEORDER|VARIANCE|WHICH|WORKUNIT|XMLDECODE|XMLENCODE|'
+             r'XMLTEXT|XMLUNICODE)\b', Name.Function),
+        ],
+        'string': [
+            (r'"', String, '#pop'),
+            (r'\'', String, '#pop'),
+            (r'[^"\']+', String),
+        ],
     }
 
 
-class SqliteConsoleLexer(Lexer):
-    """
-    Lexer for example sessions using sqlite3.
-
-    *New in Pygments 0.11.*
-    """
-
-    name = 'sqlite3con'
-    aliases = ['sqlite3']
-    filenames = ['*.sqlite3-console']
-    mimetypes = ['text/x-sqlite3-console']
-
-    def get_tokens_unprocessed(self, data):
-        sql = SqlLexer(**self.options)
-
-        curcode = ''
-        insertions = []
-        for match in line_re.finditer(data):
-            line = match.group()
-            if line.startswith('sqlite> ') or line.startswith('   ...> '):
-                insertions.append((len(curcode),
-                                   [(0, Generic.Prompt, line[:8])]))
-                curcode += line[8:]
-            else:
-                if curcode:
-                    for item in do_insertions(insertions,
-                                              sql.get_tokens_unprocessed(curcode)):
-                        yield item
-                    curcode = ''
-                    insertions = []
-                if line.startswith('SQL error: '):
-                    yield (match.start(), Generic.Traceback, line)
-                else:
-                    yield (match.start(), Generic.Output, line)
-        if curcode:
-            for item in do_insertions(insertions,
-                                      sql.get_tokens_unprocessed(curcode)):
-                yield item
-
-
 class BrainfuckLexer(RegexLexer):
     """
     Lexer for the esoteric `BrainFuck <http://www.muppetlabs.com/~breadbox/bf/>`_
@@ -320,191 +194,6 @@ class BefungeLexer(RegexLexer):
     }
 
 
-
-class BashLexer(RegexLexer):
-    """
-    Lexer for (ba|k|)sh shell scripts.
-
-    *New in Pygments 0.6.*
-    """
-
-    name = 'Bash'
-    aliases = ['bash', 'sh', 'ksh']
-    filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass']
-    mimetypes = ['application/x-sh', 'application/x-shellscript']
-
-    tokens = {
-        'root': [
-            include('basic'),
-            (r'\$\(\(', Keyword, 'math'),
-            (r'\$\(', Keyword, 'paren'),
-            (r'\${#?', Keyword, 'curly'),
-            (r'`', String.Backtick, 'backticks'),
-            include('data'),
-        ],
-        'basic': [
-            (r'\b(if|fi|else|while|do|done|for|then|return|function|case|'
-             r'select|continue|until|esac|elif)\s*\b',
-             Keyword),
-            (r'\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|'
-             r'complete|declare|dirs|disown|echo|enable|eval|exec|exit|'
-             r'export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|'
-             r'local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|'
-             r'shopt|source|suspend|test|time|times|trap|true|type|typeset|'
-             r'ulimit|umask|unalias|unset|wait)\s*\b(?!\.)',
-             Name.Builtin),
-            (r'#.*\n', Comment),
-            (r'\\[\w\W]', String.Escape),
-            (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)),
-            (r'[\[\]{}()=]', Operator),
-            (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
-            (r'&&|\|\|', Operator),
-        ],
-        'data': [
-            (r'(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
-            (r"(?s)\$?'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
-            (r';', Text),
-            (r'\s+', Text),
-            (r'[^=\s\n\[\]{}()$"\'`\\<]+', Text),
-            (r'\d+(?= |\Z)', Number),
-            (r'\$#?(\w+|.)', Name.Variable),
-            (r'<', Text),
-        ],
-        'curly': [
-            (r'}', Keyword, '#pop'),
-            (r':-', Keyword),
-            (r'[a-zA-Z0-9_]+', Name.Variable),
-            (r'[^}:"\'`$]+', Punctuation),
-            (r':', Punctuation),
-            include('root'),
-        ],
-        'paren': [
-            (r'\)', Keyword, '#pop'),
-            include('root'),
-        ],
-        'math': [
-            (r'\)\)', Keyword, '#pop'),
-            (r'[-+*/%^|&]|\*\*|\|\|', Operator),
-            (r'\d+', Number),
-            include('root'),
-        ],
-        'backticks': [
-            (r'`', String.Backtick, '#pop'),
-            include('root'),
-        ],
-    }
-
-    def analyse_text(text):
-        return shebang_matches(text, r'(ba|z|)sh')
-
-
-class BashSessionLexer(Lexer):
-    """
-    Lexer for simplistic shell sessions.
-
-    *New in Pygments 1.1.*
-    """
-
-    name = 'Bash Session'
-    aliases = ['console']
-    filenames = ['*.sh-session']
-    mimetypes = ['application/x-shell-session']
-
-    def get_tokens_unprocessed(self, text):
-        bashlexer = BashLexer(**self.options)
-
-        pos = 0
-        curcode = ''
-        insertions = []
-
-        for match in line_re.finditer(text):
-            line = match.group()
-            m = re.match(r'^((?:|sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)?|\[\S+[@:]'
-                         r'[^\n]+\].+)[$#%])(.*\n?)', line)
-            if m:
-                # To support output lexers (say diff output), the output
-                # needs to be broken by prompts whenever the output lexer
-                # changes.
-                if not insertions:
-                    pos = match.start()
-
-                insertions.append((len(curcode),
-                                   [(0, Generic.Prompt, m.group(1))]))
-                curcode += m.group(2)
-            elif line.startswith('>'):
-                insertions.append((len(curcode),
-                                   [(0, Generic.Prompt, line[:1])]))
-                curcode += line[1:]
-            else:
-                if insertions:
-                    toks = bashlexer.get_tokens_unprocessed(curcode)
-                    for i, t, v in do_insertions(insertions, toks):
-                        yield pos+i, t, v
-                yield match.start(), Generic.Output, line
-                insertions = []
-                curcode = ''
-        if insertions:
-            for i, t, v in do_insertions(insertions,
-                                         bashlexer.get_tokens_unprocessed(curcode)):
-                yield pos+i, t, v
-
-
-class BatchLexer(RegexLexer):
-    """
-    Lexer for the DOS/Windows Batch file format.
-
-    *New in Pygments 0.7.*
-    """
-    name = 'Batchfile'
-    aliases = ['bat']
-    filenames = ['*.bat', '*.cmd']
-    mimetypes = ['application/x-dos-batch']
-
-    flags = re.MULTILINE | re.IGNORECASE
-
-    tokens = {
-        'root': [
-            # Lines can start with @ to prevent echo
-            (r'^\s*@', Punctuation),
-            (r'^(\s*)(rem\s.*)$', bygroups(Text, Comment)),
-            (r'".*?"', String.Double),
-            (r"'.*?'", String.Single),
-            # If made more specific, make sure you still allow expansions
-            # like %~$VAR:zlt
-            (r'%%?[~$:\w]+%?', Name.Variable),
-            (r'::.*', Comment), # Technically :: only works at BOL
-            (r'(set)(\s+)(\w+)', bygroups(Keyword, Text, Name.Variable)),
-            (r'(call)(\s+)(:\w+)', bygroups(Keyword, Text, Name.Label)),
-            (r'(goto)(\s+)(\w+)', bygroups(Keyword, Text, Name.Label)),
-            (r'\b(set|call|echo|on|off|endlocal|for|do|goto|if|pause|'
-             r'setlocal|shift|errorlevel|exist|defined|cmdextversion|'
-             r'errorlevel|else|cd|md|del|deltree|cls|choice)\b', Keyword),
-            (r'\b(equ|neq|lss|leq|gtr|geq)\b', Operator),
-            include('basic'),
-            (r'.', Text),
-        ],
-        'echo': [
-            # Escapes only valid within echo args?
-            (r'\^\^|\^<|\^>|\^\|', String.Escape),
-            (r'\n', Text, '#pop'),
-            include('basic'),
-            (r'[^\'"^]+', Text),
-        ],
-        'basic': [
-            (r'".*?"', String.Double),
-            (r"'.*?'", String.Single),
-            (r'`.*?`', String.Backtick),
-            (r'-?\d+', Number),
-            (r',', Punctuation),
-            (r'=', Operator),
-            (r'/\S+', Name),
-            (r':\w+', Name.Label),
-            (r'\w:\w+', Text),
-            (r'([<>|])(\s*)(\w+)', bygroups(Punctuation, Text, Name)),
-        ],
-    }
-
-
 class RedcodeLexer(RegexLexer):
     """
     A simple Redcode lexer based on ICWS'94.
@@ -621,7 +310,7 @@ class SmalltalkLexer(RegexLexer):
         ],
         'blockvariables' : [
             include('whitespaces'),
-            (r'(:)(\s*)([A-Za-z\w]+)',
+            (r'(:)(\s*)(\w+)',
              bygroups(Operator, Text, Name.Variable)),
             (r'\|', Operator, '#pop'),
             (r'', Text, '#pop'), # else pop
@@ -636,7 +325,7 @@ class SmalltalkLexer(RegexLexer):
         '_parenth_helper' : [
             include('whitespaces'),
             (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
-            (r'[-+*/\\~<>=|&#!?,@%\w+:]+', String.Symbol),
+            (r'[-+*/\\~<>=|&#!?,@%\w:]+', String.Symbol),
             # literals
             (r'\'[^\']*\'', String),
             (r'\$.', String.Char),
@@ -706,73 +395,6 @@ class SmalltalkLexer(RegexLexer):
     }
 
 
-class TcshLexer(RegexLexer):
-    """
-    Lexer for tcsh scripts.
-
-    *New in Pygments 0.10.*
-    """
-
-    name = 'Tcsh'
-    aliases = ['tcsh', 'csh']
-    filenames = ['*.tcsh', '*.csh']
-    mimetypes = ['application/x-csh']
-
-    tokens = {
-        'root': [
-            include('basic'),
-            (r'\$\(', Keyword, 'paren'),
-            (r'\${#?', Keyword, 'curly'),
-            (r'`', String.Backtick, 'backticks'),
-            include('data'),
-        ],
-        'basic': [
-            (r'\b(if|endif|else|while|then|foreach|case|default|'
-             r'continue|goto|breaksw|end|switch|endsw)\s*\b',
-             Keyword),
-            (r'\b(alias|alloc|bg|bindkey|break|builtins|bye|caller|cd|chdir|'
-             r'complete|dirs|echo|echotc|eval|exec|exit|'
-             r'fg|filetest|getxvers|glob|getspath|hashstat|history|hup|inlib|jobs|kill|'
-             r'limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|'
-             r'onintr|popd|printenv|pushd|rehash|repeat|rootnode|popd|pushd|set|shift|'
-             r'sched|setenv|setpath|settc|setty|setxvers|shift|source|stop|suspend|'
-             r'source|suspend|telltc|time|'
-             r'umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|'
-             r'ver|wait|warp|watchlog|where|which)\s*\b',
-             Name.Builtin),
-            (r'#.*\n', Comment),
-            (r'\\[\w\W]', String.Escape),
-            (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)),
-            (r'[\[\]{}()=]+', Operator),
-            (r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
-        ],
-        'data': [
-            (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
-            (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
-            (r'\s+', Text),
-            (r'[^=\s\n\[\]{}()$"\'`\\]+', Text),
-            (r'\d+(?= |\Z)', Number),
-            (r'\$#?(\w+|.)', Name.Variable),
-        ],
-        'curly': [
-            (r'}', Keyword, '#pop'),
-            (r':-', Keyword),
-            (r'[a-zA-Z0-9_]+', Name.Variable),
-            (r'[^}:"\'`$]+', Punctuation),
-            (r':', Punctuation),
-            include('root'),
-        ],
-        'paren': [
-            (r'\)', Keyword, '#pop'),
-            include('root'),
-        ],
-        'backticks': [
-            (r'`', String.Backtick, '#pop'),
-            include('root'),
-        ],
-    }
-
-
 class LogtalkLexer(RegexLexer):
     """
     For `Logtalk <http://logtalk.org/>`_ source code.
@@ -817,7 +439,7 @@ class LogtalkLexer(RegexLexer):
              Keyword),
             (r'(object|protocol|category)_property(?=[(])', Keyword),
             # Entity relations
-            (r'complements_object(?=[(])', Keyword),
+            (r'co(mplements_object|nforms_to_protocol)(?=[(])', Keyword),
             (r'extends_(object|protocol|category)(?=[(])', Keyword),
             (r'imp(lements_protocol|orts_category)(?=[(])', Keyword),
             (r'(instantiat|specializ)es_class(?=[(])', Keyword),
@@ -826,11 +448,12 @@ class LogtalkLexer(RegexLexer):
             # Flags
             (r'(current|set)_logtalk_flag(?=[(])', Keyword),
             # Compiling, loading, and library paths
-            (r'logtalk_(compile|l(ibrary_path|oad))(?=[(])', Keyword),
+            (r'logtalk_(compile|l(ibrary_path|oad_context|oad))(?=[(])',
+             Keyword),
             # Database
             (r'(clause|retract(all)?)(?=[(])', Keyword),
             (r'a(bolish|ssert(a|z))(?=[(])', Keyword),
-            # Control
+            # Control constructs
             (r'(ca(ll|tch)|throw)(?=[(])', Keyword),
             (r'(fail|true)\b', Keyword),
             # All solutions
@@ -841,7 +464,7 @@ class LogtalkLexer(RegexLexer):
             # Term unification
             (r'unify_with_occurs_check(?=[(])', Keyword),
             # Term creation and decomposition
-            (r'(functor|arg|copy_term)(?=[(])', Keyword),
+            (r'(functor|arg|copy_term|numbervars)(?=[(])', Keyword),
             # Evaluable functors
             (r'(rem|mod|abs|sign)(?=[(])', Keyword),
             (r'float(_(integer|fractional)_part)?(?=[(])', Keyword),
@@ -849,8 +472,10 @@ class LogtalkLexer(RegexLexer):
             # Other arithmetic functors
             (r'(cos|atan|exp|log|s(in|qrt))(?=[(])', Keyword),
             # Term testing
-            (r'(var|atom(ic)?|integer|float|compound|n(onvar|umber))(?=[(])',
-             Keyword),
+            (r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|'
+             r'ground)(?=[(])', Keyword),
+            # Term comparison
+            (r'compare(?=[(])', Keyword),
             # Stream selection and control
             (r'(curren|se)t_(in|out)put(?=[(])', Keyword),
             (r'(open|close)(?=[(])', Keyword),
@@ -879,8 +504,10 @@ class LogtalkLexer(RegexLexer):
             # External call
             (r'[{}]', Keyword),
             # Logic and control
-            (r'\bonce(?=[(])', Keyword),
+            (r'\b(ignore|once)(?=[(])', Keyword),
             (r'\brepeat\b', Keyword),
+            # Sorting
+            (r'(key)?sort(?=[(])', Keyword),
             # Bitwise functors
             (r'(>>|<<|/\\|\\\\|\\)', Operator),
             # Arithemtic evaluation
@@ -895,7 +522,7 @@ class LogtalkLexer(RegexLexer):
             (r'(==|\\==|@=<|@<|@>=|@>)', Operator),
             # Evaluable functors
             (r'(//|[-+*/])', Operator),
-            (r'\b(mod|rem)\b', Operator),
+            (r'\b(e|pi|mod|rem)\b', Operator),
             # Other arithemtic functors
             (r'\b\*\*\b', Operator),
             # DCG rules
@@ -906,18 +533,20 @@ class LogtalkLexer(RegexLexer):
             (r'\\+', Operator),
             # Mode operators
             (r'[?@]', Operator),
+            # Existential quantifier
+            (r'\^', Operator),
             # Strings
             (r'"(\\\\|\\"|[^"])*"', String),
             # Ponctuation
             (r'[()\[\],.|]', Text),
             # Atoms
             (r"[a-z][a-zA-Z0-9_]*", Text),
-            (r"[']", String, 'quoted_atom'),
+            (r"'", String, 'quoted_atom'),
         ],
 
         'quoted_atom': [
-            (r"['][']", String),
-            (r"[']", String, '#pop'),
+            (r"''", String),
+            (r"'", String, '#pop'),
             (r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape),
             (r"[^\\'\n]+", String),
             (r'\\', String),
@@ -937,16 +566,18 @@ class LogtalkLexer(RegexLexer):
             (r'in(fo|itialization)(?=[(])', Keyword, 'root'),
             (r'(dynamic|synchronized|threaded)[.]', Keyword, 'root'),
             (r'(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)|'
-             r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'),
+             r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])',
+             Keyword, 'root'),
             (r'op(?=[(])', Keyword, 'root'),
-            (r'(calls|reexport|use(s|_module))(?=[(])', Keyword, 'root'),
+            (r'(c(alls|oinductive)|reexport|use(s|_module))(?=[(])',
+             Keyword, 'root'),
             (r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'),
             (r'[a-z][a-zA-Z0-9_]*[.]', Text, 'root'),
         ],
 
         'entityrelations': [
-            (r'(extends|i(nstantiates|mp(lements|orts))|specializes)(?=[(])',
-             Keyword),
+            (r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)'
+             r'(?=[(])', Keyword),
             # Numbers
             (r"0'.", Number),
             (r'0b[01]+', Number),
@@ -957,7 +588,7 @@ class LogtalkLexer(RegexLexer):
             (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable),
             # Atoms
             (r"[a-z][a-zA-Z0-9_]*", Text),
-            (r"[']", String, 'quoted_atom'),
+            (r"'", String, 'quoted_atom'),
             # Strings
             (r'"(\\\\|\\"|[^"])*"', String),
             # End of entity-opening directive
@@ -1167,9 +798,9 @@ class PovrayLexer(RegexLexer):
             (r'/\*[\w\W]*?\*/', Comment.Multiline),
             (r'//.*\n', Comment.Single),
             (r'(?s)"(?:\\.|[^"\\])+"', String.Double),
-            (r'#(debug|default|else|end|error|fclose|fopen|if|ifdef|ifndef|'
+            (r'#(debug|default|else|end|error|fclose|fopen|ifdef|ifndef|'
              r'include|range|read|render|statistics|switch|undef|version|'
-             r'warning|while|write|define|macro|local|declare)',
+             r'warning|while|write|define|macro|local|declare)\b',
              Comment.Preproc),
             (r'\b(aa_level|aa_threshold|abs|acos|acosh|adaptive|adc_bailout|'
              r'agate|agate_turb|all|alpha|ambient|ambient_light|angle|'
@@ -1219,11 +850,11 @@ class PovrayLexer(RegexLexer):
              r'vnormalize|volume_object|volume_rendered|vol_with_light|'
              r'vrotate|v_steps|warning|warp|water_level|waves|while|width|'
              r'wood|wrinkles|yes)\b', Keyword),
-            (r'bicubic_patch|blob|box|camera|cone|cubic|cylinder|difference|'
+            (r'(bicubic_patch|blob|box|camera|cone|cubic|cylinder|difference|'
              r'disc|height_field|intersection|julia_fractal|lathe|'
              r'light_source|merge|mesh|object|plane|poly|polygon|prism|'
              r'quadric|quartic|smooth_triangle|sor|sphere|superellipsoid|'
-             r'text|torus|triangle|union', Name.Builtin),
+             r'text|torus|triangle|union)\b', Name.Builtin),
             # TODO: <=, etc
             (r'[\[\](){}<>;,]', Punctuation),
             (r'[-+*/=]', Operator),
@@ -1261,7 +892,7 @@ class AppleScriptLexer(RegexLexer):
     Classes = ['alias ', 'application ', 'boolean ', 'class ', 'constant ',
                'date ', 'file ', 'integer ', 'list ', 'number ', 'POSIX file ',
                'real ', 'record ', 'reference ', 'RGB color ', 'script ',
-               'text ', 'unit types', '(Unicode )?text', 'string']
+               'text ', 'unit types', '(?:Unicode )?text', 'string']
     BuiltIn = ['attachment', 'attribute run', 'character', 'day', 'month',
                'paragraph', 'word', 'year']
     HandlerParams = ['about', 'above', 'against', 'apart from', 'around',
@@ -1527,7 +1158,7 @@ class AppleScriptLexer(RegexLexer):
             (ur'(-|\*|\+|&|≠|>=?|<=?|=|≥|≤|/|÷|\^)', Operator),
             (r"\b(%s)\b" % '|'.join(Operators), Operator.Word),
             (r'^(\s*(?:on|end)\s+)'
-             r'(%s)' % '|'.join(StudioEvents),
+             r'(%s)' % '|'.join(StudioEvents[::-1]),
              bygroups(Keyword, Name.Function)),
             (r'^(\s*)(in|on|script|to)(\s+)', bygroups(Text, Keyword, Text)),
             (r'\b(as )(%s)\b' % '|'.join(Classes),
@@ -1609,11 +1240,11 @@ class ModelicaLexer(RegexLexer):
         ],
         'functions': [
             (r'(abs|acos|acosh|asin|asinh|atan|atan2|atan3|ceil|cos|cosh|'
-             r'cross|div|exp|floor|log|log10|mod|rem|sign|sin|sinh|size|'
-             r'sqrt|tan|tanh|zeros)\b', Name.Function)
+             r'cross|div|exp|floor|log|log10|mod|rem|semiLinear|sign|sin|'
+             r'sinh|size|sqrt|tan|tanh|zeros)\b', Name.Function)
         ],
         'operators': [
-            (r'(and|assert|cardinality|change|delay|der|edge|initial|'
+            (r'(and|assert|cardinality|change|delay|der|edge|homotopy|initial|'
              r'noEvent|not|or|pre|reinit|return|sample|smooth|'
              r'terminal|terminate)\b', Name.Builtin)
         ],
@@ -1870,7 +1501,7 @@ class ABAPLexer(RegexLexer):
             ],
         'variable-names': [
             (r'<[\S_]+>', Name.Variable),
-            (r'[\w][\w_~]*(?:(\[\])|->\*)?', Name.Variable),
+            (r'\w[\w~]*(?:(\[\])|->\*)?', Name.Variable),
             ],
         'root': [
             include('common'),
@@ -1880,21 +1511,21 @@ class ABAPLexer(RegexLexer):
             (r'(CALL\s+(?:DIALOG|SCREEN|SUBSCREEN|SELECTION-SCREEN|'
              r'TRANSACTION|TRANSFORMATION))\b',
                 Keyword),
-            (r'(FORM|PERFORM)(\s+)([\w_]+)',
+            (r'(FORM|PERFORM)(\s+)(\w+)',
                 bygroups(Keyword, Text, Name.Function)),
-            (r'(PERFORM)(\s+)(\()([\w_]+)(\))',
+            (r'(PERFORM)(\s+)(\()(\w+)(\))',
                 bygroups(Keyword, Text, Punctuation, Name.Variable, Punctuation )),
             (r'(MODULE)(\s+)(\S+)(\s+)(INPUT|OUTPUT)',
                 bygroups(Keyword, Text, Name.Function, Text, Keyword)),
 
             # method implementation
-            (r'(METHOD)(\s+)([\w_~]+)',
+            (r'(METHOD)(\s+)([\w~]+)',
                 bygroups(Keyword, Text, Name.Function)),
             # method calls
-            (r'(\s+)([\w_\-]+)([=\-]>)([\w_\-~]+)',
+            (r'(\s+)([\w\-]+)([=\-]>)([\w\-~]+)',
                 bygroups(Text, Name.Variable, Operator, Name.Function)),
             # call methodnames returning style
-            (r'(?<=(=|-)>)([\w_\-~]+)(?=\()', Name.Function),
+            (r'(?<=(=|-)>)([\w\-~]+)(?=\()', Name.Function),
 
             # keywords with dashes in them.
             # these need to be first, because for instance the -ID part
@@ -2403,7 +2034,7 @@ class PostScriptLexer(RegexLexer):
         ],
 
         'escape': [
-            (r'([0-8]{3}|n|r|t|b|f|\\|\(|\)|)', String.Escape, '#pop'),
+            (r'([0-8]{3}|n|r|t|b|f|\\|\(|\))?', String.Escape, '#pop'),
         ],
     }
 
@@ -2419,198 +2050,177 @@ class AutohotkeyLexer(RegexLexer):
     filenames = ['*.ahk', '*.ahkl']
     mimetypes = ['text/x-autohotkey']
 
-    flags = re.IGNORECASE | re.DOTALL | re.MULTILINE
-
     tokens = {
         'root': [
-            include('whitespace'),
-            (r'^\(', String, 'continuation'),
-            include('comments'),
-            (r'(^\s*)(\w+)(\s*)(=)',
-             bygroups(Text.Whitespace, Name, Text.Whitespace, Operator),
-             'command'),
-            (r'([\w#@$?\[\]]+)(\s*)(\()',
-             bygroups(Name.Function, Text.Whitespace, Punctuation),
-             'parameters'),
-            include('directives'),
-            include('labels'),
+            (r'^(\s*)(/\*)', bygroups(Text, Comment.Multiline),
+                             'incomment'),
+            (r'^(\s*)(\()', bygroups(Text, Generic), 'incontinuation'),
+            (r'\s+;.*?$', Comment.Singleline),
+            (r'^;.*?$', Comment.Singleline),
+            (r'[]{}(),;[]', Punctuation),
+            (r'(in|is|and|or|not)\b', Operator.Word),
+            (r'\%[a-zA-Z_#@$][a-zA-Z0-9_#@$]*\%', Name.Variable),
+            (r'!=|==|:=|\.=|<<|>>|[-~+/*%=<>&^|?:!.]', Operator),
             include('commands'),
-            include('expressions'),
+            include('labels'),
+            include('builtInFunctions'),
+            include('builtInVariables'),
+            (r'"', String, combined('stringescape', 'dqs')),
             include('numbers'),
-            include('literals'),
-            include('keynames'),
-            include('keywords'),
+            (r'[a-zA-Z_#@$][a-zA-Z0-9_#@$]*', Name),
+            (r'\\|\'', Text),
+            (r'\`([\,\%\`abfnrtv\-\+;])', String.Escape),
+            include('garbage'),
         ],
-        'command': [
-            include('comments'),
-            include('whitespace'),
-            (r'^\(', String, 'continuation'),
-            (r'[^\n]*?(?=;*|$)', String, '#pop'),
-            include('numbers'),
-            include('literals'),
+        'incomment': [
+            (r'^\s*\*/', Comment.Multiline, '#pop'),
+            (r'[^*/]', Comment.Multiline),
+            (r'[*/]', Comment.Multiline)
         ],
-
-        'expressions': [
-            include('comments'),
-            include('whitespace'),
-            include('numbers'),
-            include('literals'),
-            (r'([]\w#@$?[]+)(\s*)(\()',
-             bygroups(Name.Function, Text.Whitespace, Punctuation),
-             'parameters'),
-            (r'A_\w+', Name.Builtin),
-            (r'%[]\w#@$?[]+?%', Name.Variable),
-            # blocks: if, else, function definitions
-            (r'{', Punctuation, 'block'),
-            # parameters in function calls
-            ],
-        'literals': [
-            (r'"', String, 'string'),
-            (r'A_\w+', Name.Builtin),
-            (r'%[]\w#@$?[]+?%', Name.Variable),
-            (r'[-~!%^&*+|?:<>/=]=?', Operator, 'expressions'),
-            (r'==', Operator, 'expressions'),
-            ('[{()},.%#`;]', Punctuation),
-            (r'\\', Punctuation),
-            include('keywords'),
-            (r'\w+', Text),
-            ],
-        'string': [
-            (r'"', String, '#pop'),
-            (r'""|`.', String.Escape),
-            (r'[^\`"\n]+', String), # all other characters
+        'incontinuation': [
+            (r'^\s*\)', Generic, '#pop'),
+            (r'[^)]', Generic),
+            (r'[)]', Generic),
         ],
-        'block': [
-            include('root'),
-            ('{', Punctuation, '#push'),
-            ('}', Punctuation, '#pop'),
-        ],
-        'parameters': [
-            (r'\)', Punctuation, '#pop'),
-            (r'\(', Punctuation, '#push'),
-            include('numbers'),
-            include('literals'),
-            include('whitespace'),
+        'commands': [
+            (r'(?i)^(\s*)(global|local|static|'
+             r'#AllowSameLineComments|#ClipboardTimeout|#CommentFlag|'
+             r'#ErrorStdOut|#EscapeChar|#HotkeyInterval|#HotkeyModifierTimeout|'
+             r'#Hotstring|#IfWinActive|#IfWinExist|#IfWinNotActive|'
+             r'#IfWinNotExist|#IncludeAgain|#Include|#InstallKeybdHook|'
+             r'#InstallMouseHook|#KeyHistory|#LTrim|#MaxHotkeysPerInterval|'
+             r'#MaxMem|#MaxThreads|#MaxThreadsBuffer|#MaxThreadsPerHotkey|'
+             r'#NoEnv|#NoTrayIcon|#Persistent|#SingleInstance|#UseHook|'
+             r'#WinActivateForce|AutoTrim|BlockInput|Break|Click|ClipWait|'
+             r'Continue|Control|ControlClick|ControlFocus|ControlGetFocus|'
+             r'ControlGetPos|ControlGetText|ControlGet|ControlMove|ControlSend|'
+             r'ControlSendRaw|ControlSetText|CoordMode|Critical|'
+             r'DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|'
+             r'DriveSpaceFree|Edit|Else|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|'
+             r'EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|'
+             r'FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|'
+             r'FileDelete|FileGetAttrib|FileGetShortcut|FileGetSize|'
+             r'FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|'
+             r'FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|'
+             r'FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|'
+             r'FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|'
+             r'GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|'
+             r'GuiControlGet|Hotkey|IfEqual|IfExist|IfGreaterOrEqual|IfGreater|'
+             r'IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|'
+             r'IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|'
+             r'IfWinNotExist|If |ImageSearch|IniDelete|IniRead|IniWrite|'
+             r'InputBox|Input|KeyHistory|KeyWait|ListHotkeys|ListLines|'
+             r'ListVars|Loop|Menu|MouseClickDrag|MouseClick|MouseGetPos|'
+             r'MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|'
+             r'PixelSearch|PostMessage|Process|Progress|Random|RegDelete|'
+             r'RegRead|RegWrite|Reload|Repeat|Return|RunAs|RunWait|Run|'
+             r'SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|Send|'
+             r'SetBatchLines|SetCapslockState|SetControlDelay|'
+             r'SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|'
+             r'SetMouseDelay|SetNumlockState|SetScrollLockState|'
+             r'SetStoreCapslockMode|SetTimer|SetTitleMatchMode|'
+             r'SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|'
+             r'SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|'
+             r'SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|'
+             r'SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|'
+             r'StringGetPos|StringLeft|StringLen|StringLower|StringMid|'
+             r'StringReplace|StringRight|StringSplit|StringTrimLeft|'
+             r'StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|'
+             r'Transform|TrayTip|URLDownloadToFile|While|WinActivate|'
+             r'WinActivateBottom|WinClose|WinGetActiveStats|WinGetActiveTitle|'
+             r'WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinGet|WinHide|'
+             r'WinKill|WinMaximize|WinMenuSelectItem|WinMinimizeAllUndo|'
+             r'WinMinimizeAll|WinMinimize|WinMove|WinRestore|WinSetTitle|'
+             r'WinSet|WinShow|WinWaitActive|WinWaitClose|WinWaitNotActive|'
+             r'WinWait)\b', bygroups(Text, Name.Builtin)),
+        ],
+        'builtInFunctions': [
+            (r'(?i)(Abs|ACos|Asc|ASin|ATan|Ceil|Chr|Cos|DllCall|Exp|FileExist|'
+             r'Floor|GetKeyState|IL_Add|IL_Create|IL_Destroy|InStr|IsFunc|'
+             r'IsLabel|Ln|Log|LV_Add|LV_Delete|LV_DeleteCol|LV_GetCount|'
+             r'LV_GetNext|LV_GetText|LV_Insert|LV_InsertCol|LV_Modify|'
+             r'LV_ModifyCol|LV_SetImageList|Mod|NumGet|NumPut|OnMessage|'
+             r'RegExMatch|RegExReplace|RegisterCallback|Round|SB_SetIcon|'
+             r'SB_SetParts|SB_SetText|Sin|Sqrt|StrLen|SubStr|Tan|TV_Add|'
+             r'TV_Delete|TV_GetChild|TV_GetCount|TV_GetNext|TV_Get|'
+             r'TV_GetParent|TV_GetPrev|TV_GetSelection|TV_GetText|TV_Modify|'
+             r'VarSetCapacity|WinActive|WinExist|Object|ComObjActive|'
+             r'ComObjArray|ComObjEnwrap|ComObjUnwrap|ComObjParameter|'
+             r'ComObjType|ComObjConnect|ComObjCreate|ComObjGet|ComObjError|'
+             r'ComObjValue|Insert|MinIndex|MaxIndex|Remove|SetCapacity|'
+             r'GetCapacity|GetAddress|_NewEnum|FileOpen|Read|Write|ReadLine|'
+             r'WriteLine|ReadNumType|WriteNumType|RawRead|RawWrite|Seek|Tell|'
+             r'Close|Next|IsObject|StrPut|StrGet|Trim|LTrim|RTrim)\b',
+             Name.Function),
+        ],
+        'builtInVariables': [
+            (r'(?i)(A_AhkPath|A_AhkVersion|A_AppData|A_AppDataCommon|'
+             r'A_AutoTrim|A_BatchLines|A_CaretX|A_CaretY|A_ComputerName|'
+             r'A_ControlDelay|A_Cursor|A_DDDD|A_DDD|A_DD|A_DefaultMouseSpeed|'
+             r'A_Desktop|A_DesktopCommon|A_DetectHiddenText|'
+             r'A_DetectHiddenWindows|A_EndChar|A_EventInfo|A_ExitReason|'
+             r'A_FormatFloat|A_FormatInteger|A_Gui|A_GuiEvent|A_GuiControl|'
+             r'A_GuiControlEvent|A_GuiHeight|A_GuiWidth|A_GuiX|A_GuiY|A_Hour|'
+             r'A_IconFile|A_IconHidden|A_IconNumber|A_IconTip|A_Index|'
+             r'A_IPAddress1|A_IPAddress2|A_IPAddress3|A_IPAddress4|A_ISAdmin|'
+             r'A_IsCompiled|A_IsCritical|A_IsPaused|A_IsSuspended|A_KeyDelay|'
+             r'A_Language|A_LastError|A_LineFile|A_LineNumber|A_LoopField|'
+             r'A_LoopFileAttrib|A_LoopFileDir|A_LoopFileExt|A_LoopFileFullPath|'
+             r'A_LoopFileLongPath|A_LoopFileName|A_LoopFileShortName|'
+             r'A_LoopFileShortPath|A_LoopFileSize|A_LoopFileSizeKB|'
+             r'A_LoopFileSizeMB|A_LoopFileTimeAccessed|A_LoopFileTimeCreated|'
+             r'A_LoopFileTimeModified|A_LoopReadLine|A_LoopRegKey|'
+             r'A_LoopRegName|A_LoopRegSubkey|A_LoopRegTimeModified|'
+             r'A_LoopRegType|A_MDAY|A_Min|A_MM|A_MMM|A_MMMM|A_Mon|A_MouseDelay|'
+             r'A_MSec|A_MyDocuments|A_Now|A_NowUTC|A_NumBatchLines|A_OSType|'
+             r'A_OSVersion|A_PriorHotkey|A_ProgramFiles|A_Programs|'
+             r'A_ProgramsCommon|A_ScreenHeight|A_ScreenWidth|A_ScriptDir|'
+             r'A_ScriptFullPath|A_ScriptName|A_Sec|A_Space|A_StartMenu|'
+             r'A_StartMenuCommon|A_Startup|A_StartupCommon|A_StringCaseSense|'
+             r'A_Tab|A_Temp|A_ThisFunc|A_ThisHotkey|A_ThisLabel|A_ThisMenu|'
+             r'A_ThisMenuItem|A_ThisMenuItemPos|A_TickCount|A_TimeIdle|'
+             r'A_TimeIdlePhysical|A_TimeSincePriorHotkey|A_TimeSinceThisHotkey|'
+             r'A_TitleMatchMode|A_TitleMatchModeSpeed|A_UserName|A_WDay|'
+             r'A_WinDelay|A_WinDir|A_WorkingDir|A_YDay|A_YEAR|A_YWeek|A_YYYY|'
+             r'Clipboard|ClipboardAll|ComSpec|ErrorLevel|ProgramFiles|True|'
+             r'False|A_IsUnicode|A_FileEncoding|A_OSVersion|A_PtrSize)\b',
+             Name.Variable),
         ],
-        'keywords': [
-            (r'(static|global|local)\b', Keyword.Type),
-            (r'(if|else|and|or)\b', Keyword.Reserved),
-            ],
-        'directives': [
-            (r'#\w+?\s', Keyword),
-            ],
         'labels': [
             # hotkeys and labels
             # technically, hotkey names are limited to named keys and buttons
-            (r'(^\s*)([^:\s]+?:{1,2})', bygroups(Text.Whitespace, Name.Label)),
-             # hotstrings
-            (r'(^\s*)(::[]\w#@$?[]+?::)', bygroups(Text.Whitespace, Name.Label)),
-            ],
-        'comments': [
-            (r'^;+.*?$', Comment.Single),  # beginning of line comments
-            (r'(?<=\s);+.*?$', Comment.Single),    # end of line comments
-            (r'^/\*.*?\n\*/', Comment.Multiline),
-            (r'(?<!\n)/\*.*?\n\*/', Error),  # must be at start of line
-            ],
-        'whitespace': [
-            (r'[ \t]+', Text.Whitespace),
-            ],
+            (r'(^\s*)([^:\s\(\"]+?:{1,2})', bygroups(Text, Name.Label)),
+            (r'(^\s*)(::[^:\s]+?::)', bygroups(Text, Name.Label)),
+        ],
         'numbers': [
             (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
             (r'\d+[eE][+-]?[0-9]+', Number.Float),
-            (r'0[0-7]+', Number.Oct),
+            (r'0\d+', Number.Oct),
             (r'0[xX][a-fA-F0-9]+', Number.Hex),
             (r'\d+L', Number.Integer.Long),
             (r'\d+', Number.Integer)
         ],
-        'continuation': [
-            (r'\n\)', Punctuation, '#pop'),
-            (r'\s[^\n\)]+', String),
+        'stringescape': [
+            (r'\"\"|\`([\,\%\`abfnrtv])', String.Escape),
         ],
-        'keynames': [
-            (r'\[[^\]]+\]', Keyword, 'keynames')
+        'strings': [
+            (r'[^"\n]+', String),
         ],
-        'commands': [
-            (r'(autotrim|blockinput|break|click|'
-             r'clipwait|continue|control|'
-             r'controlclick|controlfocus|controlget|'
-             r'controlgetfocus|controlgetpos|controlgettext|'
-             r'controlmove|controlsend|controlsendraw|'
-             r'controlsettext|coordmode|critical|'
-             r'detecthiddentext|detecthiddenwindows|'
-             r'dllcall|drive|'
-             r'driveget|drivespacefree|'
-             r'else|envadd|envdiv|'
-             r'envget|envmult|envset|'
-             r'envsub|envupdate|exit|'
-             r'exitapp|fileappend|filecopy|'
-             r'filecopydir|filecreatedir|filecreateshortcut|'
-             r'filedelete|filegetattrib|filegetshortcut|'
-             r'filegetsize|filegettime|filegetversion|'
-             r'fileinstall|filemove|filemovedir|'
-             r'fileread|filereadline|filerecycle|'
-             r'filerecycleempty|fileremovedir|fileselectfile|'
-             r'fileselectfolder|filesetattrib|filesettime|'
-             r'formattime|gosub|'
-             r'goto|groupactivate|groupadd|'
-             r'groupclose|groupdeactivate|gui|'
-             r'guicontrol|guicontrolget|hotkey|'
-             r'ifexist|ifgreater|ifgreaterorequal|'
-             r'ifinstring|ifless|iflessorequal|'
-             r'ifmsgbox|ifnotequal|ifnotexist|'
-             r'ifnotinstring|ifwinactive|ifwinexist|'
-             r'ifwinnotactive|ifwinnotexist|imagesearch|'
-             r'inidelete|iniread|iniwrite|'
-             r'input|inputbox|keyhistory|'
-             r'keywait|listhotkeys|listlines|'
-             r'listvars|loop|'
-             r'menu|mouseclick|mouseclickdrag|'
-             r'mousegetpos|mousemove|msgbox|'
-             r'onmessage|onexit|outputdebug|'
-             r'pixelgetcolor|pixelsearch|postmessage|'
-             r'process|progress|random|'
-             r'regexmatch|regexreplace|registercallback|'
-             r'regdelete|regread|regwrite|'
-             r'reload|repeat|return|'
-             r'run|runas|runwait|'
-             r'send|sendevent|sendinput|'
-             r'sendmessage|sendmode|sendplay|'
-             r'sendraw|setbatchlines|setcapslockstate|'
-             r'setcontroldelay|setdefaultmousespeed|setenv|'
-             r'setformat|setkeydelay|setmousedelay|'
-             r'setnumlockstate|setscrolllockstate|'
-             r'setstorecapslockmode|'
-             r'settimer|settitlematchmode|setwindelay|'
-             r'setworkingdir|shutdown|sleep|'
-             r'sort|soundbeep|soundget|'
-             r'soundgetwavevolume|soundplay|soundset|'
-             r'soundsetwavevolume|splashimage|splashtextoff|'
-             r'splashtexton|splitpath|statusbargettext|'
-             r'statusbarwait|stringcasesense|stringgetpos|'
-             r'stringleft|stringlen|stringlower|'
-             r'stringmid|stringreplace|stringright|'
-             r'stringsplit|stringtrimleft|stringtrimright|'
-             r'stringupper|suspend|sysget|'
-             r'thread|tooltip|transform|'
-             r'traytip|urldownloadtofile|while|'
-             r'varsetcapacity|'
-             r'winactivate|winactivatebottom|winclose|'
-             r'winget|wingetactivestats|wingetactivetitle|'
-             r'wingetclass|wingetpos|wingettext|'
-             r'wingettitle|winhide|winkill|'
-             r'winmaximize|winmenuselectitem|winminimize|'
-             r'winminimizeall|winminimizeallundo|winmove|'
-             r'winrestore|winset|winsettitle|'
-             r'winshow|winwait|winwaitactive|'
-             r'winwaitclose|winwaitnotactive'
-             r'true|false|NULL)\b', Keyword, 'command'),
-            ],
+        'dqs': [
+            (r'"', String, '#pop'),
+            include('strings')
+        ],
+        'garbage': [
+            (r'[^\S\n]', Text),
+            # (r'.', Text),      # no cheating
+        ],
+    }
 
-        }
 
 class MaqlLexer(RegexLexer):
     """
-    Lexer for `GoodData MAQL <https://secure.gooddata.com/docs/html/advanced.metric.tutorial.html>`_
+    Lexer for `GoodData MAQL
+    <https://secure.gooddata.com/docs/html/advanced.metric.tutorial.html>`_
     scripts.
 
     *New in Pygments 1.4.*
@@ -2784,7 +2394,7 @@ class HybrisLexer(RegexLexer):
             # method names
             (r'^(\s*(?:function|method|operator\s+)+?)'
              r'([a-zA-Z_][a-zA-Z0-9_]*)'
-             r'(\s*)(\()', bygroups(Name.Function, Text, Operator)),
+             r'(\s*)(\()', bygroups(Keyword, Name.Function, Text, Operator)),
             (r'[^\S\n]+', Text),
             (r'//.*?\n', Comment.Single),
             (r'/\*.*?\*/', Comment.Multiline),
@@ -2841,3 +2451,890 @@ class HybrisLexer(RegexLexer):
             (r'[a-zA-Z0-9_.]+\*?', Name.Namespace, '#pop')
         ],
     }
+
+
+class AwkLexer(RegexLexer):
+    """
+    For Awk scripts.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Awk'
+    aliases = ['awk', 'gawk', 'mawk', 'nawk']
+    filenames = ['*.awk']
+    mimetypes = ['application/x-awk']
+
+    tokens = {
+        'commentsandwhitespace': [
+            (r'\s+', Text),
+            (r'#.*$', Comment.Single)
+        ],
+        'slashstartsregex': [
+            include('commentsandwhitespace'),
+            (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
+             r'\B', String.Regex, '#pop'),
+            (r'(?=/)', Text, ('#pop', 'badregex')),
+            (r'', Text, '#pop')
+        ],
+        'badregex': [
+            (r'\n', Text, '#pop')
+        ],
+        'root': [
+            (r'^(?=\s|/)', Text, 'slashstartsregex'),
+            include('commentsandwhitespace'),
+            (r'\+\+|--|\|\||&&|in|\$|!?~|'
+             r'(\*\*|[-<>+*%\^/!=])=?', Operator, 'slashstartsregex'),
+            (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
+            (r'[})\].]', Punctuation),
+            (r'(break|continue|do|while|exit|for|if|'
+             r'return)\b', Keyword, 'slashstartsregex'),
+            (r'function\b', Keyword.Declaration, 'slashstartsregex'),
+            (r'(atan2|cos|exp|int|log|rand|sin|sqrt|srand|gensub|gsub|index|'
+             r'length|match|split|sprintf|sub|substr|tolower|toupper|close|'
+             r'fflush|getline|next|nextfile|print|printf|strftime|systime|'
+             r'delete|system)\b', Keyword.Reserved),
+            (r'(ARGC|ARGIND|ARGV|CONVFMT|ENVIRON|ERRNO|FIELDWIDTHS|FILENAME|FNR|FS|'
+             r'IGNORECASE|NF|NR|OFMT|OFS|ORFS|RLENGTH|RS|RSTART|RT|'
+             r'SUBSEP)\b', Name.Builtin),
+            (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),
+        ]
+    }
+
+
+class Cfengine3Lexer(RegexLexer):
+    """
+    Lexer for `CFEngine3 <http://cfengine.org>`_ policy files.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'CFEngine3'
+    aliases = ['cfengine3', 'cf3']
+    filenames = ['*.cf']
+    mimetypes = []
+
+    tokens = {
+        'root': [
+            (r'#.*?\n', Comment),
+            (r'(body)(\s+)(\S+)(\s+)(control)',
+             bygroups(Keyword, Text, Keyword, Text, Keyword)),
+            (r'(body|bundle)(\s+)(\S+)(\s+)(\w+)(\()',
+             bygroups(Keyword, Text, Keyword, Text, Name.Function, Punctuation),
+             'arglist'),
+            (r'(body|bundle)(\s+)(\S+)(\s+)(\w+)',
+             bygroups(Keyword, Text, Keyword, Text, Name.Function)),
+            (r'(")([^"]+)(")(\s+)(string|slist|int|real)(\s*)(=>)(\s*)',
+             bygroups(Punctuation,Name.Variable,Punctuation,
+                      Text,Keyword.Type,Text,Operator,Text)),
+            (r'(\S+)(\s*)(=>)(\s*)',
+             bygroups(Keyword.Reserved,Text,Operator,Text)),
+            (r'"', String, 'string'),
+            (r'(\w+)(\()', bygroups(Name.Function, Punctuation)),
+            (r'([\w.!&|\(\)]+)(::)', bygroups(Name.Class, Punctuation)),
+            (r'(\w+)(:)', bygroups(Keyword.Declaration,Punctuation)),
+            (r'@[\{\(][^\)\}]+[\}\)]', Name.Variable),
+            (r'[(){},;]', Punctuation),
+            (r'=>', Operator),
+            (r'->', Operator),
+            (r'\d+\.\d+', Number.Float),
+            (r'\d+', Number.Integer),
+            (r'\w+', Name.Function),
+            (r'\s+', Text),
+        ],
+        'string': [
+            (r'\$[\{\(]', String.Interpol, 'interpol'),
+            (r'\\.', String.Escape),
+            (r'"', String, '#pop'),
+            (r'\n', String),
+            (r'.', String),
+        ],
+        'interpol': [
+            (r'\$[\{\(]', String.Interpol, '#push'),
+            (r'[\}\)]', String.Interpol, '#pop'),
+            (r'[^\$\{\(\)\}]+', String.Interpol),
+        ],
+        'arglist': [
+            (r'\)', Punctuation, '#pop'),
+            (r',', Punctuation),
+            (r'\w+', Name.Variable),
+            (r'\s+', Text),
+        ],
+    }
+
+
+class SnobolLexer(RegexLexer):
+    """
+    Lexer for the SNOBOL4 programming language.
+
+    Recognizes the common ASCII equivalents of the original SNOBOL4 operators.
+    Does not require spaces around binary operators.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = "Snobol"
+    aliases = ["snobol"]
+    filenames = ['*.snobol']
+    mimetypes = ['text/x-snobol']
+
+    tokens = {
+        # root state, start of line
+        # comments, continuation lines, and directives start in column 1
+        # as do labels
+        'root': [
+            (r'\*.*\n', Comment),
+            (r'[\+\.] ', Punctuation, 'statement'),
+            (r'-.*\n', Comment),
+            (r'END\s*\n', Name.Label, 'heredoc'),
+            (r'[A-Za-z\$][\w$]*', Name.Label, 'statement'),
+            (r'\s+', Text, 'statement'),
+        ],
+        # statement state, line after continuation or label
+        'statement': [
+            (r'\s*\n', Text, '#pop'),
+            (r'\s+', Text),
+            (r'(?<=[^\w.])(LT|LE|EQ|NE|GE|GT|INTEGER|IDENT|DIFFER|LGT|SIZE|'
+             r'REPLACE|TRIM|DUPL|REMDR|DATE|TIME|EVAL|APPLY|OPSYN|LOAD|UNLOAD|'
+             r'LEN|SPAN|BREAK|ANY|NOTANY|TAB|RTAB|REM|POS|RPOS|FAIL|FENCE|'
+             r'ABORT|ARB|ARBNO|BAL|SUCCEED|INPUT|OUTPUT|TERMINAL)(?=[^\w.])',
+             Name.Builtin),
+            (r'[A-Za-z][\w\.]*', Name),
+            # ASCII equivalents of original operators
+            # | for the EBCDIC equivalent, ! likewise
+            # \ for EBCDIC negation
+            (r'\*\*|[\?\$\.!%\*/#+\-@\|&\\=]', Operator),
+            (r'"[^"]*"', String),
+            (r"'[^']*'", String),
+            # Accept SPITBOL syntax for real numbers
+            # as well as Macro SNOBOL4
+            (r'[0-9]+(?=[^\.EeDd])', Number.Integer),
+            (r'[0-9]+(\.[0-9]*)?([EDed][-+]?[0-9]+)?', Number.Float),
+            # Goto
+            (r':', Punctuation, 'goto'),
+            (r'[\(\)<>,;]', Punctuation),
+        ],
+        # Goto block
+        'goto': [
+            (r'\s*\n', Text, "#pop:2"),
+            (r'\s+', Text),
+            (r'F|S', Keyword),
+            (r'(\()([A-Za-z][\w.]*)(\))',
+             bygroups(Punctuation, Name.Label, Punctuation))
+        ],
+        # everything after the END statement is basically one
+        # big heredoc.
+        'heredoc': [
+            (r'.*\n', String.Heredoc)
+        ]
+    }
+
+
+class UrbiscriptLexer(ExtendedRegexLexer):
+    """
+    For UrbiScript source code.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'UrbiScript'
+    aliases = ['urbiscript']
+    filenames = ['*.u']
+    mimetypes = ['application/x-urbiscript']
+
+    flags = re.DOTALL
+
+    ## TODO
+    # - handle Experimental and deprecated tags with specific tokens
+    # - handle Angles and Durations with specific tokens
+
+    def blob_callback(lexer, match, ctx):
+        text_before_blob = match.group(1)
+        blob_start = match.group(2)
+        blob_size_str = match.group(3)
+        blob_size = int(blob_size_str)
+        yield match.start(), String, text_before_blob
+        ctx.pos += len(text_before_blob)
+
+        # if blob size doesn't match blob format (example : "\B(2)(aaa)")
+        # yield blob as a string
+        if ctx.text[match.end() + blob_size] != ")":
+            result = "\\B(" + blob_size_str + ")("
+            yield match.start(), String, result
+            ctx.pos += len(result)
+            return
+
+        # if blob is well formated, yield as Escape
+        blob_text = blob_start + ctx.text[match.end():match.end()+blob_size] + ")"
+        yield match.start(), String.Escape, blob_text
+        ctx.pos = match.end() + blob_size + 1 # +1 is the ending ")"
+
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            # comments
+            (r'//.*?\n', Comment),
+            (r'/\*', Comment.Multiline, 'comment'),
+            (r'(?:every|for|loop|while)(?:;|&|\||,)',Keyword),
+            (r'(?:assert|at|break|case|catch|closure|compl|continue|'
+             r'default|else|enum|every|external|finally|for|freezeif|if|new|'
+             r'onleave|return|stopif|switch|this|throw|timeout|try|'
+             r'waituntil|whenever|while)\b', Keyword),
+            (r'(?:asm|auto|bool|char|const_cast|delete|double|dynamic_cast|'
+             r'explicit|export|extern|float|friend|goto|inline|int|'
+             r'long|mutable|namespace|register|reinterpret_cast|short|'
+             r'signed|sizeof|static_cast|struct|template|typedef|typeid|'
+             r'typename|union|unsigned|using|virtual|volatile|'
+             r'wchar_t)\b', Keyword.Reserved),
+            # deprecated keywords, use a meaningfull token when available
+            (r'(?:emit|foreach|internal|loopn|static)\b', Keyword),
+            # ignored keywords, use a meaningfull token when available
+            (r'(?:private|protected|public)\b', Keyword),
+            (r'(?:var|do|const|function|class)\b', Keyword.Declaration),
+            (r'(?:true|false|nil|void)\b', Keyword.Constant),
+            (r'(?:Barrier|Binary|Boolean|CallMessage|Channel|Code|'
+             r'Comparable|Container|Control|Date|Dictionary|Directory|'
+             r'Duration|Enumeration|Event|Exception|Executable|File|Finalizable|'
+             r'Float|FormatInfo|Formatter|Global|Group|Hash|InputStream|'
+             r'IoService|Job|Kernel|Lazy|List|Loadable|Lobby|Location|Logger|Math|'
+             r'Mutex|nil|Object|Orderable|OutputStream|Pair|Path|Pattern|Position|'
+             r'Primitive|Process|Profile|PseudoLazy|PubSub|RangeIterable|Regexp|'
+             r'Semaphore|Server|Singleton|Socket|StackFrame|Stream|String|System|'
+             r'Tag|Timeout|Traceable|TrajectoryGenerator|Triplet|Tuple'
+             r'|UObject|UValue|UVar)\b', Name.Builtin),
+            (r'(?:this)\b', Name.Builtin.Pseudo),
+            # don't match single | and &
+            (r'(?:[-=+*%/<>~^:]+|\.&?|\|\||&&)', Operator),
+            (r'(?:and_eq|and|bitand|bitor|in|not|not_eq|or_eq|or|xor_eq|xor)\b',
+             Operator.Word),
+            (r'[{}\[\]()]+', Punctuation),
+            (r'(?:;|\||,|&|\?|!)+', Punctuation),
+            (r'[$a-zA-Z_][a-zA-Z0-9_]*', Name.Other),
+            (r'0x[0-9a-fA-F]+', Number.Hex),
+            # Float, Integer, Angle and Duration
+            (r'(?:[0-9]+(?:(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)?'
+             r'((?:rad|deg|grad)|(?:ms|s|min|h|d))?)\b', Number.Float),
+            # handle binary blob in strings
+            (r'"', String.Double, "string.double"),
+            (r"'", String.Single, "string.single"),
+        ],
+        'string.double': [
+            (r'((?:\\\\|\\"|[^"])*?)(\\B\((\d+)\)\()', blob_callback),
+            (r'(\\\\|\\"|[^"])*?"', String.Double, '#pop'),
+        ],
+        'string.single': [
+            (r"((?:\\\\|\\'|[^'])*?)(\\B\((\d+)\)\()", blob_callback),
+            (r"(\\\\|\\'|[^'])*?'", String.Single, '#pop'),
+        ],
+        # from http://pygments.org/docs/lexerdevelopment/#changing-states
+        'comment': [
+            (r'[^*/]', Comment.Multiline),
+            (r'/\*', Comment.Multiline, '#push'),
+            (r'\*/', Comment.Multiline, '#pop'),
+            (r'[*/]', Comment.Multiline),
+        ]
+    }
+
+
+class OpenEdgeLexer(RegexLexer):
+    """
+    Lexer for `OpenEdge ABL (formerly Progress)
+    <http://web.progress.com/en/openedge/abl.html>`_ source code.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'OpenEdge ABL'
+    aliases = ['openedge', 'abl', 'progress']
+    filenames = ['*.p', '*.cls']
+    mimetypes = ['text/x-openedge', 'application/x-openedge']
+
+    types = (r'(?i)(^|(?<=[^0-9a-z_\-]))(CHARACTER|CHAR|CHARA|CHARAC|CHARACT|CHARACTE|'
+             r'COM-HANDLE|DATE|DATETIME|DATETIME-TZ|'
+             r'DECIMAL|DEC|DECI|DECIM|DECIMA|HANDLE|'
+             r'INT64|INTEGER|INT|INTE|INTEG|INTEGE|'
+             r'LOGICAL|LONGCHAR|MEMPTR|RAW|RECID|ROWID)\s*($|(?=[^0-9a-z_\-]))')
+
+    keywords = (r'(?i)(^|(?<=[^0-9a-z_\-]))(ABSOLUTE|ABS|ABSO|ABSOL|ABSOLU|ABSOLUT|ACCELERATOR|'
+                r'ACCUM|ACCUMULATE|ACCUM|ACCUMU|ACCUMUL|ACCUMULA|ACCUMULAT|'
+                r'ACTIVE-FORM|ACTIVE-WINDOW|ADD|ADD-BUFFER|'
+                r'ADD-CALC-COLUMN|ADD-COLUMNS-FROM|ADD-EVENTS-PROCEDURE|'
+                r'ADD-FIELDS-FROM|ADD-FIRST|ADD-INDEX-FIELD|ADD-LAST|'
+                r'ADD-LIKE-COLUMN|ADD-LIKE-FIELD|ADD-LIKE-INDEX|'
+                r'ADD-NEW-FIELD|ADD-NEW-INDEX|ADD-SCHEMA-LOCATION|ADD-SUPER-PROCEDURE|'
+                r'ADM-DATA|ADVISE|ALERT-BOX|ALIAS|ALL|ALLOW-COLUMN-SEARCHING|'
+                r'ALLOW-REPLICATION|ALTER|ALWAYS-ON-TOP|AMBIGUOUS|AMBIG|AMBIGU|AMBIGUO|AMBIGUOU|'
+                r'ANALYZE|ANALYZ|AND|ANSI-ONLY|ANY|ANYWHERE|APPEND|APPL-ALERT-BOXES|'
+                r'APPL-ALERT|APPL-ALERT-|APPL-ALERT-B|APPL-ALERT-BO|APPL-ALERT-BOX|APPL-ALERT-BOXE|'
+                r'APPL-CONTEXT-ID|APPLICATION|APPLY|APPSERVER-INFO|APPSERVER-PASSWORD|'
+                r'APPSERVER-USERID|ARRAY-MESSAGE|AS|ASC|ASCENDING|ASCE|ASCEN|'
+                r'ASCEND|ASCENDI|ASCENDIN|ASK-OVERWRITE|ASSEMBLY|ASSIGN|'
+                r'ASYNCHRONOUS|ASYNC-REQUEST-COUNT|ASYNC-REQUEST-HANDLE|AT|'
+                r'ATTACHED-PAIRLIST|ATTR-SPACE|ATTR|ATTRI|ATTRIB|ATTRIBU|ATTRIBUT|'
+                r'AUDIT-CONTROL|AUDIT-ENABLED|AUDIT-EVENT-CONTEXT|AUDIT-POLICY|'
+                r'AUTHENTICATION-FAILED|AUTHORIZATION|AUTO-COMPLETION|AUTO-COMP|'
+                r'AUTO-COMPL|AUTO-COMPLE|AUTO-COMPLET|AUTO-COMPLETI|AUTO-COMPLETIO|'
+                r'AUTO-ENDKEY|AUTO-END-KEY|AUTO-GO|AUTO-INDENT|AUTO-IND|'
+                r'AUTO-INDE|AUTO-INDEN|AUTOMATIC|AUTO-RESIZE|AUTO-RETURN|AUTO-RET|'
+                r'AUTO-RETU|AUTO-RETUR|AUTO-SYNCHRONIZE|AUTO-ZAP|AUTO-Z|AUTO-ZA|'
+                r'AVAILABLE|AVAIL|AVAILA|AVAILAB|AVAILABL|AVAILABLE-FORMATS|'
+                r'AVERAGE|AVE|AVER|AVERA|AVERAG|AVG|BACKGROUND|BACK|BACKG|'
+                r'BACKGR|BACKGRO|BACKGROU|BACKGROUN|BACKWARDS|BACKWARD|'
+                r'BASE64-DECODE|BASE64-ENCODE|BASE-ADE|BASE-KEY|BATCH-MODE|BATCH|'
+                r'BATCH-|BATCH-M|BATCH-MO|BATCH-MOD|BATCH-SIZE|BEFORE-HIDE|BEFORE-H|'
+                r'BEFORE-HI|BEFORE-HID|BEGIN-EVENT-GROUP|BEGINS|BELL|BETWEEN|'
+                r'BGCOLOR|BGC|BGCO|BGCOL|BGCOLO|BIG-ENDIAN|BINARY|BIND|BIND-WHERE|'
+                r'BLANK|BLOCK-ITERATION-DISPLAY|BORDER-BOTTOM-CHARS|BORDER-B|'
+                r'BORDER-BO|BORDER-BOT|BORDER-BOTT|BORDER-BOTTO|BORDER-BOTTOM-PIXELS|'
+                r'BORDER-BOTTOM-P|BORDER-BOTTOM-PI|BORDER-BOTTOM-PIX|'
+                r'BORDER-BOTTOM-PIXE|BORDER-BOTTOM-PIXEL|BORDER-LEFT-CHARS|BORDER-L|'
+                r'BORDER-LE|BORDER-LEF|BORDER-LEFT|BORDER-LEFT-|BORDER-LEFT-C|'
+                r'BORDER-LEFT-CH|BORDER-LEFT-CHA|BORDER-LEFT-CHAR|BORDER-LEFT-PIXELS|'
+                r'BORDER-LEFT-P|BORDER-LEFT-PI|BORDER-LEFT-PIX|BORDER-LEFT-PIXE|'
+                r'BORDER-LEFT-PIXEL|BORDER-RIGHT-CHARS|BORDER-R|BORDER-RI|BORDER-RIG|'
+                r'BORDER-RIGH|BORDER-RIGHT|BORDER-RIGHT-|BORDER-RIGHT-C|BORDER-RIGHT-CH|'
+                r'BORDER-RIGHT-CHA|BORDER-RIGHT-CHAR|BORDER-RIGHT-PIXELS|BORDER-RIGHT-P|'
+                r'BORDER-RIGHT-PI|BORDER-RIGHT-PIX|BORDER-RIGHT-PIXE|BORDER-RIGHT-PIXEL|'
+                r'BORDER-TOP-CHARS|BORDER-T|BORDER-TO|BORDER-TOP|BORDER-TOP-|BORDER-TOP-C|'
+                r'BORDER-TOP-CH|BORDER-TOP-CHA|BORDER-TOP-CHAR|BORDER-TOP-PIXELS|'
+                r'BORDER-TOP-P|BORDER-TOP-PI|BORDER-TOP-PIX|BORDER-TOP-PIXE|BORDER-TOP-PIXEL|'
+                r'BOX|BOX-SELECTABLE|BOX-SELECT|BOX-SELECTA|BOX-SELECTAB|BOX-SELECTABL|'
+                r'BREAK|BROWSE|BUFFER|BUFFER-CHARS|BUFFER-COMPARE|BUFFER-COPY|BUFFER-CREATE|'
+                r'BUFFER-DELETE|BUFFER-FIELD|BUFFER-HANDLE|BUFFER-LINES|BUFFER-NAME|'
+                r'BUFFER-RELEASE|BUFFER-VALUE|BUTTON|BUTTONS|BUTTON|BY|BY-POINTER|'
+                r'BY-VARIANT-POINTER|CACHE|CACHE-SIZE|CALL|CALL-NAME|CALL-TYPE|CANCEL-BREAK|'
+                r'CANCEL-BUTTON|CAN-CREATE|CAN-DELETE|CAN-DO|CAN-FIND|CAN-QUERY|CAN-READ|'
+                r'CAN-SET|CAN-WRITE|CAPS|CAREFUL-PAINT|CASE|CASE-SENSITIVE|CASE-SEN|'
+                r'CASE-SENS|CASE-SENSI|CASE-SENSIT|CASE-SENSITI|CASE-SENSITIV|'
+                r'CAST|CATCH|CDECL|CENTERED|CENTER|CENTERE|CHAINED|CHARACTER_LENGTH|'
+                r'CHARSET|CHECK|CHECKED|CHOOSE|CHR|CLASS|CLASS-TYPE|CLEAR|'
+                r'CLEAR-APPL-CONTEXT|CLEAR-LOG|CLEAR-SELECTION|CLEAR-SELECT|'
+                r'CLEAR-SELECTI|CLEAR-SELECTIO|CLEAR-SORT-ARROWS|CLEAR-SORT-ARROW|'
+                r'CLIENT-CONNECTION-ID|CLIENT-PRINCIPAL|CLIENT-TTY|CLIENT-TYPE|'
+                r'CLIENT-WORKSTATION|CLIPBOARD|CLOSE|CLOSE-LOG|CODE|CODEBASE-LOCATOR|'
+                r'CODEPAGE|CODEPAGE-CONVERT|COLLATE|COL-OF|COLON|COLON-ALIGNED|'
+                r'COLON-ALIGN|COLON-ALIGNE|COLOR|COLOR-TABLE|COLUMN|COL|COLU|COLUM|'
+                r'COLUMN-BGCOLOR|COLUMN-DCOLOR|COLUMN-FGCOLOR|COLUMN-FONT|COLUMN-LABEL|'
+                r'COLUMN-LAB|COLUMN-LABE|COLUMN-MOVABLE|COLUMN-OF|COLUMN-PFCOLOR|'
+                r'COLUMN-READ-ONLY|COLUMN-RESIZABLE|COLUMNS|COLUMN-SCROLLING|'
+                r'COMBO-BOX|COMMAND|COMPARES|COMPILE|COMPILER|COMPLETE|COM-SELF|'
+                r'CONFIG-NAME|CONNECT|CONNECTED|CONSTRUCTOR|CONTAINS|CONTENTS|CONTEXT|'
+                r'CONTEXT-HELP|CONTEXT-HELP-FILE|CONTEXT-HELP-ID|CONTEXT-POPUP|'
+                r'CONTROL|CONTROL-BOX|CONTROL-FRAME|CONVERT|CONVERT-3D-COLORS|'
+                r'CONVERT-TO-OFFSET|CONVERT-TO-OFFS|CONVERT-TO-OFFSE|COPY-DATASET|'
+                r'COPY-LOB|COPY-SAX-ATTRIBUTES|COPY-TEMP-TABLE|COUNT|COUNT-OF|'
+                r'CPCASE|CPCOLL|CPINTERNAL|CPLOG|CPPRINT|CPRCODEIN|CPRCODEOUT|'
+                r'CPSTREAM|CPTERM|CRC-VALUE|CREATE|CREATE-LIKE|CREATE-LIKE-SEQUENTIAL|'
+                r'CREATE-NODE-NAMESPACE|CREATE-RESULT-LIST-ENTRY|CREATE-TEST-FILE|'
+                r'CURRENT|CURRENT_DATE|CURRENT_DATE|CURRENT-CHANGED|CURRENT-COLUMN|'
+                r'CURRENT-ENVIRONMENT|CURRENT-ENV|CURRENT-ENVI|CURRENT-ENVIR|'
+                r'CURRENT-ENVIRO|CURRENT-ENVIRON|CURRENT-ENVIRONM|CURRENT-ENVIRONME|'
+                r'CURRENT-ENVIRONMEN|CURRENT-ITERATION|CURRENT-LANGUAGE|CURRENT-LANG|'
+                r'CURRENT-LANGU|CURRENT-LANGUA|CURRENT-LANGUAG|CURRENT-QUERY|'
+                r'CURRENT-RESULT-ROW|CURRENT-ROW-MODIFIED|CURRENT-VALUE|CURRENT-WINDOW|'
+                r'CURSOR|CURS|CURSO|CURSOR-CHAR|CURSOR-LINE|CURSOR-OFFSET|DATABASE|'
+                r'DATA-BIND|DATA-ENTRY-RETURN|DATA-ENTRY-RET|DATA-ENTRY-RETU|'
+                r'DATA-ENTRY-RETUR|DATA-RELATION|DATA-REL|DATA-RELA|DATA-RELAT|'
+                r'DATA-RELATI|DATA-RELATIO|DATASERVERS|DATASET|DATASET-HANDLE|DATA-SOURCE|'
+                r'DATA-SOURCE-COMPLETE-MAP|DATA-SOURCE-MODIFIED|DATA-SOURCE-ROWID|'
+                r'DATA-TYPE|DATA-T|DATA-TY|DATA-TYP|DATE-FORMAT|DATE-F|DATE-FO|'
+                r'DATE-FOR|DATE-FORM|DATE-FORMA|DAY|DBCODEPAGE|DBCOLLATION|DBNAME|'
+                r'DBPARAM|DB-REFERENCES|DBRESTRICTIONS|DBREST|DBRESTR|DBRESTRI|'
+                r'DBRESTRIC|DBRESTRICT|DBRESTRICTI|DBRESTRICTIO|DBRESTRICTION|'
+                r'DBTASKID|DBTYPE|DBVERSION|DBVERS|DBVERSI|DBVERSIO|DCOLOR|'
+                r'DDE|DDE-ERROR|DDE-ID|DDE-I|DDE-ITEM|DDE-NAME|DDE-TOPIC|DEBLANK|'
+                r'DEBUG|DEBU|DEBUG-ALERT|DEBUGGER|DEBUG-LIST|DECIMALS|DECLARE|'
+                r'DECLARE-NAMESPACE|DECRYPT|DEFAULT|DEFAULT-BUFFER-HANDLE|'
+                r'DEFAULT-BUTTON|DEFAUT-B|DEFAUT-BU|DEFAUT-BUT|DEFAUT-BUTT|DEFAUT-BUTTO|'
+                r'DEFAULT-COMMIT|DEFAULT-EXTENSION|DEFAULT-EX|DEFAULT-EXT|DEFAULT-EXTE|'
+                r'DEFAULT-EXTEN|DEFAULT-EXTENS|DEFAULT-EXTENSI|DEFAULT-EXTENSIO|'
+                r'DEFAULT-NOXLATE|DEFAULT-NOXL|DEFAULT-NOXLA|DEFAULT-NOXLAT|'
+                r'DEFAULT-VALUE|DEFAULT-WINDOW|DEFINED|'
+                r'DEFINE-USER-EVENT-MANAGER|DELETE|DEL|DELE|DELET|DELETE-CHARACTER|'
+                r'DELETE-CHAR|DELETE-CHARA|DELETE-CHARAC|DELETE-CHARACT|DELETE-CHARACTE|'
+                r'DELETE-CURRENT-ROW|DELETE-LINE|DELETE-RESULT-LIST-ENTRY|DELETE-SELECTED-ROW|'
+                r'DELETE-SELECTED-ROWS|DELIMITER|DESC|DESCENDING|DESC|DESCE|DESCEN|'
+                r'DESCEND|DESCENDI|DESCENDIN|DESELECT-FOCUSED-ROW|DESELECTION|'
+                r'DESELECT-ROWS|DESELECT-SELECTED-ROW|DESTRUCTOR|DIALOG-BOX|'
+                r'DICTIONARY|DICT|DICTI|DICTIO|DICTION|DICTIONA|DICTIONAR|'
+                r'DIR|DISABLE|DISABLE-AUTO-ZAP|DISABLED|DISABLE-DUMP-TRIGGERS|'
+                r'DISABLE-LOAD-TRIGGERS|DISCONNECT|DISCON|DISCONN|DISCONNE|DISCONNEC|'
+                r'DISP|DISPLAY|DISP|DISPL|DISPLA|DISPLAY-MESSAGE|DISPLAY-TYPE|'
+                r'DISPLAY-T|DISPLAY-TY|DISPLAY-TYP|DISTINCT|DO|DOMAIN-DESCRIPTION|'
+                r'DOMAIN-NAME|DOMAIN-TYPE|DOS|DOUBLE|DOWN|DRAG-ENABLED|DROP|DROP-DOWN|'
+                r'DROP-DOWN-LIST|DROP-FILE-NOTIFY|DROP-TARGET|DUMP|DYNAMIC|'
+                r'DYNAMIC-FUNCTION|EACH|ECHO|EDGE-CHARS|EDGE|EDGE-|EDGE-C|'
+                r'EDGE-CH|EDGE-CHA|EDGE-CHAR|EDGE-PIXELS|EDGE-P|EDGE-PI|EDGE-PIX|'
+                r'EDGE-PIXE|EDGE-PIXEL|EDIT-CAN-PASTE|EDIT-CAN-UNDO|EDIT-CLEAR|'
+                r'EDIT-COPY|EDIT-CUT|EDITING|EDITOR|EDIT-PASTE|EDIT-UNDO|ELSE|'
+                r'EMPTY|EMPTY-TEMP-TABLE|ENABLE|ENABLED-FIELDS|ENCODE|ENCRYPT|'
+                r'ENCRYPT-AUDIT-MAC-KEY|ENCRYPTION-SALT|END|END-DOCUMENT|'
+                r'END-ELEMENT|END-EVENT-GROUP|END-FILE-DROP|ENDKEY|END-KEY|'
+                r'END-MOVE|END-RESIZE|END-ROW-RESIZE|END-USER-PROMPT|ENTERED|'
+                r'ENTRY|EQ|ERROR|ERROR-COLUMN|ERROR-COL|ERROR-COLU|ERROR-COLUM|'
+                r'ERROR-ROW|ERROR-STACK-TRACE|ERROR-STATUS|ERROR-STAT|ERROR-STATU|'
+                r'ESCAPE|ETIME|EVENT-GROUP-ID|EVENT-PROCEDURE|EVENT-PROCEDURE-CONTEXT|'
+                r'EVENTS|EVENT|EVENT-TYPE|EVENT-T|EVENT-TY|EVENT-TYP|EXCEPT|'
+                r'EXCLUSIVE-ID|EXCLUSIVE-LOCK|EXCLUSIVE|EXCLUSIVE-|EXCLUSIVE-L|'
+                r'EXCLUSIVE-LO|EXCLUSIVE-LOC|EXCLUSIVE-WEB-USER|EXECUTE|EXISTS|'
+                r'EXP|EXPAND|EXPANDABLE|EXPLICIT|EXPORT|EXPORT-PRINCIPAL|EXTENDED|'
+                r'EXTENT|EXTERNAL|FALSE|FETCH|FETCH-SELECTED-ROW|FGCOLOR|FGC|FGCO|'
+                r'FGCOL|FGCOLO|FIELD|FIELDS|FIELD|FILE|FILE-CREATE-DATE|'
+                r'FILE-CREATE-TIME|FILE-INFORMATION|FILE-INFO|FILE-INFOR|FILE-INFORM|'
+                r'FILE-INFORMA|FILE-INFORMAT|FILE-INFORMATI|FILE-INFORMATIO|FILE-MOD-DATE|'
+                r'FILE-MOD-TIME|FILENAME|FILE-NAME|FILE-OFFSET|FILE-OFF|FILE-OFFS|FILE-OFFSE|'
+                r'FILE-SIZE|FILE-TYPE|FILL|FILLED|FILL-IN|FILTERS|FINAL|FINALLY|FIND|'
+                r'FIND-BY-ROWID|FIND-CASE-SENSITIVE|FIND-CURRENT|FINDER|FIND-FIRST|'
+                r'FIND-GLOBAL|FIND-LAST|FIND-NEXT-OCCURRENCE|FIND-PREV-OCCURRENCE|'
+                r'FIND-SELECT|FIND-UNIQUE|FIND-WRAP-AROUND|FIRST|FIRST-ASYNCH-REQUEST|'
+                r'FIRST-CHILD|FIRST-COLUMN|FIRST-FORM|FIRST-OBJECT|FIRST-OF|'
+                r'FIRST-PROCEDURE|FIRST-PROC|FIRST-PROCE|FIRST-PROCED|FIRST-PROCEDU|FIRST-PROCEDUR|'
+                r'FIRST-SERVER|FIRST-TAB-ITEM|FIRST-TAB-I|FIRST-TAB-IT|FIRST-TAB-ITE|'
+                r'FIT-LAST-COLUMN|FIXED-ONLY|FLAT-BUTTON|FLOAT|FOCUS|FOCUSED-ROW|'
+                r'FOCUSED-ROW-SELECTED|FONT|FONT-TABLE|FOR|FORCE-FILE|'
+                r'FOREGROUND|FORE|FOREG|FOREGR|FOREGRO|FOREGROU|FOREGROUN|'
+                r'FORM|FORMAT|FORM|FORMA|FORMATTED|FORMATTE|FORM-LONG-INPUT|'
+                r'FORWARD|FORWARDS|FORWARD|FRAGMENT|FRAGMEN|FRAME|FRAM|'
+                r'FRAME-COL|FRAME-DB|FRAME-DOWN|FRAME-FIELD|FRAME-FILE|'
+                r'FRAME-INDEX|FRAME-INDE|FRAME-LINE|FRAME-NAME|FRAME-ROW|'
+                r'FRAME-SPACING|FRAME-SPA|FRAME-SPAC|FRAME-SPACI|FRAME-SPACIN|'
+                r'FRAME-VALUE|FRAME-VAL|FRAME-VALU|FRAME-X|FRAME-Y|FREQUENCY|FROM|'
+                r'FROM-CHARS|FROM-C|FROM-CH|FROM-CHA|FROM-CHAR|'
+                r'FROM-CURRENT|FROM-CUR|FROM-CURR|FROM-CURRE|FROM-CURREN|'
+                r'FROM-PIXELS|FROM-P|FROM-PI|FROM-PIX|FROM-PIXE|FROM-PIXEL|'
+                r'FULL-HEIGHT-CHARS|FULL-HEIGHT|FULL-HEIGHT-|FULL-HEIGHT-C|FULL-HEIGHT-CH|FULL-HEIGHT-CHA|FULL-HEIGHT-CHAR|'
+                r'FULL-HEIGHT-PIXELS|FULL-HEIGHT-P|FULL-HEIGHT-PI|FULL-HEIGHT-PIX|FULL-HEIGHT-PIXE|FULL-HEIGHT-PIXEL|'
+                r'FULL-PATHNAME|FULL-PATHN|FULL-PATHNA|FULL-PATHNAM|'
+                r'FULL-WIDTH-CHARS|FULL-WIDTH|FULL-WIDTH-|FULL-WIDTH-C|FULL-WIDTH-CH|FULL-WIDTH-CHA|FULL-WIDTH-CHAR|'
+                r'FULL-WIDTH-PIXELS|FULL-WIDTH-P|FULL-WIDTH-PI|FULL-WIDTH-PIX|FULL-WIDTH-PIXE|FULL-WIDTH-PIXEL|'
+                r'FUNCTION|FUNCTION-CALL-TYPE|GATEWAYS|GATEWAY|GE|GENERATE-MD5|'
+                r'GENERATE-PBE-KEY|GENERATE-PBE-SALT|GENERATE-RANDOM-KEY|GENERATE-UUID|GET|'
+                r'GET-ATTR-CALL-TYPE|GET-ATTRIBUTE-NODE|GET-BINARY-DATA|'
+                r'GET-BLUE-VALUE|GET-BLUE|GET-BLUE-|GET-BLUE-V|GET-BLUE-VA|GET-BLUE-VAL|GET-BLUE-VALU|'
+                r'GET-BROWSE-COLUMN|GET-BUFFER-HANDLEGETBYTE|GET-BYTE|GET-CALLBACK-PROC-CONTEXT|'
+                r'GET-CALLBACK-PROC-NAME|GET-CGI-LIST|GET-CGI-LONG-VALUE|GET-CGI-VALUE|'
+                r'GET-CODEPAGES|GET-COLLATIONS|GET-CONFIG-VALUE|GET-CURRENT|GET-DOUBLE|'
+                r'GET-DROPPED-FILE|GET-DYNAMIC|GET-ERROR-COLUMN|GET-ERROR-ROW|GET-FILE|'
+                r'GET-FILE-NAME|GET-FILE-OFFSET|GET-FILE-OFFSE|GET-FIRST|GET-FLOAT|'
+                r'GET-GREEN-VALUE|GET-GREEN|GET-GREEN-|GET-GREEN-V|GET-GREEN-VA|GET-GREEN-VAL|GET-GREEN-VALU|'
+                r'GET-INDEX-BY-NAMESPACE-NAME|GET-INDEX-BY-QNAME|GET-INT64|GET-ITERATION|'
+                r'GET-KEY-VALUE|GET-KEY-VAL|GET-KEY-VALU|GET-LAST|GET-LOCALNAME-BY-INDEX|'
+                r'GET-LONG|GET-MESSAGE|GET-NEXT|GET-NUMBER|GET-POINTER-VALUE|'
+                r'GET-PREV|GET-PRINTERS|GET-PROPERTY|GET-QNAME-BY-INDEX|'
+                r'GET-RED-VALUE|GET-RED|GET-RED-|GET-RED-V|GET-RED-VA|GET-RED-VAL|GET-RED-VALU|'
+                r'GET-REPOSITIONED-ROW|GET-RGB-VALUE|'
+                r'GET-SELECTED-WIDGET|GET-SELECTED|GET-SELECTED-|GET-SELECTED-W|GET-SELECTED-WI|GET-SELECTED-WID|GET-SELECTED-WIDG|GET-SELECTED-WIDGE|'
+                r'GET-SHORT|GET-SIGNATURE|GET-SIZE|GET-STRING|GET-TAB-ITEM|'
+                r'GET-TEXT-HEIGHT-CHARS|GET-TEXT-HEIGHT|GET-TEXT-HEIGHT-|GET-TEXT-HEIGHT-C|GET-TEXT-HEIGHT-CH|GET-TEXT-HEIGHT-CHA|GET-TEXT-HEIGHT-CHAR|'
+                r'GET-TEXT-HEIGHT-PIXELS|GET-TEXT-HEIGHT-P|GET-TEXT-HEIGHT-PI|GET-TEXT-HEIGHT-PIX|GET-TEXT-HEIGHT-PIXE|GET-TEXT-HEIGHT-PIXEL|'
+                r'GET-TEXT-WIDTH-CHARS|GET-TEXT-WIDTH|GET-TEXT-WIDTH-|GET-TEXT-WIDTH-C|GET-TEXT-WIDTH-CH|GET-TEXT-WIDTH-CHA|GET-TEXT-WIDTH-CHAR|'
+                r'GET-TEXT-WIDTH-PIXELS|GET-TEXT-WIDTH-P|GET-TEXT-WIDTH-PI|GET-TEXT-WIDTH-PIX|GET-TEXT-WIDTH-PIXE|GET-TEXT-WIDTH-PIXEL|'
+                r'GET-TYPE-BY-INDEX|GET-TYPE-BY-NAMESPACE-NAME|GET-TYPE-BY-QNAME|GET-UNSIGNED-LONG|'
+                r'GET-UNSIGNED-SHORT|GET-URI-BY-INDEX|GET-VALUE-BY-INDEX|GET-VALUE-BY-NAMESPACE-NAME|'
+                r'GET-VALUE-BY-QNAME|GET-WAIT-STATE|GLOBAL|GO-ON|'
+                r'GO-PENDING|GO-PEND|GO-PENDI|GO-PENDIN|GRANT|'
+                r'GRAPHIC-EDGE|GRAPHIC-E|GRAPHIC-ED|GRAPHIC-EDG|'
+                r'GRID-FACTOR-HORIZONTAL|GRID-FACTOR-H|GRID-FACTOR-HO|GRID-FACTOR-HOR|GRID-FACTOR-HORI|GRID-FACTOR-HORIZ|GRID-FACTOR-HORIZO|GRID-FACTOR-HORIZON|GRID-FACTOR-HORIZONT|GRID-FACTOR-HORIZONTA|'
+                r'GRID-FACTOR-VERTICAL|GRID-FACTOR-V|GRID-FACTOR-VE|GRID-FACTOR-VER|GRID-FACTOR-VERT|GRID-FACTOR-VERT|GRID-FACTOR-VERTI|GRID-FACTOR-VERTIC|GRID-FACTOR-VERTICA|'
+                r'GRID-SNAP|'
+                r'GRID-UNIT-HEIGHT-CHARS|GRID-UNIT-HEIGHT|GRID-UNIT-HEIGHT-|GRID-UNIT-HEIGHT-C|GRID-UNIT-HEIGHT-CH|GRID-UNIT-HEIGHT-CHA|'
+                r'GRID-UNIT-HEIGHT-PIXELS|GRID-UNIT-HEIGHT-P|GRID-UNIT-HEIGHT-PI|GRID-UNIT-HEIGHT-PIX|GRID-UNIT-HEIGHT-PIXE|GRID-UNIT-HEIGHT-PIXEL|'
+                r'GRID-UNIT-WIDTH-CHARS|GRID-UNIT-WIDTH|GRID-UNIT-WIDTH-|GRID-UNIT-WIDTH-C|GRID-UNIT-WIDTH-CH|GRID-UNIT-WIDTH-CHA|GRID-UNIT-WIDTH-CHAR|'
+                r'GRID-UNIT-WIDTH-PIXELS|GRID-UNIT-WIDTH-P|GRID-UNIT-WIDTH-PI|GRID-UNIT-WIDTH-PIX|GRID-UNIT-WIDTH-PIXE|GRID-UNIT-WIDTH-PIXEL|'
+                r'GRID-VISIBLE|GROUP|GT|GUID|HANDLER|HAS-RECORDS|HAVING|HEADER|'
+                r'HEIGHT-CHARS|HEIGHT|HEIGHT-|HEIGHT-C|HEIGHT-CH|HEIGHT-CHA|HEIGHT-CHAR|'
+                r'HEIGHT-PIXELS|HEIGHT-P|HEIGHT-PI|HEIGHT-PIX|HEIGHT-PIXE|HEIGHT-PIXEL|'
+                r'HELP|HEX-DECODE|HEX-ENCODE|HIDDEN|HIDE|'
+                r'HORIZONTAL|HORI|HORIZ|HORIZO|HORIZON|HORIZONT|HORIZONTA|'
+                r'HOST-BYTE-ORDER|HTML-CHARSET|HTML-END-OF-LINE|HTML-END-OF-PAGE|'
+                r'HTML-FRAME-BEGIN|HTML-FRAME-END|HTML-HEADER-BEGIN|HTML-HEADER-END|'
+                r'HTML-TITLE-BEGIN|HTML-TITLE-END|HWND|ICON|IF|'
+                r'IMAGE|IMAGE-DOWN|IMAGE-INSENSITIVE|IMAGE-SIZE|'
+                r'IMAGE-SIZE-CHARS|IMAGE-SIZE-C|IMAGE-SIZE-CH|IMAGE-SIZE-CHA|IMAGE-SIZE-CHAR|'
+                r'IMAGE-SIZE-PIXELS|IMAGE-SIZE-P|IMAGE-SIZE-PI|IMAGE-SIZE-PIX|IMAGE-SIZE-PIXE|IMAGE-SIZE-PIXEL|'
+                r'IMAGE-UP|IMMEDIATE-DISPLAY|IMPLEMENTS|IMPORT|IMPORT-PRINCIPAL|'
+                r'IN|INCREMENT-EXCLUSIVE-ID|INDEX|INDEXED-REPOSITION|INDEX-HINT|'
+                r'INDEX-INFORMATION|INDICATOR|'
+                r'INFORMATION|INFO|INFOR|INFORM|INFORMA|INFORMAT|INFORMATI|INFORMATIO|'
+                r'IN-HANDLE|'
+                r'INHERIT-BGCOLOR|INHERIT-BGC|INHERIT-BGCO|INHERIT-BGCOL|INHERIT-BGCOLO|'
+                r'INHERIT-FGCOLOR|INHERIT-FGC|INHERIT-FGCO|INHERIT-FGCOL|INHERIT-FGCOLO|'
+                r'INHERITS|INITIAL|INIT|INITI|INITIA|INITIAL-DIR|INITIAL-FILTER|'
+                r'INITIALIZE-DOCUMENT-TYPE|INITIATE|INNER-CHARS|INNER-LINES|INPUT|'
+                r'INPUT-OUTPUT|INPUT-O|INPUT-OU|INPUT-OUT|INPUT-OUTP|INPUT-OUTPU|'
+                r'INPUT-VALUE|INSERT|INSERT-ATTRIBUTE|'
+                r'INSERT-BACKTAB|INSERT-B|INSERT-BA|INSERT-BAC|INSERT-BACK|INSERT-BACKT|INSERT-BACKTA|'
+                r'INSERT-FILE|INSERT-ROW|INSERT-STRING|INSERT-TAB|INSERT-T|INSERT-TA|'
+                r'INTERFACE|INTERNAL-ENTRIES|INTO|INVOKE|IS|'
+                r'IS-ATTR-SPACE|IS-ATTR|IS-ATTR-|IS-ATTR-S|IS-ATTR-SP|IS-ATTR-SPA|IS-ATTR-SPAC|'
+                r'IS-CLASS|IS-CLAS|IS-LEAD-BYTE|IS-ATTR|IS-OPEN|IS-PARAMETER-SET|IS-ROW-SELECTED|'
+                r'IS-SELECTED|ITEM|ITEMS-PER-ROW|JOIN|JOIN-BY-SQLDB|KBLABEL|KEEP-CONNECTION-OPEN|'
+                r'KEEP-FRAME-Z-ORDER|KEEP-FRAME-Z|KEEP-FRAME-Z-|KEEP-FRAME-Z-O|KEEP-FRAME-Z-OR|KEEP-FRAME-Z-ORD|KEEP-FRAME-Z-ORDE|'
+                r'KEEP-MESSAGES|KEEP-SECURITY-CACHE|KEEP-TAB-ORDER|KEY|KEYCODE|KEY-CODE|'
+                r'KEYFUNCTION|KEYFUNC|KEYFUNCT|KEYFUNCTI|KEYFUNCTIO|'
+                r'KEY-FUNCTION|KEY-FUNC|KEY-FUNCT|KEY-FUNCTI|KEY-FUNCTIO|'
+                r'KEYLABEL|KEY-LABEL|KEYS|KEYWORD|KEYWORD-ALL|LABEL|'
+                r'LABEL-BGCOLOR|LABEL-BGC|LABEL-BGCO|LABEL-BGCOL|LABEL-BGCOLO|'
+                r'LABEL-DCOLOR|LABEL-DC|LABEL-DCO|LABEL-DCOL|LABEL-DCOLO|'
+                r'LABEL-FGCOLOR|LABEL-FGC|LABEL-FGCO|LABEL-FGCOL|LABEL-FGCOLO|'
+                r'LABEL-FONT|'
+                r'LABEL-PFCOLOR|LABEL-PFC|LABEL-PFCO|LABEL-PFCOL|LABEL-PFCOLO|'
+                r'LABELS|LANDSCAPE|LANGUAGES|LANGUAGE|LARGE|LARGE-TO-SMALL|LAST|'
+                r'LAST-ASYNCH-REQUEST|LAST-BATCH|LAST-CHILD|LAST-EVENT|LAST-EVEN|LAST-FORM|'
+                r'LASTKEY|LAST-KEY|LAST-OBJECT|LAST-OF|'
+                r'LAST-PROCEDURE|LAST-PROCE|LAST-PROCED|LAST-PROCEDU|LAST-PROCEDUR|'
+                r'LAST-SERVER|LAST-TAB-ITEM|LAST-TAB-I|LAST-TAB-IT|LAST-TAB-ITE|'
+                r'LC|LDBNAME|LE|LEAVE|LEFT-ALIGNED|LEFT-ALIGN|LEFT-ALIGNE|LEFT-TRIM|'
+                r'LENGTH|LIBRARY|LIKE|LIKE-SEQUENTIAL|LINE|LINE-COUNTER|LINE-COUNT|LINE-COUNTE|'
+                r'LIST-EVENTS|LISTING|LISTI|LISTIN|LIST-ITEM-PAIRS|LIST-ITEMS|'
+                r'LIST-PROPERTY-NAMES|LIST-QUERY-ATTRS|LIST-SET-ATTRS|LIST-WIDGETS|'
+                r'LITERAL-QUESTION|LITTLE-ENDIAN|LOAD|LOAD-DOMAINS|LOAD-ICON|'
+                r'LOAD-IMAGE|LOAD-IMAGE-DOWN|LOAD-IMAGE-INSENSITIVE|LOAD-IMAGE-UP|'
+                r'LOAD-MOUSE-POINTER|LOAD-MOUSE-P|LOAD-MOUSE-PO|LOAD-MOUSE-POI|LOAD-MOUSE-POIN|LOAD-MOUSE-POINT|LOAD-MOUSE-POINTE|'
+                r'LOAD-PICTURE|LOAD-SMALL-ICON|LOCAL-NAME|LOCATOR-COLUMN-NUMBER|'
+                r'LOCATOR-LINE-NUMBER|LOCATOR-PUBLIC-ID|LOCATOR-SYSTEM-ID|LOCATOR-TYPE|'
+                r'LOCKED|LOCK-REGISTRATION|LOG|LOG-AUDIT-EVENT|LOGIN-EXPIRATION-TIMESTAMP|'
+                r'LOGIN-HOST|LOGIN-STATE|LOG-MANAGER|LOGOUT|LOOKAHEAD|LOOKUP|LT|'
+                r'MACHINE-CLASS|MANDATORY|MANUAL-HIGHLIGHT|MAP|MARGIN-EXTRA|'
+                r'MARGIN-HEIGHT-CHARS|MARGIN-HEIGHT|MARGIN-HEIGHT-|MARGIN-HEIGHT-C|MARGIN-HEIGHT-CH|MARGIN-HEIGHT-CHA|MARGIN-HEIGHT-CHAR|'
+                r'MARGIN-HEIGHT-PIXELS|MARGIN-HEIGHT-P|MARGIN-HEIGHT-PI|MARGIN-HEIGHT-PIX|MARGIN-HEIGHT-PIXE|MARGIN-HEIGHT-PIXEL|'
+                r'MARGIN-WIDTH-CHARS|MARGIN-WIDTH|MARGIN-WIDTH-|MARGIN-WIDTH-C|MARGIN-WIDTH-CH|MARGIN-WIDTH-CHA|MARGIN-WIDTH-CHAR|'
+                r'MARGIN-WIDTH-PIXELS|MARGIN-WIDTH-P|MARGIN-WIDTH-PI|MARGIN-WIDTH-PIX|MARGIN-WIDTH-PIXE|MARGIN-WIDTH-PIXEL|'
+                r'MARK-NEW|MARK-ROW-STATE|MATCHES|MAX|MAX-BUTTON|'
+                r'MAX-CHARS|MAX-DATA-GUESS|MAX-HEIGHT|'
+                r'MAX-HEIGHT-CHARS|MAX-HEIGHT-C|MAX-HEIGHT-CH|MAX-HEIGHT-CHA|MAX-HEIGHT-CHAR|'
+                r'MAX-HEIGHT-PIXELS|MAX-HEIGHT-P|MAX-HEIGHT-PI|MAX-HEIGHT-PIX|MAX-HEIGHT-PIXE|MAX-HEIGHT-PIXEL|'
+                r'MAXIMIZE|MAXIMUM|MAX|MAXI|MAXIM|MAXIMU|MAXIMUM-LEVEL|MAX-ROWS|'
+                r'MAX-SIZE|MAX-VALUE|MAX-VAL|MAX-VALU|MAX-WIDTH|'
+                r'MAX-WIDTH-CHARS|MAX-WIDTH|MAX-WIDTH-|MAX-WIDTH-C|MAX-WIDTH-CH|MAX-WIDTH-CHA|MAX-WIDTH-CHAR|'
+                r'MAX-WIDTH-PIXELS|MAX-WIDTH-P|MAX-WIDTH-PI|MAX-WIDTH-PIX|MAX-WIDTH-PIXE|MAX-WIDTH-PIXEL|'
+                r'MD5-DIGEST|MEMBER|MEMPTR-TO-NODE-VALUE|MENU|MENUBAR|MENU-BAR|MENU-ITEM|'
+                r'MENU-KEY|MENU-K|MENU-KE|MENU-MOUSE|MENU-M|MENU-MO|MENU-MOU|MENU-MOUS|'
+                r'MERGE-BY-FIELD|MESSAGE|MESSAGE-AREA|MESSAGE-AREA-FONT|MESSAGE-LINES|'
+                r'METHOD|MIN|MIN-BUTTON|'
+                r'MIN-COLUMN-WIDTH-CHARS|MIN-COLUMN-WIDTH-C|MIN-COLUMN-WIDTH-CH|MIN-COLUMN-WIDTH-CHA|MIN-COLUMN-WIDTH-CHAR|'
+                r'MIN-COLUMN-WIDTH-PIXELS|MIN-COLUMN-WIDTH-P|MIN-COLUMN-WIDTH-PI|MIN-COLUMN-WIDTH-PIX|MIN-COLUMN-WIDTH-PIXE|MIN-COLUMN-WIDTH-PIXEL|'
+                r'MIN-HEIGHT-CHARS|MIN-HEIGHT|MIN-HEIGHT-|MIN-HEIGHT-C|MIN-HEIGHT-CH|MIN-HEIGHT-CHA|MIN-HEIGHT-CHAR|'
+                r'MIN-HEIGHT-PIXELS|MIN-HEIGHT-P|MIN-HEIGHT-PI|MIN-HEIGHT-PIX|MIN-HEIGHT-PIXE|MIN-HEIGHT-PIXEL|'
+                r'MINIMUM|MIN|MINI|MINIM|MINIMU|MIN-SIZE|'
+                r'MIN-VALUE|MIN-VAL|MIN-VALU|'
+                r'MIN-WIDTH-CHARS|MIN-WIDTH|MIN-WIDTH-|MIN-WIDTH-C|MIN-WIDTH-CH|MIN-WIDTH-CHA|MIN-WIDTH-CHAR|'
+                r'MIN-WIDTH-PIXELS|MIN-WIDTH-P|MIN-WIDTH-PI|MIN-WIDTH-PIX|MIN-WIDTH-PIXE|MIN-WIDTH-PIXEL|'
+                r'MODIFIED|MODULO|MOD|MODU|MODUL|MONTH|MOUSE|'
+                r'MOUSE-POINTER|MOUSE-P|MOUSE-PO|MOUSE-POI|MOUSE-POIN|MOUSE-POINT|MOUSE-POINTE|'
+                r'MOVABLE|'
+                r'MOVE-AFTER-TAB-ITEM|MOVE-AFTER|MOVE-AFTER-|MOVE-AFTER-T|MOVE-AFTER-TA|MOVE-AFTER-TAB|MOVE-AFTER-TAB-|MOVE-AFTER-TAB-I|MOVE-AFTER-TAB-IT|MOVE-AFTER-TAB-ITE|'
+                r'MOVE-BEFORE-TAB-ITEM|MOVE-BEFOR|MOVE-BEFORE|MOVE-BEFORE-|MOVE-BEFORE-T|MOVE-BEFORE-TA|MOVE-BEFORE-TAB|MOVE-BEFORE-TAB-|MOVE-BEFORE-TAB-I|MOVE-BEFORE-TAB-IT|MOVE-BEFORE-TAB-ITE|'
+                r'MOVE-COLUMN|MOVE-COL|MOVE-COLU|MOVE-COLUM|'
+                r'MOVE-TO-BOTTOM|MOVE-TO-B|MOVE-TO-BO|MOVE-TO-BOT|MOVE-TO-BOTT|MOVE-TO-BOTTO|'
+                r'MOVE-TO-EOF|MOVE-TO-TOP|MOVE-TO-T|MOVE-TO-TO|MPE|MULTI-COMPILE|MULTIPLE|'
+                r'MULTIPLE-KEY|MULTITASKING-INTERVAL|MUST-EXIST|NAME|NAMESPACE-PREFIX|'
+                r'NAMESPACE-URI|NATIVE|NE|NEEDS-APPSERVER-PROMPT|NEEDS-PROMPT|NEW|'
+                r'NEW-INSTANCE|NEW-ROW|NEXT|NEXT-COLUMN|NEXT-PROMPT|NEXT-ROWID|'
+                r'NEXT-SIBLING|NEXT-TAB-ITEM|NEXT-TAB-I|NEXT-TAB-IT|NEXT-TAB-ITE|'
+                r'NEXT-VALUE|NO|NO-APPLY|NO-ARRAY-MESSAGE|NO-ASSIGN|'
+                r'NO-ATTR-LIST|NO-ATTR|NO-ATTR-|NO-ATTR-L|NO-ATTR-LI|NO-ATTR-LIS|'
+                r'NO-ATTR-SPACE|NO-ATTR|NO-ATTR-|NO-ATTR-S|NO-ATTR-SP|NO-ATTR-SPA|NO-ATTR-SPAC|'
+                r'NO-AUTO-VALIDATE|NO-BIND-WHERE|NO-BOX|NO-CONSOLE|NO-CONVERT|'
+                r'NO-CONVERT-3D-COLORS|NO-CURRENT-VALUE|NO-DEBUG|NODE-VALUE-TO-MEMPTR|'
+                r'NO-DRAG|NO-ECHO|NO-EMPTY-SPACE|NO-ERROR|NO-FILL|NO-F|NO-FI|'
+                r'NO-FIL|NO-FOCUS|NO-HELP|NO-HIDE|NO-INDEX-HINT|'
+                r'NO-INHERIT-BGCOLOR|NO-INHERIT-BGC|NO-INHERIT-BGCO|LABEL-BGCOL|LABEL-BGCOLO|'
+                r'NO-INHERIT-FGCOLOR|NO-INHERIT-FGC|NO-INHERIT-FGCO|NO-INHERIT-FGCOL|NO-INHERIT-FGCOLO|'
+                r'NO-JOIN-BY-SQLDB|NO-LABELS|NO-LABE|NO-LOBS|NO-LOCK|'
+                r'NO-LOOKAHEAD|NO-MAP|'
+                r'NO-MESSAGE|NO-MES|NO-MESS|NO-MESSA|NO-MESSAG|'
+                r'NONAMESPACE-SCHEMA-LOCATION|NONE|NO-PAUSE|'
+                r'NO-PREFETCH|NO-PREFE|NO-PREFET|NO-PREFETC|NORMALIZE|'
+                r'NO-ROW-MARKERS|NO-SCROLLBAR-VERTICAL|NO-SEPARATE-CONNECTION|'
+                r'NO-SEPARATORS|NOT|NO-TAB-STOP|NOT-ACTIVE|'
+                r'NO-UNDERLINE|NO-UND|NO-UNDE|NO-UNDER|NO-UNDERL|NO-UNDERLI|NO-UNDERLIN|'
+                r'NO-UNDO|'
+                r'NO-VALIDATE|NO-VAL|NO-VALI|NO-VALID|NO-VALIDA|NO-VALIDAT|NOW|'
+                r'NO-WAIT|NO-WORD-WRAP|NULL|NUM-ALIASES|NUM-ALI|NUM-ALIA|NUM-ALIAS|NUM-ALIASE|'
+                r'NUM-BUFFERS|NUM-BUTTONS|NUM-BUT|NUM-BUTT|NUM-BUTTO|NUM-BUTTON|'
+                r'NUM-COLUMNS|NUM-COL|NUM-COLU|NUM-COLUM|NUM-COLUMN|NUM-COPIES|'
+                r'NUM-DBS|NUM-DROPPED-FILES|NUM-ENTRIES|NUMERIC|'
+                r'NUMERIC-FORMAT|NUMERIC-F|NUMERIC-FO|NUMERIC-FOR|NUMERIC-FORM|NUMERIC-FORMA|'
+                r'NUM-FIELDS|NUM-FORMATS|NUM-ITEMS|NUM-ITERATIONS|NUM-LINES|'
+                r'NUM-LOCKED-COLUMNS|NUM-LOCKED-COL|NUM-LOCKED-COLU|NUM-LOCKED-COLUM|NUM-LOCKED-COLUMN|'
+                r'NUM-MESSAGES|NUM-PARAMETERS|NUM-REFERENCES|NUM-REPLACED|NUM-RESULTS|NUM-SELECTED-ROWS|'
+                r'NUM-SELECTED-WIDGETS|NUM-SELECTED|NUM-SELECTED-|NUM-SELECTED-W|NUM-SELECTED-WI|NUM-SELECTED-WID|NUM-SELECTED-WIDG|NUM-SELECTED-WIDGE|NUM-SELECTED-WIDGET|'
+                r'NUM-TABS|NUM-TO-RETAIN|NUM-VISIBLE-COLUMNS|OCTET-LENGTH|OF|'
+                r'OFF|OK|OK-CANCEL|OLD|ON|'
+                r'ON-FRAME-BORDER|ON-FRAME|ON-FRAME-|ON-FRAME-B|ON-FRAME-BO|ON-FRAME-BOR|ON-FRAME-BORD|ON-FRAME-BORDE|'
+                r'OPEN|OPSYS|OPTION|OR|ORDERED-JOIN|ORDINAL|'
+                r'OS-APPEND|OS-COMMAND|OS-COPY|OS-CREATE-DIR|OS-DELETE|OS-DIR|'
+                r'OS-DRIVES|OS-DRIVE|OS-ERROR|OS-GETENV|OS-RENAME|OTHERWISE|'
+                r'OUTPUT|OVERLAY|OVERRIDE|OWNER|PAGE|'
+                r'PAGE-BOTTOM|PAGE-BOT|PAGE-BOTT|PAGE-BOTTO|PAGED|'
+                r'PAGE-NUMBER|PAGE-NUM|PAGE-NUMB|PAGE-NUMBE|PAGE-SIZE|'
+                r'PAGE-TOP|PAGE-WIDTH|PAGE-WID|PAGE-WIDT|'
+                r'PARAMETER|PARAM|PARAME|PARAMET|PARAMETE|'
+                r'PARENT|PARSE-STATUS|PARTIAL-KEY|PASCAL|PASSWORD-FIELD|PATHNAME|PAUSE|'
+                r'PBE-HASH-ALGORITHM|PBE-HASH-ALG|PBE-HASH-ALGO|PBE-HASH-ALGOR|PBE-HASH-ALGORI|PBE-HASH-ALGORIT|PBE-HASH-ALGORITH|'
+                r'PBE-KEY-ROUNDS|PDBNAME|PERSISTENT|PERSIST|PERSISTE|PERSISTEN|'
+                r'PERSISTENT-CACHE-DISABLED|PFCOLOR|PFC|PFCO|PFCOL|PFCOLO|PIXELS|'
+                r'PIXELS-PER-COLUMN|PIXELS-PER-COL|PIXELS-PER-COLU|PIXELS-PER-COLUM|'
+                r'PIXELS-PER-ROW|POPUP-MENU|POPUP-M|POPUP-ME|POPUP-MEN|'
+                r'POPUP-ONLY|POPUP-O|POPUP-ON|POPUP-ONL|PORTRAIT|POSITION|'
+                r'PRECISION|PREFER-DATASET|PREPARED|PREPARE-STRING|'
+                r'PREPROCESS|PREPROC|PREPROCE|PREPROCES|'
+                r'PRESELECT|PRESEL|PRESELE|PRESELEC|PREV|PREV-COLUMN|'
+                r'PREV-SIBLING|'
+                r'PREV-TAB-ITEM|PREV-TAB-I|PREV-TAB-IT|PREV-TAB-ITE|'
+                r'PRIMARY|PRINTER|PRINTER-CONTROL-HANDLE|PRINTER-HDC|'
+                r'PRINTER-NAME|PRINTER-PORT|PRINTER-SETUP|PRIVATE|'
+                r'PRIVATE-DATA|PRIVATE-D|PRIVATE-DA|PRIVATE-DAT|'
+                r'PRIVILEGES|'
+                r'PROCEDURE|PROCE|PROCED|PROCEDU|PROCEDUR|'
+                r'PROCEDURE-CALL-TYPE|'
+                r'PROCESS|'
+                r'PROC-HANDLE|PROC-HA|PROC-HAN|PROC-HAND|PROC-HANDL|'
+                r'PROC-STATUS|PROC-ST|PROC-STA|PROC-STAT|PROC-STATU|'
+                r'proc-text|proc-text-buffer|'
+                r'PROFILER|PROGRAM-NAME|PROGRESS|'
+                r'PROGRESS-SOURCE|PROGRESS-S|PROGRESS-SO|PROGRESS-SOU|PROGRESS-SOUR|PROGRESS-SOURC|'
+                r'PROMPT|PROMPT-FOR|PROMPT-F|PROMPT-FO|PROMSGS|PROPATH|'
+                r'PROPERTY|PROTECTED|PROVERSION|PROVERS|PROVERSI|PROVERSIO|'
+                r'PROXY|PROXY-PASSWORD|PROXY-USERID|PUBLIC|PUBLIC-ID|'
+                r'PUBLISH|PUBLISHED-EVENTS|PUT|PUTBYTE|PUT-BYTE|PUT-DOUBLE|'
+                r'PUT-FLOAT|PUT-INT64|PUT-KEY-VALUE|PUT-KEY-VAL|PUT-KEY-VALU|PUT-LONG|'
+                r'PUT-SHORT|PUT-STRING|PUT-UNSIGNED-LONG|QUERY|QUERY-CLOSE|QUERY-OFF-END|'
+                r'QUERY-OPEN|QUERY-PREPARE|QUERY-TUNING|QUESTION|QUIT|QUOTER|'
+                r'RADIO-BUTTONS|RADIO-SET|RANDOM|RAW-TRANSFER|'
+                r'RCODE-INFORMATION|RCODE-INFO|RCODE-INFOR|RCODE-INFORM|RCODE-INFORMA|RCODE-INFORMAT|RCODE-INFORMATI|RCODE-INFORMATIO|'
+                r'READ-AVAILABLE|READ-EXACT-NUM|READ-FILE|READKEY|READ-ONLY|READ-XML|READ-XMLSCHEMA|'
+                r'REAL|RECORD-LENGTH|RECTANGLE|RECT|RECTA|RECTAN|RECTANG|RECTANGL|'
+                r'RECURSIVE|REFERENCE-ONLY|REFRESH|REFRESHABLE|REFRESH-AUDIT-POLICY|'
+                r'REGISTER-DOMAIN|RELEASE|REMOTE|REMOVE-EVENTS-PROCEDURE|REMOVE-SUPER-PROCEDURE|'
+                r'REPEAT|REPLACE|REPLACE-SELECTION-TEXT|REPOSITION|REPOSITION-BACKWARD|'
+                r'REPOSITION-FORWARD|REPOSITION-MODE|REPOSITION-TO-ROW|REPOSITION-TO-ROWID|'
+                r'REQUEST|RESET|RESIZABLE|RESIZA|RESIZAB|RESIZABL|RESIZE|RESTART-ROW|'
+                r'RESTART-ROWID|RETAIN|RETAIN-SHAPE|RETRY|RETRY-CANCEL|RETURN|'
+                r'RETURN-INSERTED|RETURN-INS|RETURN-INSE|RETURN-INSER|RETURN-INSERT|RETURN-INSERTE|'
+                r'RETURNS|RETURN-TO-START-DIR|RETURN-TO-START-DI|'
+                r'RETURN-VALUE|RETURN-VAL|RETURN-VALU|'
+                r'RETURN-VALUE-DATA-TYPE|REVERSE-FROM|REVERT|'
+                r'REVOKE|RGB-VALUE|RIGHT-ALIGNED|RETURN-ALIGN|RETURN-ALIGNE|'
+                r'RIGHT-TRIM|R-INDEX|ROLES|ROUND|ROUTINE-LEVEL|ROW|'
+                r'ROW-HEIGHT-CHARS|HEIGHT|ROW-HEIGHT-PIXELS|HEIGHT-P|ROW-MARKERS|'
+                r'ROW-OF|ROW-RESIZABLE|RULE|RUN|RUN-PROCEDURE|SAVE|SAVE-AS|'
+                r'SAVE-FILE|SAX-COMPLETE|SAX-COMPLE|SAX-COMPLET|SAX-PARSE|SAX-PARSE-FIRST|'
+                r'SAX-PARSE-NEXT|SAX-PARSER-ERROR|SAX-RUNNING|SAX-UNINITIALIZED|'
+                r'SAX-WRITE-BEGIN|SAX-WRITE-COMPLETE|SAX-WRITE-CONTENT|SAX-WRITE-ELEMENT|'
+                r'SAX-WRITE-ERROR|SAX-WRITE-IDLE|SAX-WRITER|SAX-WRITE-TAG|SCHEMA|'
+                r'SCHEMA-LOCATION|SCHEMA-MARSHAL|SCHEMA-PATH|SCREEN|SCREEN-IO|'
+                r'SCREEN-LINES|SCREEN-VALUE|SCREEN-VAL|SCREEN-VALU|SCROLL|SCROLLABLE|'
+                r'SCROLLBAR-HORIZONTAL|SCROLLBAR-H|SCROLLBAR-HO|SCROLLBAR-HOR|SCROLLBAR-HORI|SCROLLBAR-HORIZ|SCROLLBAR-HORIZO|SCROLLBAR-HORIZON|SCROLLBAR-HORIZONT|SCROLLBAR-HORIZONTA|'
+                r'SCROLL-BARS|'
+                r'SCROLLBAR-VERTICAL|SCROLLBAR-V|SCROLLBAR-VE|SCROLLBAR-VER|SCROLLBAR-VERT|SCROLLBAR-VERTI|SCROLLBAR-VERTIC|SCROLLBAR-VERTICA|'
+                r'SCROLL-DELTA|'
+                r'SCROLLED-ROW-POSITION|SCROLLED-ROW-POS|SCROLLED-ROW-POSI|SCROLLED-ROW-POSIT|SCROLLED-ROW-POSITI|SCROLLED-ROW-POSITIO|'
+                r'SCROLLING|SCROLL-OFFSET|SCROLL-TO-CURRENT-ROW|SCROLL-TO-ITEM|SCROLL-TO-I|SCROLL-TO-IT|SCROLL-TO-ITE|'
+                r'SCROLL-TO-SELECTED-ROW|SDBNAME|SEAL|SEAL-TIMESTAMP|SEARCH|SEARCH-SELF|SEARCH-TARGET|'
+                r'SECTION|SECURITY-POLICY|SEEK|SELECT|SELECTABLE|SELECT-ALL|'
+                r'SELECTED|SELECT-FOCUSED-ROW|SELECTION|SELECTION-END|SELECTION-LIST|'
+                r'SELECTION-START|SELECTION-TEXT|SELECT-NEXT-ROW|SELECT-PREV-ROW|'
+                r'SELECT-ROW|SELF|SEND|send-sql-statement|send-sql|SENSITIVE|'
+                r'SEPARATE-CONNECTION|SEPARATOR-FGCOLOR|SEPARATORS|SERVER|'
+                r'SERVER-CONNECTION-BOUND|SERVER-CONNECTION-BOUND-REQUEST|'
+                r'SERVER-CONNECTION-CONTEXT|SERVER-CONNECTION-ID|SERVER-OPERATING-MODE|'
+                r'SESSION|SESSION-ID|SET|SET-APPL-CONTEXT|SET-ATTR-CALL-TYPE|SET-ATTRIBUTE-NODE|'
+                r'SET-BLUE-VALUE|SET-BLUE|SET-BLUE-|SET-BLUE-V|SET-BLUE-VA|SET-BLUE-VAL|SET-BLUE-VALU|'
+                r'SET-BREAK|SET-BUFFERS|SET-CALLBACK|SET-CLIENT|SET-COMMIT|SET-CONTENTS|'
+                r'SET-CURRENT-VALUE|SET-DB-CLIENT|SET-DYNAMIC|SET-EVENT-MANAGER-OPTION|'
+                r'SET-GREEN-VALUE|SET-GREEN|SET-GREEN-|SET-GREEN-V|SET-GREEN-VA|SET-GREEN-VAL|SET-GREEN-VALU|'
+                r'SET-INPUT-SOURCE|SET-OPTION|SET-OUTPUT-DESTINATION|SET-PARAMETER|SET-POINTER-VALUE|'
+                r'SET-PROPERTY|SET-RED-VALUE|SET-RED|SET-RED-|SET-RED-V|SET-RED-VA|SET-RED-VAL|SET-RED-VALU|'
+                r'SET-REPOSITIONED-ROW|SET-RGB-VALUE|SET-ROLLBACK|SET-SELECTION|SET-SIZE|'
+                r'SET-SORT-ARROW|SETUSERID|SETUSER|SETUSERI|SET-WAIT-STATE|SHA1-DIGEST|SHARED|'
+                r'SHARE-LOCK|SHARE|SHARE-|SHARE-L|SHARE-LO|SHARE-LOC|SHOW-IN-TASKBAR|SHOW-STATS|SHOW-STAT|'
+                r'SIDE-LABEL-HANDLE|SIDE-LABEL-H|SIDE-LABEL-HA|SIDE-LABEL-HAN|SIDE-LABEL-HAND|SIDE-LABEL-HANDL|'
+                r'SIDE-LABELS|SIDE-LAB|SIDE-LABE|SIDE-LABEL|'
+                r'SILENT|SIMPLE|SINGLE|SIZE|'
+                r'SIZE-CHARS|SIZE-C|SIZE-CH|SIZE-CHA|SIZE-CHAR|'
+                r'SIZE-PIXELS|SIZE-P|SIZE-PI|SIZE-PIX|SIZE-PIXE|SIZE-PIXEL|SKIP|'
+                r'SKIP-DELETED-RECORD|SLIDER|SMALL-ICON|SMALLINT|SMALL-TITLE|SOME|SORT|'
+                r'SORT-ASCENDING|SORT-NUMBER|SOURCE|SOURCE-PROCEDURE|SPACE|SQL|SQRT|'
+                r'SSL-SERVER-NAME|STANDALONE|START|START-DOCUMENT|START-ELEMENT|START-MOVE|'
+                r'START-RESIZE|START-ROW-RESIZE|STATE-DETAIL|STATIC|STATUS|STATUS-AREA|STATUS-AREA-FONT|'
+                r'STDCALL|STOP|STOP-PARSING|STOPPED|STOPPE|'
+                r'STORED-PROCEDURE|STORED-PROC|STORED-PROCE|STORED-PROCED|STORED-PROCEDU|STORED-PROCEDUR|'
+                r'STREAM|STREAM-HANDLE|STREAM-IO|STRETCH-TO-FIT|STRICT|STRING|STRING-VALUE|STRING-XREF|'
+                r'SUB-AVERAGE|SUB-AVE|SUB-AVER|SUB-AVERA|SUB-AVERAG|'
+                r'SUB-COUNT|SUB-MAXIMUM|SUM-MAX|SUM-MAXI|SUM-MAXIM|SUM-MAXIMU|SUB-MENU|SUBSUB-|'
+                r'MINIMUM|SUB-MIN|SUBSCRIBE|SUBSTITUTE|SUBST|SUBSTI|SUBSTIT|SUBSTITU|SUBSTITUT|'
+                r'SUBSTRING|SUBSTR|SUBSTRI|SUBSTRIN|SUB-TOTAL|SUBTYPE|SUM|SUPER|SUPER-PROCEDURES|'
+                r'SUPPRESS-NAMESPACE-PROCESSING|'
+                r'SUPPRESS-WARNINGS|SUPPRESS-W|SUPPRESS-WA|SUPPRESS-WAR|SUPPRESS-WARN|SUPPRESS-WARNI|SUPPRESS-WARNIN|SUPPRESS-WARNING|'
+                r'SYMMETRIC-ENCRYPTION-ALGORITHM|SYMMETRIC-ENCRYPTION-IV|SYMMETRIC-ENCRYPTION-KEY|SYMMETRIC-SUPPORT|'
+                r'SYSTEM-ALERT-BOXES|SYSTEM-ALERT|SYSTEM-ALERT-|SYSTEM-ALERT-B|SYSTEM-ALERT-BO|SYSTEM-ALERT-BOX|SYSTEM-ALERT-BOXE|'
+                r'SYSTEM-DIALOG|SYSTEM-HELP|SYSTEM-ID|TABLE|TABLE-HANDLE|TABLE-NUMBER|TAB-POSITION|'
+                r'TAB-STOP|TARGET|TARGET-PROCEDURE|'
+                r'TEMP-DIRECTORY|TEMP-DIR|TEMP-DIRE|TEMP-DIREC|TEMP-DIRECT|TEMP-DIRECTO|TEMP-DIRECTOR|'
+                r'TEMP-TABLE|TEMP-TABLE-PREPARE|TERM|TERMINAL|TERM|TERMI|TERMIN|TERMINA|'
+                r'TERMINATE|TEXT|TEXT-CURSOR|TEXT-SEG-GROW|TEXT-SELECTED|THEN|'
+                r'THIS-OBJECT|THIS-PROCEDURE|THREE-D|THROW|THROUGH|THRU|TIC-MARKS|TIME|'
+                r'TIME-SOURCE|TITLE|'
+                r'TITLE-BGCOLOR|TITLE-BGC|TITLE-BGCO|TITLE-BGCOL|TITLE-BGCOLO|'
+                r'TITLE-DCOLOR|TITLE-DC|TITLE-DCO|TITLE-DCOL|TITLE-DCOLO|'
+                r'TITLE-FGCOLOR|TITLE-FGC|TITLE-FGCO|TITLE-FGCOL|TITLE-FGCOLO|'
+                r'TITLE-FONT|TITLE-FO|TITLE-FON|'
+                r'TO|TODAY|TOGGLE-BOX|TOOLTIP|TOOLTIPS|TOPIC|TOP-NAV-QUERY|TOP-ONLY|'
+                r'TO-ROWID|TOTAL|TRAILING|TRANS|TRANSACTION|TRANSACTION-MODE|'
+                r'TRANS-INIT-PROCEDURE|TRANSPARENT|TRIGGER|TRIGGERS|TRIM|'
+                r'TRUE|TRUNCATE|TRUNC|TRUNCA|TRUNCAT|TYPE|TYPE-OF|'
+                r'UNBOX|UNBUFFERED|UNBUFF|UNBUFFE|UNBUFFER|UNBUFFERE|'
+                r'UNDERLINE|UNDERL|UNDERLI|UNDERLIN|UNDO|'
+                r'UNFORMATTED|UNFORM|UNFORMA|UNFORMAT|UNFORMATT|UNFORMATTE|UNION|'
+                r'UNIQUE|UNIQUE-ID|UNIQUE-MATCH|UNIX|UNLESS-HIDDEN|UNLOAD|'
+                r'UNSIGNED-LONG|UNSUBSCRIBE|UP|UPDATE|UPDATE-ATTRIBUTE|'
+                r'URL|URL-DECODE|URL-ENCODE|URL-PASSWORD|URL-USERID|USE|'
+                r'USE-DICT-EXPS|USE-FILENAME|USE-INDEX|USER|USE-REVVIDEO|'
+                r'USERID|USER-ID|USE-TEXT|USE-UNDERLINE|USE-WIDGET-POOL|'
+                r'USING|V6DISPLAY|V6FRAME|VALIDATE|VALIDATE-EXPRESSION|'
+                r'VALIDATE-MESSAGE|VALIDATE-SEAL|VALIDATION-ENABLED|VALID-EVENT|'
+                r'VALID-HANDLE|VALID-OBJECT|VALUE|VALUE-CHANGED|VALUES|'
+                r'VARIABLE|VAR|VARI|VARIA|VARIAB|VARIABL|VERBOSE|'
+                r'VERSION|VERTICAL|VERT|VERTI|VERTIC|VERTICA|'
+                r'VIEW|VIEW-AS|VIEW-FIRST-COLUMN-ON-REOPEN|'
+                r'VIRTUAL-HEIGHT-CHARS|VIRTUAL-HEIGHT|VIRTUAL-HEIGHT-|VIRTUAL-HEIGHT-C|VIRTUAL-HEIGHT-CH|VIRTUAL-HEIGHT-CHA|VIRTUAL-HEIGHT-CHAR|'
+                r'VIRTUAL-HEIGHT-PIXELS|VIRTUAL-HEIGHT-P|VIRTUAL-HEIGHT-PI|VIRTUAL-HEIGHT-PIX|VIRTUAL-HEIGHT-PIXE|VIRTUAL-HEIGHT-PIXEL|'
+                r'VIRTUAL-WIDTH-CHARS|VIRTUAL-WIDTH|VIRTUAL-WIDTH-|VIRTUAL-WIDTH-C|VIRTUAL-WIDTH-CH|VIRTUAL-WIDTH-CHA|VIRTUAL-WIDTH-CHAR|'
+                r'VIRTUAL-WIDTH-PIXELS|VIRTUAL-WIDTH-P|VIRTUAL-WIDTH-PI|VIRTUAL-WIDTH-PIX|VIRTUAL-WIDTH-PIXE|VIRTUAL-WIDTH-PIXEL|'
+                r'VISIBLE|VOID|WAIT|WAIT-FOR|WARNING|WEB-CONTEXT|WEEKDAY|WHEN|'
+                r'WHERE|WHILE|WIDGET|'
+                r'WIDGET-ENTER|WIDGET-E|WIDGET-EN|WIDGET-ENT|WIDGET-ENTE|'
+                r'WIDGET-ID|'
+                r'WIDGET-LEAVE|WIDGET-L|WIDGET-LE|WIDGET-LEA|WIDGET-LEAV|'
+                r'WIDGET-POOL|WIDTH|'
+                r'WIDTH-CHARS|WIDTH|WIDTH-|WIDTH-C|WIDTH-CH|WIDTH-CHA|WIDTH-CHAR|'
+                r'WIDTH-PIXELS|WIDTH-P|WIDTH-PI|WIDTH-PIX|WIDTH-PIXE|WIDTH-PIXEL|'
+                r'WINDOW|'
+                r'WINDOW-MAXIMIZED|WINDOW-MAXIM|WINDOW-MAXIMI|WINDOW-MAXIMIZ|WINDOW-MAXIMIZE|'
+                r'WINDOW-MINIMIZED|WINDOW-MINIM|WINDOW-MINIMI|WINDOW-MINIMIZ|WINDOW-MINIMIZE|'
+                r'WINDOW-NAME|WINDOW-NORMAL|WINDOW-STATE|WINDOW-STA|WINDOW-STAT|'
+                r'WINDOW-SYSTEM|WITH|WORD-INDEX|WORD-WRAP|WORK-AREA-HEIGHT-PIXELS|'
+                r'WORK-AREA-WIDTH-PIXELS|WORK-AREA-X|WORK-AREA-Y|WORKFILE|'
+                r'WORK-TABLE|WORK-TAB|WORK-TABL|WRITE|WRITE-CDATA|WRITE-CHARACTERS|'
+                r'WRITE-COMMENT|WRITE-DATA-ELEMENT|WRITE-EMPTY-ELEMENT|WRITE-ENTITY-REF|'
+                r'WRITE-EXTERNAL-DTD|WRITE-FRAGMENT|WRITE-MESSAGE|'
+                r'WRITE-PROCESSING-INSTRUCTION|WRITE-STATUS|WRITE-XML|WRITE-XMLSCHEMA|'
+                r'X|XCODE|XML-DATA-TYPE|XML-NODE-TYPE|XML-SCHEMA-PATH|'
+                r'XML-SUPPRESS-NAMESPACE-PROCESSING|X-OF|XREF|'
+                r'XREF-XML|Y|YEAR|YEAR-OFFSET|YES|YES-NO|'
+                r'YES-NO-CANCEL|Y-OF)\s*($|(?=[^0-9a-z_\-]))')
+
+    tokens = {
+        'root': [
+            (r'/\*', Comment.Multiline, 'comment'),
+            (r'\{', Comment.Preproc, 'preprocessor'),
+            (r'\s*&.*', Comment.Preproc),
+            (r'0[xX][0-9a-fA-F]+[LlUu]*', Number.Hex),
+            (r'(?i)(DEFINE|DEF|DEFI|DEFIN)\b', Keyword.Declaration),
+            (types, Keyword.Type),
+            (keywords, Name.Builtin),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r'[0-9]+', Number.Integer),
+            (r'\s+', Text),
+            (r'[+*/=-]', Operator),
+            (r'[.:()]', Punctuation),
+            (r'.', Name.Variable), # Lazy catch-all
+        ],
+        'comment': [
+            (r'[^*/]', Comment.Multiline),
+            (r'/\*', Comment.Multiline, '#push'),
+            (r'\*/', Comment.Multiline, '#pop'),
+            (r'[*/]', Comment.Multiline)
+        ],
+        'preprocessor': [
+            (r'[^{}]', Comment.Preproc),
+            (r'{', Comment.Preproc, '#push'),
+            (r'}', Comment.Preproc, '#pop'),
+        ],
+    }
+
+
+class BroLexer(RegexLexer):
+    """
+    For `Bro <http://bro-ids.org/>`_ scripts.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'Bro'
+    aliases = ['bro']
+    filenames = ['*.bro']
+
+    _hex = r'[0-9a-fA-F_]+'
+    _float = r'((\d*\.?\d+)|(\d+\.?\d*))([eE][-+]?\d+)?'
+    _h = r'[A-Za-z0-9][-A-Za-z0-9]*'
+
+    tokens = {
+        'root': [
+            # Whitespace
+            (r'^@.*?\n', Comment.Preproc),
+            (r'#.*?\n', Comment.Single),
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text),
+            # Keywords
+            (r'(add|alarm|break|case|const|continue|delete|do|else|enum|event'
+             r'|export|for|function|if|global|local|module|next'
+             r'|of|print|redef|return|schedule|type|when|while)\b', Keyword),
+            (r'(addr|any|bool|count|counter|double|file|int|interval|net'
+             r'|pattern|port|record|set|string|subnet|table|time|timer'
+             r'|vector)\b', Keyword.Type),
+            (r'(T|F)\b', Keyword.Constant),
+            (r'(&)((?:add|delete|expire)_func|attr|(create|read|write)_expire'
+             r'|default|disable_print_hook|raw_output|encrypt|group|log'
+             r'|mergeable|optional|persistent|priority|redef'
+             r'|rotate_(?:interval|size)|synchronized)\b', bygroups(Punctuation,
+                 Keyword)),
+            (r'\s+module\b', Keyword.Namespace),
+            # Addresses, ports and networks
+            (r'\d+/(tcp|udp|icmp|unknown)\b', Number),
+            (r'(\d+\.){3}\d+', Number),
+            (r'(' + _hex + r'){7}' + _hex, Number),
+            (r'0x' + _hex + r'(' + _hex + r'|:)*::(' + _hex + r'|:)*', Number),
+            (r'((\d+|:)(' + _hex + r'|:)*)?::(' + _hex + r'|:)*', Number),
+            (r'(\d+\.\d+\.|(\d+\.){2}\d+)', Number),
+            # Hostnames
+            (_h + r'(\.' + _h + r')+', String),
+            # Numeric
+            (_float + r'\s+(day|hr|min|sec|msec|usec)s?\b', Literal.Date),
+            (r'0[xX]' + _hex, Number.Hex),
+            (_float, Number.Float),
+            (r'\d+', Number.Integer),
+            (r'/', String.Regex, 'regex'),
+            (r'"', String, 'string'),
+            # Operators
+            (r'[!%*/+:<=>?~|-]', Operator),
+            (r'([-+=&|]{2}|[+=!><-]=)', Operator),
+            (r'(in|match)\b', Operator.Word),
+            (r'[{}()\[\]$.,;]', Punctuation),
+            # Identfier
+            (r'([_a-zA-Z]\w*)(::)', bygroups(Name, Name.Namespace)),
+            (r'[a-zA-Z_][a-zA-Z_0-9]*', Name)
+        ],
+        'string': [
+            (r'"', String, '#pop'),
+            (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
+            (r'[^\\"\n]+', String),
+            (r'\\\n', String),
+            (r'\\', String)
+        ],
+        'regex': [
+            (r'/', String.Regex, '#pop'),
+            (r'\\[\\nt/]', String.Regex), # String.Escape is too intense here.
+            (r'[^\\/\n]+', String.Regex),
+            (r'\\\n', String.Regex),
+            (r'\\', String.Regex)
+        ]
+    }
index 0ead39bee97d4bb390afa757bda8700292b4dcef..2b5f954f366564eccb42fe6e55c81f68923afde4 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for parser generators.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -72,8 +72,8 @@ class RagelLexer(RegexLexer):
         ],
         'operators': [
             (r',', Operator), # Join
-            (r'\||&|-|--', Operator), # Union, Intersection and Subtraction
-            (r'\.|<:|:>|:>>', Operator), # Concatention
+            (r'\||&|--?', Operator), # Union, Intersection and Subtraction
+            (r'\.|<:|:>>?', Operator), # Concatention
             (r':', Operator), # Label
             (r'->', Operator), # Epsilon Transition
             (r'(>|\$|%|<|@|<>)(/|eof\b)', Operator), # EOF Actions
@@ -393,7 +393,7 @@ class AntlrLexer(RegexLexer):
             # throwsSpec
             (r'(throws)(\s+)(' + _id + ')',
              bygroups(Keyword, Whitespace, Name.Label)),
-            (r'(?:(,)(\s*)(' + _id + '))+',
+            (r'(,)(\s*)(' + _id + ')',
              bygroups(Punctuation, Whitespace, Name.Label)), # Additional throws
             # optionsSpec
             (r'options\b', Keyword, 'options'),
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py
new file mode 100644 (file)
index 0000000..b6afa35
--- /dev/null
@@ -0,0 +1,361 @@
+# -*- coding: utf-8 -*-
+"""
+    pygments.lexers.shell
+    ~~~~~~~~~~~~~~~~~~~~~
+
+    Lexers for various shells.
+
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+import re
+
+from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, include
+from pygments.token import Punctuation, \
+     Text, Comment, Operator, Keyword, Name, String, Number, Generic
+from pygments.util import shebang_matches
+
+
+__all__ = ['BashLexer', 'BashSessionLexer', 'TcshLexer', 'BatchLexer',
+           'PowerShellLexer']
+
+line_re  = re.compile('.*?\n')
+
+
+class BashLexer(RegexLexer):
+    """
+    Lexer for (ba|k|)sh shell scripts.
+
+    *New in Pygments 0.6.*
+    """
+
+    name = 'Bash'
+    aliases = ['bash', 'sh', 'ksh']
+    filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass',
+                 '.bashrc', 'bashrc', '.bash_*', 'bash_*']
+    mimetypes = ['application/x-sh', 'application/x-shellscript']
+
+    tokens = {
+        'root': [
+            include('basic'),
+            (r'\$\(\(', Keyword, 'math'),
+            (r'\$\(', Keyword, 'paren'),
+            (r'\${#?', Keyword, 'curly'),
+            (r'`', String.Backtick, 'backticks'),
+            include('data'),
+        ],
+        'basic': [
+            (r'\b(if|fi|else|while|do|done|for|then|return|function|case|'
+             r'select|continue|until|esac|elif)\s*\b',
+             Keyword),
+            (r'\b(alias|bg|bind|break|builtin|caller|cd|command|compgen|'
+             r'complete|declare|dirs|disown|echo|enable|eval|exec|exit|'
+             r'export|false|fc|fg|getopts|hash|help|history|jobs|kill|let|'
+             r'local|logout|popd|printf|pushd|pwd|read|readonly|set|shift|'
+             r'shopt|source|suspend|test|time|times|trap|true|type|typeset|'
+             r'ulimit|umask|unalias|unset|wait)\s*\b(?!\.)',
+             Name.Builtin),
+            (r'#.*\n', Comment),
+            (r'\\[\w\W]', String.Escape),
+            (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)),
+            (r'[\[\]{}()=]', Operator),
+            (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
+            (r'&&|\|\|', Operator),
+        ],
+        'data': [
+            (r'(?s)\$?"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
+            (r"(?s)\$?'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
+            (r';', Text),
+            (r'\s+', Text),
+            (r'[^=\s\[\]{}()$"\'`\\<]+', Text),
+            (r'\d+(?= |\Z)', Number),
+            (r'\$#?(\w+|.)', Name.Variable),
+            (r'<', Text),
+        ],
+        'curly': [
+            (r'}', Keyword, '#pop'),
+            (r':-', Keyword),
+            (r'[a-zA-Z0-9_]+', Name.Variable),
+            (r'[^}:"\'`$]+', Punctuation),
+            (r':', Punctuation),
+            include('root'),
+        ],
+        'paren': [
+            (r'\)', Keyword, '#pop'),
+            include('root'),
+        ],
+        'math': [
+            (r'\)\)', Keyword, '#pop'),
+            (r'[-+*/%^|&]|\*\*|\|\|', Operator),
+            (r'\d+', Number),
+            include('root'),
+        ],
+        'backticks': [
+            (r'`', String.Backtick, '#pop'),
+            include('root'),
+        ],
+    }
+
+    def analyse_text(text):
+        return shebang_matches(text, r'(ba|z|)sh')
+
+
+class BashSessionLexer(Lexer):
+    """
+    Lexer for simplistic shell sessions.
+
+    *New in Pygments 1.1.*
+    """
+
+    name = 'Bash Session'
+    aliases = ['console']
+    filenames = ['*.sh-session']
+    mimetypes = ['application/x-shell-session']
+
+    def get_tokens_unprocessed(self, text):
+        bashlexer = BashLexer(**self.options)
+
+        pos = 0
+        curcode = ''
+        insertions = []
+
+        for match in line_re.finditer(text):
+            line = match.group()
+            m = re.match(r'^((?:\(\S+\))?(?:|sh\S*?|\w+\S+[@:]\S+(?:\s+\S+)'
+                          r'?|\[\S+[@:][^\n]+\].+)[$#%])(.*\n?)' , line)
+            if m:
+                # To support output lexers (say diff output), the output
+                # needs to be broken by prompts whenever the output lexer
+                # changes.
+                if not insertions:
+                    pos = match.start()
+
+                insertions.append((len(curcode),
+                                   [(0, Generic.Prompt, m.group(1))]))
+                curcode += m.group(2)
+            elif line.startswith('>'):
+                insertions.append((len(curcode),
+                                   [(0, Generic.Prompt, line[:1])]))
+                curcode += line[1:]
+            else:
+                if insertions:
+                    toks = bashlexer.get_tokens_unprocessed(curcode)
+                    for i, t, v in do_insertions(insertions, toks):
+                        yield pos+i, t, v
+                yield match.start(), Generic.Output, line
+                insertions = []
+                curcode = ''
+        if insertions:
+            for i, t, v in do_insertions(insertions,
+                                         bashlexer.get_tokens_unprocessed(curcode)):
+                yield pos+i, t, v
+
+
+class BatchLexer(RegexLexer):
+    """
+    Lexer for the DOS/Windows Batch file format.
+
+    *New in Pygments 0.7.*
+    """
+    name = 'Batchfile'
+    aliases = ['bat']
+    filenames = ['*.bat', '*.cmd']
+    mimetypes = ['application/x-dos-batch']
+
+    flags = re.MULTILINE | re.IGNORECASE
+
+    tokens = {
+        'root': [
+            # Lines can start with @ to prevent echo
+            (r'^\s*@', Punctuation),
+            (r'^(\s*)(rem\s.*)$', bygroups(Text, Comment)),
+            (r'".*?"', String.Double),
+            (r"'.*?'", String.Single),
+            # If made more specific, make sure you still allow expansions
+            # like %~$VAR:zlt
+            (r'%%?[~$:\w]+%?', Name.Variable),
+            (r'::.*', Comment), # Technically :: only works at BOL
+            (r'(set)(\s+)(\w+)', bygroups(Keyword, Text, Name.Variable)),
+            (r'(call)(\s+)(:\w+)', bygroups(Keyword, Text, Name.Label)),
+            (r'(goto)(\s+)(\w+)', bygroups(Keyword, Text, Name.Label)),
+            (r'\b(set|call|echo|on|off|endlocal|for|do|goto|if|pause|'
+             r'setlocal|shift|errorlevel|exist|defined|cmdextversion|'
+             r'errorlevel|else|cd|md|del|deltree|cls|choice)\b', Keyword),
+            (r'\b(equ|neq|lss|leq|gtr|geq)\b', Operator),
+            include('basic'),
+            (r'.', Text),
+        ],
+        'echo': [
+            # Escapes only valid within echo args?
+            (r'\^\^|\^<|\^>|\^\|', String.Escape),
+            (r'\n', Text, '#pop'),
+            include('basic'),
+            (r'[^\'"^]+', Text),
+        ],
+        'basic': [
+            (r'".*?"', String.Double),
+            (r"'.*?'", String.Single),
+            (r'`.*?`', String.Backtick),
+            (r'-?\d+', Number),
+            (r',', Punctuation),
+            (r'=', Operator),
+            (r'/\S+', Name),
+            (r':\w+', Name.Label),
+            (r'\w:\w+', Text),
+            (r'([<>|])(\s*)(\w+)', bygroups(Punctuation, Text, Name)),
+        ],
+    }
+
+
+class TcshLexer(RegexLexer):
+    """
+    Lexer for tcsh scripts.
+
+    *New in Pygments 0.10.*
+    """
+
+    name = 'Tcsh'
+    aliases = ['tcsh', 'csh']
+    filenames = ['*.tcsh', '*.csh']
+    mimetypes = ['application/x-csh']
+
+    tokens = {
+        'root': [
+            include('basic'),
+            (r'\$\(', Keyword, 'paren'),
+            (r'\${#?', Keyword, 'curly'),
+            (r'`', String.Backtick, 'backticks'),
+            include('data'),
+        ],
+        'basic': [
+            (r'\b(if|endif|else|while|then|foreach|case|default|'
+             r'continue|goto|breaksw|end|switch|endsw)\s*\b',
+             Keyword),
+            (r'\b(alias|alloc|bg|bindkey|break|builtins|bye|caller|cd|chdir|'
+             r'complete|dirs|echo|echotc|eval|exec|exit|fg|filetest|getxvers|'
+             r'glob|getspath|hashstat|history|hup|inlib|jobs|kill|'
+             r'limit|log|login|logout|ls-F|migrate|newgrp|nice|nohup|notify|'
+             r'onintr|popd|printenv|pushd|rehash|repeat|rootnode|popd|pushd|'
+             r'set|shift|sched|setenv|setpath|settc|setty|setxvers|shift|'
+             r'source|stop|suspend|source|suspend|telltc|time|'
+             r'umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|'
+             r'ver|wait|warp|watchlog|where|which)\s*\b',
+             Name.Builtin),
+            (r'#.*\n', Comment),
+            (r'\\[\w\W]', String.Escape),
+            (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)),
+            (r'[\[\]{}()=]+', Operator),
+            (r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
+        ],
+        'data': [
+            (r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
+            (r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
+            (r'\s+', Text),
+            (r'[^=\s\[\]{}()$"\'`\\]+', Text),
+            (r'\d+(?= |\Z)', Number),
+            (r'\$#?(\w+|.)', Name.Variable),
+        ],
+        'curly': [
+            (r'}', Keyword, '#pop'),
+            (r':-', Keyword),
+            (r'[a-zA-Z0-9_]+', Name.Variable),
+            (r'[^}:"\'`$]+', Punctuation),
+            (r':', Punctuation),
+            include('root'),
+        ],
+        'paren': [
+            (r'\)', Keyword, '#pop'),
+            include('root'),
+        ],
+        'backticks': [
+            (r'`', String.Backtick, '#pop'),
+            include('root'),
+        ],
+    }
+
+
+class PowerShellLexer(RegexLexer):
+    """
+    For Windows PowerShell code.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'PowerShell'
+    aliases = ['powershell', 'posh', 'ps1']
+    filenames = ['*.ps1']
+    mimetypes = ['text/x-powershell']
+
+    flags = re.DOTALL | re.IGNORECASE | re.MULTILINE
+
+    keywords = (
+        'while validateset validaterange validatepattern validatelength '
+        'validatecount until trap switch return ref process param parameter in '
+        'if global: function foreach for finally filter end elseif else '
+        'dynamicparam do default continue cmdletbinding break begin alias \\? '
+        '% #script #private #local #global mandatory parametersetname position '
+        'valuefrompipeline valuefrompipelinebypropertyname '
+        'valuefromremainingarguments helpmessage try catch').split()
+
+    operators = (
+        'and as band bnot bor bxor casesensitive ccontains ceq cge cgt cle '
+        'clike clt cmatch cne cnotcontains cnotlike cnotmatch contains '
+        'creplace eq exact f file ge gt icontains ieq ige igt ile ilike ilt '
+        'imatch ine inotcontains inotlike inotmatch ireplace is isnot le like '
+        'lt match ne not notcontains notlike notmatch or regex replace '
+        'wildcard').split()
+
+    verbs = (
+        'write where wait use update unregister undo trace test tee take '
+        'suspend stop start split sort skip show set send select scroll resume '
+        'restore restart resolve resize reset rename remove register receive '
+        'read push pop ping out new move measure limit join invoke import '
+        'group get format foreach export expand exit enter enable disconnect '
+        'disable debug cxnew copy convertto convertfrom convert connect '
+        'complete compare clear checkpoint aggregate add').split()
+
+    commenthelp = (
+        'component description example externalhelp forwardhelpcategory '
+        'forwardhelptargetname functionality inputs link '
+        'notes outputs parameter remotehelprunspace role synopsis').split()
+
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r'^(\s*#[#\s]*)(\.(?:%s))([^\n]*$)' % '|'.join(commenthelp),
+             bygroups(Comment, String.Doc, Comment)),
+            (r'#[^\n]*?$', Comment),
+            (r'(&lt;|<)#', Comment.Multiline, 'multline'),
+            (r'@"\n.*?\n"@', String.Heredoc),
+            (r"@'\n.*?\n'@", String.Heredoc),
+            (r'"', String.Double, 'string'),
+            (r"'([^']|'')*'", String.Single),
+            (r'(\$|@@|@)((global|script|private|env):)?[a-z0-9_]+',
+             Name.Variable),
+            (r'(%s)\b' % '|'.join(keywords), Keyword),
+            (r'-(%s)\b' % '|'.join(operators), Operator),
+            (r'(%s)-[a-z_][a-z0-9_]*\b' % '|'.join(verbs), Name.Builtin),
+            (r'\[[a-z_\[][a-z0-9_. `,\[\]]*\]', Name.Constant),  # .net [type]s
+            (r'-[a-z_][a-z0-9_]*', Name),
+            (r'\w+', Name),
+            (r'[.,{}\[\]$()=+*/\\&%!~?^`|<>-]', Punctuation),
+        ],
+        'multline': [
+            (r'[^#&.]+', Comment.Multiline),
+            (r'#(>|&gt;)', Comment.Multiline, '#pop'),
+            (r'\.(%s)' % '|'.join(commenthelp), String.Doc),
+            (r'[#&.]', Comment.Multiline),
+        ],
+        'string': [
+            (r'[^$`"]+', String.Double),
+            (r'\$\(', String.Interpol, 'interpol'),
+            (r'`"|""', String.Double),
+            (r'[`$]', String.Double),
+            (r'"', String.Double, '#pop'),
+        ],
+        'interpol': [
+            (r'[^$)]+', String.Interpol),
+            (r'\$\(', String.Interpol, '#push'),
+            (r'\)', String.Interpol, '#pop'),
+        ]
+    }
index bd200a7268d5946648ff8be4387a40cf7bab941a..785ab73cf11e70e18766d9b80b2736013d0f6082 100644 (file)
@@ -5,7 +5,7 @@
 
     Special lexers.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
diff --git a/pygments/lexers/sql.py b/pygments/lexers/sql.py
new file mode 100644 (file)
index 0000000..656d29a
--- /dev/null
@@ -0,0 +1,565 @@
+# -*- coding: utf-8 -*-
+"""
+    pygments.lexers.sql
+    ~~~~~~~~~~~~~~~~~~~
+
+    Lexers for various SQL dialects and related interactive sessions.
+
+    Postgres specific lexers:
+
+    `PostgresLexer`
+        A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL
+        lexer are:
+
+        - keywords and data types list parsed from the PG docs (run the
+          `_postgres_builtins` module to update them);
+        - Content of $-strings parsed using a specific lexer, e.g. the content
+          of a PL/Python function is parsed using the Python lexer;
+        - parse PG specific constructs: E-strings, $-strings, U&-strings,
+          different operators and punctuation.
+
+    `PlPgsqlLexer`
+        A lexer for the PL/pgSQL language. Adds a few specific construct on
+        top of the PG SQL lexer (such as <<label>>).
+
+    `PostgresConsoleLexer`
+        A lexer to highlight an interactive psql session:
+
+        - identifies the prompt and does its best to detect the end of command
+          in multiline statement where not all the lines are prefixed by a
+          prompt, telling them apart from the output;
+        - highlights errors in the output and notification levels;
+        - handles psql backslash commands.
+
+    The ``tests/examplefiles`` contains a few test files with data to be
+    parsed by these lexers.
+
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+import re
+from copy import deepcopy
+
+from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups
+from pygments.token import Punctuation, \
+     Text, Comment, Operator, Keyword, Name, String, Number, Generic
+from pygments.lexers import get_lexer_by_name, ClassNotFound
+
+from pygments.lexers._postgres_builtins import KEYWORDS, DATATYPES, \
+     PSEUDO_TYPES, PLPGSQL_KEYWORDS
+
+
+__all__ = ['PostgresLexer', 'PlPgsqlLexer', 'PostgresConsoleLexer',
+           'SqlLexer', 'MySqlLexer', 'SqliteConsoleLexer']
+
+line_re  = re.compile('.*?\n')
+
+language_re = re.compile(r"\s+LANGUAGE\s+'?(\w+)'?", re.IGNORECASE)
+
+def language_callback(lexer, match):
+    """Parse the content of a $-string using a lexer
+
+    The lexer is chosen looking for a nearby LANGUAGE.
+
+    Note: this function should have been a `PostgresBase` method, but the
+    rules deepcopy fails in this case.
+    """
+    l = None
+    m = language_re.match(lexer.text[match.end():match.end()+100])
+    if m is not None:
+        l = lexer._get_lexer(m.group(1))
+    else:
+        m = list(language_re.finditer(
+            lexer.text[max(0, match.start()-100):match.start()]))
+        if m:
+            l = lexer._get_lexer(m[-1].group(1))
+
+    if l:
+        yield (match.start(1), String, match.group(1))
+        for x in l.get_tokens_unprocessed(match.group(2)):
+            yield x
+        yield (match.start(3), String, match.group(3))
+
+    else:
+        yield (match.start(), String, match.group())
+
+
+class PostgresBase(object):
+    """Base class for Postgres-related lexers.
+
+    This is implemented as a mixin to avoid the Lexer metaclass kicking in.
+    this way the different lexer don't have a common Lexer ancestor. If they
+    had, _tokens could be created on this ancestor and not updated for the
+    other classes, resulting e.g. in PL/pgSQL parsed as SQL. This shortcoming
+    seem to suggest that regexp lexers are not really subclassable.
+
+    `language_callback` should really be our method, but this breaks deepcopy.
+    """
+    def get_tokens_unprocessed(self, text, *args):
+        # Have a copy of the entire text to be used by `language_callback`.
+        self.text = text
+        for x in super(PostgresBase, self).get_tokens_unprocessed(
+                text, *args):
+            yield x
+
+    def _get_lexer(self, lang):
+        if lang.lower() == 'sql':
+            return get_lexer_by_name('postgresql', **self.options)
+
+        tries = [ lang ]
+        if lang.startswith('pl'):
+            tries.append(lang[2:])
+        if lang.endswith('u'):
+            tries.append(lang[:-1])
+        if lang.startswith('pl') and lang.endswith('u'):
+            tries.append(lang[2:-1])
+
+        for l in tries:
+            try:
+                return get_lexer_by_name(l, **self.options)
+            except ClassNotFound:
+                pass
+        else:
+            # TODO: better logging
+            # print >>sys.stderr, "language not found:", lang
+            return None
+
+
+class PostgresLexer(PostgresBase, RegexLexer):
+    """
+    Lexer for the PostgreSQL dialect of SQL.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'PostgreSQL SQL dialect'
+    aliases = ['postgresql', 'postgres']
+    mimetypes = ['text/x-postgresql']
+
+    flags = re.IGNORECASE
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r'--.*?\n', Comment.Single),
+            (r'/\*', Comment.Multiline, 'multiline-comments'),
+            (r'(' + '|'.join([s.replace(" ", "\s+")
+                for s in DATATYPES + PSEUDO_TYPES])
+                  + r')\b', Name.Builtin),
+            (r'(' + '|'.join(KEYWORDS) + r')\b', Keyword),
+            (r'[+*/<>=~!@#%^&|`?-]+', Operator),
+            (r'::', Operator),  # cast
+            (r'\$\d+', Name.Variable),
+            (r'([0-9]*\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?', Number.Float),
+            (r'[0-9]+', Number.Integer),
+            (r"(E|U&)?'(''|[^'])*'", String.Single),
+            (r'(U&)?"(""|[^"])*"', String.Name), # quoted identifier
+            (r'(?s)(\$[^\$]*\$)(.*?)(\1)', language_callback),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
+
+            # psql variable in SQL
+            (r""":(['"]?)[a-z][a-z0-9_]*\b\1""", Name.Variable),
+
+            (r'[;:()\[\]\{\},\.]', Punctuation),
+        ],
+        'multiline-comments': [
+            (r'/\*', Comment.Multiline, 'multiline-comments'),
+            (r'\*/', Comment.Multiline, '#pop'),
+            (r'[^/\*]+', Comment.Multiline),
+            (r'[/*]', Comment.Multiline)
+        ],
+    }
+
+
+class PlPgsqlLexer(PostgresBase, RegexLexer):
+    """
+    Handle the extra syntax in Pl/pgSQL language.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'PL/pgSQL'
+    aliases = ['plpgsql']
+    mimetypes = ['text/x-plpgsql']
+
+    flags = re.IGNORECASE
+    tokens = deepcopy(PostgresLexer.tokens)
+
+    # extend the keywords list
+    for i, pattern in enumerate(tokens['root']):
+        if pattern[1] == Keyword:
+            tokens['root'][i] = (
+                r'(' + '|'.join(KEYWORDS + PLPGSQL_KEYWORDS) + r')\b',
+                Keyword)
+            del i
+            break
+    else:
+        assert 0, "SQL keywords not found"
+
+    # Add specific PL/pgSQL rules (before the SQL ones)
+    tokens['root'][:0] = [
+        (r'\%[a-z][a-z0-9_]*\b', Name.Builtin),     # actually, a datatype
+        (r':=', Operator),
+        (r'\<\<[a-z][a-z0-9_]*\>\>', Name.Label),
+        (r'\#[a-z][a-z0-9_]*\b', Keyword.Pseudo),   # #variable_conflict
+    ]
+
+
+class PsqlRegexLexer(PostgresBase, RegexLexer):
+    """
+    Extend the PostgresLexer adding support specific for psql commands.
+
+    This is not a complete psql lexer yet as it lacks prompt support
+    and output rendering.
+    """
+
+    name = 'PostgreSQL console - regexp based lexer'
+    aliases = []    # not public
+
+    flags = re.IGNORECASE
+    tokens = deepcopy(PostgresLexer.tokens)
+
+    tokens['root'].append(
+        (r'\\[^\s]+', Keyword.Pseudo, 'psql-command'))
+    tokens['psql-command'] = [
+        (r'\n', Text, 'root'),
+        (r'\s+', Text),
+        (r'\\[^\s]+', Keyword.Pseudo),
+        (r""":(['"]?)[a-z][a-z0-9_]*\b\1""", Name.Variable),
+        (r"'(''|[^'])*'", String.Single),
+        (r"`([^`])*`", String.Backtick),
+        (r"[^\s]+", String.Symbol),
+    ]
+
+re_prompt = re.compile(r'^(\S.*?)??[=\-\(\$\'\"][#>]')
+re_psql_command = re.compile(r'\s*\\')
+re_end_command = re.compile(r';\s*(--.*?)?$')
+re_psql_command = re.compile(r'(\s*)(\\.+?)(\s+)$')
+re_error = re.compile(r'(ERROR|FATAL):')
+re_message = re.compile(
+    r'((?:DEBUG|INFO|NOTICE|WARNING|ERROR|'
+    r'FATAL|HINT|DETAIL|CONTEXT|LINE [0-9]+):)(.*?\n)')
+
+
+class lookahead(object):
+    """Wrap an iterator and allow pushing back an item."""
+    def __init__(self, x):
+        self.iter = iter(x)
+        self._nextitem = None
+    def __iter__(self):
+        return self
+    def send(self, i):
+        self._nextitem = i
+        return i
+    def next(self):
+        if self._nextitem is not None:
+            ni = self._nextitem
+            self._nextitem = None
+            return ni
+        return self.iter.next()
+
+
+class PostgresConsoleLexer(Lexer):
+    """
+    Lexer for psql sessions.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'PostgreSQL console (psql)'
+    aliases = ['psql', 'postgresql-console', 'postgres-console']
+    mimetypes = ['text/x-postgresql-psql']
+
+    def get_tokens_unprocessed(self, data):
+        sql = PsqlRegexLexer(**self.options)
+
+        lines = lookahead(line_re.findall(data))
+
+        # prompt-output cycle
+        while 1:
+
+            # consume the lines of the command: start with an optional prompt
+            # and continue until the end of command is detected
+            curcode = ''
+            insertions = []
+            while 1:
+                try:
+                    line = lines.next()
+                except StopIteration:
+                    # allow the emission of partially collected items
+                    # the repl loop will be broken below
+                    break
+
+                # Identify a shell prompt in case of psql commandline example
+                if line.startswith('$') and not curcode:
+                    lexer = get_lexer_by_name('console', **self.options)
+                    for x in lexer.get_tokens_unprocessed(line):
+                        yield x
+                    break
+
+                # Identify a psql prompt
+                mprompt = re_prompt.match(line)
+                if mprompt is not None:
+                    insertions.append((len(curcode),
+                                       [(0, Generic.Prompt, mprompt.group())]))
+                    curcode += line[len(mprompt.group()):]
+                else:
+                    curcode += line
+
+                # Check if this is the end of the command
+                # TODO: better handle multiline comments at the end with
+                # a lexer with an external state?
+                if re_psql_command.match(curcode) \
+                or re_end_command.search(curcode):
+                    break
+
+            # Emit the combined stream of command and prompt(s)
+            for item in do_insertions(insertions,
+                    sql.get_tokens_unprocessed(curcode)):
+                yield item
+
+            # Emit the output lines
+            out_token = Generic.Output
+            while 1:
+                line = lines.next()
+                mprompt = re_prompt.match(line)
+                if mprompt is not None:
+                    # push the line back to have it processed by the prompt
+                    lines.send(line)
+                    break
+
+                mmsg = re_message.match(line)
+                if mmsg is not None:
+                    if mmsg.group(1).startswith("ERROR") \
+                    or mmsg.group(1).startswith("FATAL"):
+                        out_token = Generic.Error
+                    yield (mmsg.start(1), Generic.Strong, mmsg.group(1))
+                    yield (mmsg.start(2), out_token, mmsg.group(2))
+                else:
+                    yield (0, out_token, line)
+
+
+class SqlLexer(RegexLexer):
+    """
+    Lexer for Structured Query Language. Currently, this lexer does
+    not recognize any special syntax except ANSI SQL.
+    """
+
+    name = 'SQL'
+    aliases = ['sql']
+    filenames = ['*.sql']
+    mimetypes = ['text/x-sql']
+
+    flags = re.IGNORECASE
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r'--.*?\n', Comment.Single),
+            (r'/\*', Comment.Multiline, 'multiline-comments'),
+            (r'(ABORT|ABS|ABSOLUTE|ACCESS|ADA|ADD|ADMIN|AFTER|AGGREGATE|'
+             r'ALIAS|ALL|ALLOCATE|ALTER|ANALYSE|ANALYZE|AND|ANY|ARE|AS|'
+             r'ASC|ASENSITIVE|ASSERTION|ASSIGNMENT|ASYMMETRIC|AT|ATOMIC|'
+             r'AUTHORIZATION|AVG|BACKWARD|BEFORE|BEGIN|BETWEEN|BITVAR|'
+             r'BIT_LENGTH|BOTH|BREADTH|BY|C|CACHE|CALL|CALLED|CARDINALITY|'
+             r'CASCADE|CASCADED|CASE|CAST|CATALOG|CATALOG_NAME|CHAIN|'
+             r'CHARACTERISTICS|CHARACTER_LENGTH|CHARACTER_SET_CATALOG|'
+             r'CHARACTER_SET_NAME|CHARACTER_SET_SCHEMA|CHAR_LENGTH|CHECK|'
+             r'CHECKED|CHECKPOINT|CLASS|CLASS_ORIGIN|CLOB|CLOSE|CLUSTER|'
+             r'COALSECE|COBOL|COLLATE|COLLATION|COLLATION_CATALOG|'
+             r'COLLATION_NAME|COLLATION_SCHEMA|COLUMN|COLUMN_NAME|'
+             r'COMMAND_FUNCTION|COMMAND_FUNCTION_CODE|COMMENT|COMMIT|'
+             r'COMMITTED|COMPLETION|CONDITION_NUMBER|CONNECT|CONNECTION|'
+             r'CONNECTION_NAME|CONSTRAINT|CONSTRAINTS|CONSTRAINT_CATALOG|'
+             r'CONSTRAINT_NAME|CONSTRAINT_SCHEMA|CONSTRUCTOR|CONTAINS|'
+             r'CONTINUE|CONVERSION|CONVERT|COPY|CORRESPONTING|COUNT|'
+             r'CREATE|CREATEDB|CREATEUSER|CROSS|CUBE|CURRENT|CURRENT_DATE|'
+             r'CURRENT_PATH|CURRENT_ROLE|CURRENT_TIME|CURRENT_TIMESTAMP|'
+             r'CURRENT_USER|CURSOR|CURSOR_NAME|CYCLE|DATA|DATABASE|'
+             r'DATETIME_INTERVAL_CODE|DATETIME_INTERVAL_PRECISION|DAY|'
+             r'DEALLOCATE|DECLARE|DEFAULT|DEFAULTS|DEFERRABLE|DEFERRED|'
+             r'DEFINED|DEFINER|DELETE|DELIMITER|DELIMITERS|DEREF|DESC|'
+             r'DESCRIBE|DESCRIPTOR|DESTROY|DESTRUCTOR|DETERMINISTIC|'
+             r'DIAGNOSTICS|DICTIONARY|DISCONNECT|DISPATCH|DISTINCT|DO|'
+             r'DOMAIN|DROP|DYNAMIC|DYNAMIC_FUNCTION|DYNAMIC_FUNCTION_CODE|'
+             r'EACH|ELSE|ENCODING|ENCRYPTED|END|END-EXEC|EQUALS|ESCAPE|EVERY|'
+             r'EXCEPT|ESCEPTION|EXCLUDING|EXCLUSIVE|EXEC|EXECUTE|EXISTING|'
+             r'EXISTS|EXPLAIN|EXTERNAL|EXTRACT|FALSE|FETCH|FINAL|FIRST|FOR|'
+             r'FORCE|FOREIGN|FORTRAN|FORWARD|FOUND|FREE|FREEZE|FROM|FULL|'
+             r'FUNCTION|G|GENERAL|GENERATED|GET|GLOBAL|GO|GOTO|GRANT|GRANTED|'
+             r'GROUP|GROUPING|HANDLER|HAVING|HIERARCHY|HOLD|HOST|IDENTITY|'
+             r'IGNORE|ILIKE|IMMEDIATE|IMMUTABLE|IMPLEMENTATION|IMPLICIT|IN|'
+             r'INCLUDING|INCREMENT|INDEX|INDITCATOR|INFIX|INHERITS|INITIALIZE|'
+             r'INITIALLY|INNER|INOUT|INPUT|INSENSITIVE|INSERT|INSTANTIABLE|'
+             r'INSTEAD|INTERSECT|INTO|INVOKER|IS|ISNULL|ISOLATION|ITERATE|JOIN|'
+             r'KEY|KEY_MEMBER|KEY_TYPE|LANCOMPILER|LANGUAGE|LARGE|LAST|'
+             r'LATERAL|LEADING|LEFT|LENGTH|LESS|LEVEL|LIKE|LIMIT|LISTEN|LOAD|'
+             r'LOCAL|LOCALTIME|LOCALTIMESTAMP|LOCATION|LOCATOR|LOCK|LOWER|'
+             r'MAP|MATCH|MAX|MAXVALUE|MESSAGE_LENGTH|MESSAGE_OCTET_LENGTH|'
+             r'MESSAGE_TEXT|METHOD|MIN|MINUTE|MINVALUE|MOD|MODE|MODIFIES|'
+             r'MODIFY|MONTH|MORE|MOVE|MUMPS|NAMES|NATIONAL|NATURAL|NCHAR|'
+             r'NCLOB|NEW|NEXT|NO|NOCREATEDB|NOCREATEUSER|NONE|NOT|NOTHING|'
+             r'NOTIFY|NOTNULL|NULL|NULLABLE|NULLIF|OBJECT|OCTET_LENGTH|OF|OFF|'
+             r'OFFSET|OIDS|OLD|ON|ONLY|OPEN|OPERATION|OPERATOR|OPTION|OPTIONS|'
+             r'OR|ORDER|ORDINALITY|OUT|OUTER|OUTPUT|OVERLAPS|OVERLAY|OVERRIDING|'
+             r'OWNER|PAD|PARAMETER|PARAMETERS|PARAMETER_MODE|PARAMATER_NAME|'
+             r'PARAMATER_ORDINAL_POSITION|PARAMETER_SPECIFIC_CATALOG|'
+             r'PARAMETER_SPECIFIC_NAME|PARAMATER_SPECIFIC_SCHEMA|PARTIAL|'
+             r'PASCAL|PENDANT|PLACING|PLI|POSITION|POSTFIX|PRECISION|PREFIX|'
+             r'PREORDER|PREPARE|PRESERVE|PRIMARY|PRIOR|PRIVILEGES|PROCEDURAL|'
+             r'PROCEDURE|PUBLIC|READ|READS|RECHECK|RECURSIVE|REF|REFERENCES|'
+             r'REFERENCING|REINDEX|RELATIVE|RENAME|REPEATABLE|REPLACE|RESET|'
+             r'RESTART|RESTRICT|RESULT|RETURN|RETURNED_LENGTH|'
+             r'RETURNED_OCTET_LENGTH|RETURNED_SQLSTATE|RETURNS|REVOKE|RIGHT|'
+             r'ROLE|ROLLBACK|ROLLUP|ROUTINE|ROUTINE_CATALOG|ROUTINE_NAME|'
+             r'ROUTINE_SCHEMA|ROW|ROWS|ROW_COUNT|RULE|SAVE_POINT|SCALE|SCHEMA|'
+             r'SCHEMA_NAME|SCOPE|SCROLL|SEARCH|SECOND|SECURITY|SELECT|SELF|'
+             r'SENSITIVE|SERIALIZABLE|SERVER_NAME|SESSION|SESSION_USER|SET|'
+             r'SETOF|SETS|SHARE|SHOW|SIMILAR|SIMPLE|SIZE|SOME|SOURCE|SPACE|'
+             r'SPECIFIC|SPECIFICTYPE|SPECIFIC_NAME|SQL|SQLCODE|SQLERROR|'
+             r'SQLEXCEPTION|SQLSTATE|SQLWARNINIG|STABLE|START|STATE|STATEMENT|'
+             r'STATIC|STATISTICS|STDIN|STDOUT|STORAGE|STRICT|STRUCTURE|STYPE|'
+             r'SUBCLASS_ORIGIN|SUBLIST|SUBSTRING|SUM|SYMMETRIC|SYSID|SYSTEM|'
+             r'SYSTEM_USER|TABLE|TABLE_NAME| TEMP|TEMPLATE|TEMPORARY|TERMINATE|'
+             r'THAN|THEN|TIMESTAMP|TIMEZONE_HOUR|TIMEZONE_MINUTE|TO|TOAST|'
+             r'TRAILING|TRANSATION|TRANSACTIONS_COMMITTED|'
+             r'TRANSACTIONS_ROLLED_BACK|TRANSATION_ACTIVE|TRANSFORM|'
+             r'TRANSFORMS|TRANSLATE|TRANSLATION|TREAT|TRIGGER|TRIGGER_CATALOG|'
+             r'TRIGGER_NAME|TRIGGER_SCHEMA|TRIM|TRUE|TRUNCATE|TRUSTED|TYPE|'
+             r'UNCOMMITTED|UNDER|UNENCRYPTED|UNION|UNIQUE|UNKNOWN|UNLISTEN|'
+             r'UNNAMED|UNNEST|UNTIL|UPDATE|UPPER|USAGE|USER|'
+             r'USER_DEFINED_TYPE_CATALOG|USER_DEFINED_TYPE_NAME|'
+             r'USER_DEFINED_TYPE_SCHEMA|USING|VACUUM|VALID|VALIDATOR|VALUES|'
+             r'VARIABLE|VERBOSE|VERSION|VIEW|VOLATILE|WHEN|WHENEVER|WHERE|'
+             r'WITH|WITHOUT|WORK|WRITE|YEAR|ZONE)\b', Keyword),
+            (r'(ARRAY|BIGINT|BINARY|BIT|BLOB|BOOLEAN|CHAR|CHARACTER|DATE|'
+             r'DEC|DECIMAL|FLOAT|INT|INTEGER|INTERVAL|NUMBER|NUMERIC|REAL|'
+             r'SERIAL|SMALLINT|VARCHAR|VARYING|INT8|SERIAL8|TEXT)\b',
+             Name.Builtin),
+            (r'[+*/<>=~!@#%^&|`?-]', Operator),
+            (r'[0-9]+', Number.Integer),
+            # TODO: Backslash escapes?
+            (r"'(''|[^'])*'", String.Single),
+            (r'"(""|[^"])*"', String.Symbol), # not a real string literal in ANSI SQL
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            (r'[;:()\[\],\.]', Punctuation)
+        ],
+        'multiline-comments': [
+            (r'/\*', Comment.Multiline, 'multiline-comments'),
+            (r'\*/', Comment.Multiline, '#pop'),
+            (r'[^/\*]+', Comment.Multiline),
+            (r'[/*]', Comment.Multiline)
+        ]
+    }
+
+
+class MySqlLexer(RegexLexer):
+    """
+    Special lexer for MySQL.
+    """
+
+    name = 'MySQL'
+    aliases = ['mysql']
+    mimetypes = ['text/x-mysql']
+
+    flags = re.IGNORECASE
+    tokens = {
+        'root': [
+            (r'\s+', Text),
+            (r'(#|--\s+).*?\n', Comment.Single),
+            (r'/\*', Comment.Multiline, 'multiline-comments'),
+            (r'[0-9]+', Number.Integer),
+            (r'[0-9]*\.[0-9]+(e[+-][0-9]+)', Number.Float),
+            # TODO: add backslash escapes
+            (r"'(''|[^'])*'", String.Single),
+            (r'"(""|[^"])*"', String.Double),
+            (r"`(``|[^`])*`", String.Symbol),
+            (r'[+*/<>=~!@#%^&|`?-]', Operator),
+            (r'\b(tinyint|smallint|mediumint|int|integer|bigint|date|'
+             r'datetime|time|bit|bool|tinytext|mediumtext|longtext|text|'
+             r'tinyblob|mediumblob|longblob|blob|float|double|double\s+'
+             r'precision|real|numeric|dec|decimal|timestamp|year|char|'
+             r'varchar|varbinary|varcharacter|enum|set)(\b\s*)(\()?',
+             bygroups(Keyword.Type, Text, Punctuation)),
+            (r'\b(add|all|alter|analyze|and|as|asc|asensitive|before|between|'
+             r'bigint|binary|blob|both|by|call|cascade|case|change|char|'
+             r'character|check|collate|column|condition|constraint|continue|'
+             r'convert|create|cross|current_date|current_time|'
+             r'current_timestamp|current_user|cursor|database|databases|'
+             r'day_hour|day_microsecond|day_minute|day_second|dec|decimal|'
+             r'declare|default|delayed|delete|desc|describe|deterministic|'
+             r'distinct|distinctrow|div|double|drop|dual|each|else|elseif|'
+             r'enclosed|escaped|exists|exit|explain|fetch|float|float4|float8'
+             r'|for|force|foreign|from|fulltext|grant|group|having|'
+             r'high_priority|hour_microsecond|hour_minute|hour_second|if|'
+             r'ignore|in|index|infile|inner|inout|insensitive|insert|int|'
+             r'int1|int2|int3|int4|int8|integer|interval|into|is|iterate|'
+             r'join|key|keys|kill|leading|leave|left|like|limit|lines|load|'
+             r'localtime|localtimestamp|lock|long|loop|low_priority|match|'
+             r'minute_microsecond|minute_second|mod|modifies|natural|'
+             r'no_write_to_binlog|not|numeric|on|optimize|option|optionally|'
+             r'or|order|out|outer|outfile|precision|primary|procedure|purge|'
+             r'raid0|read|reads|real|references|regexp|release|rename|repeat|'
+             r'replace|require|restrict|return|revoke|right|rlike|schema|'
+             r'schemas|second_microsecond|select|sensitive|separator|set|'
+             r'show|smallint|soname|spatial|specific|sql|sql_big_result|'
+             r'sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|'
+             r'sqlwarning|ssl|starting|straight_join|table|terminated|then|'
+             r'to|trailing|trigger|undo|union|unique|unlock|unsigned|update|'
+             r'usage|use|using|utc_date|utc_time|utc_timestamp|values|'
+             r'varying|when|where|while|with|write|x509|xor|year_month|'
+             r'zerofill)\b', Keyword),
+            # TODO: this list is not complete
+            (r'\b(auto_increment|engine|charset|tables)\b', Keyword.Pseudo),
+            (r'(true|false|null)', Name.Constant),
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\()',
+             bygroups(Name.Function, Text, Punctuation)),
+            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            (r'@[A-Za-z0-9]*[._]*[A-Za-z0-9]*', Name.Variable),
+            (r'[;:()\[\],\.]', Punctuation)
+        ],
+        'multiline-comments': [
+            (r'/\*', Comment.Multiline, 'multiline-comments'),
+            (r'\*/', Comment.Multiline, '#pop'),
+            (r'[^/\*]+', Comment.Multiline),
+            (r'[/*]', Comment.Multiline)
+        ]
+    }
+
+
+class SqliteConsoleLexer(Lexer):
+    """
+    Lexer for example sessions using sqlite3.
+
+    *New in Pygments 0.11.*
+    """
+
+    name = 'sqlite3con'
+    aliases = ['sqlite3']
+    filenames = ['*.sqlite3-console']
+    mimetypes = ['text/x-sqlite3-console']
+
+    def get_tokens_unprocessed(self, data):
+        sql = SqlLexer(**self.options)
+
+        curcode = ''
+        insertions = []
+        for match in line_re.finditer(data):
+            line = match.group()
+            if line.startswith('sqlite> ') or line.startswith('   ...> '):
+                insertions.append((len(curcode),
+                                   [(0, Generic.Prompt, line[:8])]))
+                curcode += line[8:]
+            else:
+                if curcode:
+                    for item in do_insertions(insertions,
+                                              sql.get_tokens_unprocessed(curcode)):
+                        yield item
+                    curcode = ''
+                    insertions = []
+                if line.startswith('SQL error: '):
+                    yield (match.start(), Generic.Traceback, line)
+                else:
+                    yield (match.start(), Generic.Output, line)
+        if curcode:
+            for item in do_insertions(insertions,
+                                      sql.get_tokens_unprocessed(curcode)):
+                yield item
index 458bcaa4284c4688717172d7dfa1b76e8b81c5e6..84850728100cafd66d5588492ed94ec0a5e97111 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for various template engines' markup.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -15,6 +15,7 @@ from pygments.lexers.web import \
      PhpLexer, HtmlLexer, XmlLexer, JavascriptLexer, CssLexer
 from pygments.lexers.agile import PythonLexer, PerlLexer
 from pygments.lexers.compiled import JavaLexer
+from pygments.lexers.jvm import TeaLangLexer
 from pygments.lexer import Lexer, DelegatingLexer, RegexLexer, bygroups, \
      include, using, this
 from pygments.token import Error, Punctuation, \
@@ -33,11 +34,10 @@ __all__ = ['HtmlPhpLexer', 'XmlPhpLexer', 'CssPhpLexer',
            'MyghtyCssLexer', 'MyghtyJavascriptLexer', 'MasonLexer', 'MakoLexer',
            'MakoHtmlLexer', 'MakoXmlLexer', 'MakoJavascriptLexer',
            'MakoCssLexer', 'JspLexer', 'CheetahLexer', 'CheetahHtmlLexer',
-           'CheetahXmlLexer', 'CheetahJavascriptLexer',
-           'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer',
-           'ColdfusionLexer', 'ColdfusionHtmlLexer',
-           'VelocityLexer', 'VelocityHtmlLexer', 'VelocityXmlLexer',
-           'SspLexer']
+           'CheetahXmlLexer', 'CheetahJavascriptLexer', 'EvoqueLexer',
+           'EvoqueHtmlLexer', 'EvoqueXmlLexer', 'ColdfusionLexer',
+           'ColdfusionHtmlLexer', 'VelocityLexer', 'VelocityHtmlLexer',
+           'VelocityXmlLexer', 'SspLexer', 'TeaTemplateLexer']
 
 
 class ErbLexer(Lexer):
@@ -168,7 +168,7 @@ class SmartyLexer(RegexLexer):
             (r'#[a-zA-Z_][a-zA-Z0-9_]*#', Name.Variable),
             (r'\$[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)*', Name.Variable),
             (r'[~!%^&*()+=|\[\]:;,.<>/?{}@-]', Operator),
-            ('(true|false|null)\b', Keyword.Constant),
+            (r'(true|false|null)\b', Keyword.Constant),
             (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
              r"0[xX][0-9a-fA-F]+[Ll]?", Number),
             (r'"(\\\\|\\"|[^"])*"', String.Double),
@@ -406,11 +406,11 @@ class MyghtyLexer(RegexLexer):
     tokens = {
         'root': [
             (r'\s+', Text),
-            (r'(<%(def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
-             bygroups(Name.Tag, None, Text, Name.Function, Name.Tag,
+            (r'(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
+             bygroups(Name.Tag, Text, Name.Function, Name.Tag,
                       using(this), Name.Tag)),
-            (r'(<%(\w+))(.*?)(>)(.*?)(</%\2\s*>)(?s)',
-             bygroups(Name.Tag, None, Name.Function, Name.Tag,
+            (r'(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
+             bygroups(Name.Tag, Name.Function, Name.Tag,
                       using(PythonLexer), Name.Tag)),
             (r'(<&[^|])(.*?)(,.*?)?(&>)',
              bygroups(Name.Tag, Name.Function, using(PythonLexer), Name.Tag)),
@@ -525,11 +525,11 @@ class MasonLexer(RegexLexer):
             (r'\s+', Text),
             (r'(<%doc>)(.*?)(</%doc>)(?s)',
              bygroups(Name.Tag, Comment.Multiline, Name.Tag)),
-            (r'(<%(def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
-             bygroups(Name.Tag, None, Text, Name.Function, Name.Tag,
+            (r'(<%(?:def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
+             bygroups(Name.Tag, Text, Name.Function, Name.Tag,
                       using(this), Name.Tag)),
-            (r'(<%(\w+))(.*?)(>)(.*?)(</%\2\s*>)(?s)',
-             bygroups(Name.Tag, None, Name.Function, Name.Tag,
+            (r'(<%\w+)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
+             bygroups(Name.Tag, Name.Function, Name.Tag,
                       using(PerlLexer), Name.Tag)),
             (r'(<&[^|])(.*?)(,.*?)?(&>)(?s)',
              bygroups(Name.Tag, Name.Function, using(PerlLexer), Name.Tag)),
@@ -616,8 +616,8 @@ class MakoLexer(RegexLexer):
             include('tag'),
         ],
         'tag': [
-            (r'((?:\w+)\s*=)\s*(".*?")',
-             bygroups(Name.Attribute, String)),
+            (r'((?:\w+)\s*=)(\s*)(".*?")',
+             bygroups(Name.Attribute, Text, String)),
             (r'/?\s*>', Comment.Preproc, '#pop'),
             (r'\s+', Text),
         ],
@@ -1403,7 +1403,7 @@ class EvoqueLexer(RegexLexer):
             # directives: begin, end
             (r'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})',
              bygroups(Punctuation, Name.Builtin, Punctuation, None,
-                      String, Punctuation, None)),
+                      String, Punctuation)),
             # directives: evoque, overlay
             # see doc for handling first name arg: /directives/evoque/
             #+ minor inconsistency: the "name" in e.g. $overlay{name=site_base}
@@ -1411,17 +1411,17 @@ class EvoqueLexer(RegexLexer):
             (r'(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+[^=,%}]+?)?'
              r'(.*?)((?(4)%)\})',
              bygroups(Punctuation, Name.Builtin, Punctuation, None,
-                      String, using(PythonLexer), Punctuation, None)),
+                      String, using(PythonLexer), Punctuation)),
             # directives: if, for, prefer, test
             (r'(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})',
              bygroups(Punctuation, Name.Builtin, Punctuation, None,
-                      using(PythonLexer), Punctuation, None)),
+                      using(PythonLexer), Punctuation)),
             # directive clauses (no {} expression)
             (r'(\$)(else|rof|fi)', bygroups(Punctuation, Name.Builtin)),
             # expressions
             (r'(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})',
              bygroups(Punctuation, None, using(PythonLexer),
-                      Name.Builtin, None, None, Punctuation, None)),
+                      Name.Builtin, None, None, Punctuation)),
             (r'#', Other),
         ],
         'comment': [
@@ -1489,7 +1489,8 @@ class ColdfusionLexer(RegexLexer):
             (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_.]*)(\s*)(\()',
+             bygroups(Name.Function, Text, Punctuation)),
             (r'[A-Za-z_$][A-Za-z0-9_.]*', Name.Variable),
             (r'[()\[\]{};:,.\\]', Punctuation),
             (r'\s+', Text),
@@ -1581,3 +1582,49 @@ class SspLexer(DelegatingLexer):
         if '<%' in text and '%>' in text:
             rv += 0.1
         return rv
+
+
+class TeaTemplateRootLexer(RegexLexer):
+    """
+    Base for the `TeaTemplateLexer`. Yields `Token.Other` for area outside of
+    code blocks.
+
+    *New in Pygments 1.5.*
+    """
+
+    tokens = {
+        'root': [
+            (r'<%\S?', Keyword, 'sec'),
+            (r'[^<]+', Other),
+            (r'<', Other),
+            ],
+        'sec': [
+            (r'%>', Keyword, '#pop'),
+            # note: '\w\W' != '.' without DOTALL.
+            (r'[\w\W]+?(?=%>|\Z)', using(TeaLangLexer)),
+            ],
+        }
+
+
+class TeaTemplateLexer(DelegatingLexer):
+    """
+    Lexer for `Tea Templates <http://teatrove.org/>`_.
+
+    *New in Pygments 1.5.*
+    """
+    name = 'Tea'
+    aliases = ['tea']
+    filenames = ['*.tea']
+    mimetypes = ['text/x-tea']
+
+    def __init__(self, **options):
+        super(TeaTemplateLexer, self).__init__(XmlLexer,
+                                               TeaTemplateRootLexer, **options)
+
+    def analyse_text(text):
+        rv = TeaLangLexer.analyse_text(text) - 0.01
+        if looks_like_xml(text):
+            rv += 0.4
+        if '<%' in text and '%>' in text:
+            rv += 0.1
+        return rv
index 5a63e5034ee659a86f7f1e90a67ce1fb25f3e0a0..0796312f40de154508b940b43ccf216df9a5ad2b 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for non-source code file types.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -16,7 +16,7 @@ from pygments.lexer import Lexer, LexerContext, RegexLexer, ExtendedRegexLexer,
      bygroups, include, using, this, do_insertions
 from pygments.token import Punctuation, Text, Comment, Keyword, Name, String, \
      Generic, Operator, Number, Whitespace, Literal
-from pygments.util import get_bool_opt
+from pygments.util import get_bool_opt, ClassNotFound
 from pygments.lexers.other import BashLexer
 
 __all__ = ['IniLexer', 'PropertiesLexer', 'SourcesListLexer', 'BaseMakefileLexer',
@@ -24,7 +24,8 @@ __all__ = ['IniLexer', 'PropertiesLexer', 'SourcesListLexer', 'BaseMakefileLexer
            'GroffLexer', 'ApacheConfLexer', 'BBCodeLexer', 'MoinWikiLexer',
            'RstLexer', 'VimLexer', 'GettextLexer', 'SquidConfLexer',
            'DebianControlLexer', 'DarcsPatchLexer', 'YamlLexer',
-           'LighttpdConfLexer', 'NginxConfLexer', 'CMakeLexer']
+           'LighttpdConfLexer', 'NginxConfLexer', 'CMakeLexer', 'HttpLexer',
+           'PyPyLogLexer']
 
 
 class IniLexer(RegexLexer):
@@ -171,7 +172,7 @@ class BaseMakefileLexer(RegexLexer):
     *New in Pygments 0.10.*
     """
 
-    name = 'Makefile'
+    name = 'Base Makefile'
     aliases = ['basemake']
     filenames = []
     mimetypes = []
@@ -291,12 +292,12 @@ class DarcsPatchLexer(RegexLexer):
         'insert': [
             include('specialText'),
             (r'\[', Generic.Inserted),
-            (r'[^\n\[]*', Generic.Inserted),
+            (r'[^\n\[]+', Generic.Inserted),
         ],
         'delete': [
             include('specialText'),
             (r'\[', Generic.Deleted),
-            (r'[^\n\[]*', Generic.Deleted),
+            (r'[^\n\[]+', Generic.Deleted),
         ],
     }
 
@@ -345,18 +346,18 @@ class IrcLogsLexer(RegexLexer):
             # /me msgs
             ("^" + timestamp + r"""
                 (\s*[*]\s+)            # Star
-                ([^\s]+\s+.*?\n)       # Nick + rest of message """,
+                (\S+\s+.*?\n)          # Nick + rest of message """,
              bygroups(Comment.Preproc, Keyword, Generic.Inserted)),
             # join/part msgs
             ("^" + timestamp + r"""
                 (\s*(?:\*{3}|<?-[!@=P]?->?)\s*)  # Star(s) or symbols
-                ([^\s]+\s+)                     # Nick + Space
+                (\S+\s+)                     # Nick + Space
                 (.*?\n)                         # Rest of message """,
              bygroups(Comment.Preproc, Keyword, String, Comment)),
             (r"^.*?\n", Text),
         ],
         'msg': [
-            (r"[^\s]+:(?!//)", Name.Attribute),  # Prefix
+            (r"\S+:(?!//)", Name.Attribute),  # Prefix
             (r".*\n", Text, '#pop'),
         ],
     }
@@ -467,7 +468,7 @@ class GroffLexer(RegexLexer):
 
     tokens = {
         'root': [
-            (r'(?i)(\.)(\w+)', bygroups(Text, Keyword), 'request'),
+            (r'(\.)(\w+)', bygroups(Text, Keyword), 'request'),
             (r'\.', Punctuation, 'request'),
             # Regular characters, slurp till we find a backslash or newline
             (r'[^\\\n]*', Text, 'textline'),
@@ -481,7 +482,7 @@ class GroffLexer(RegexLexer):
             # groff has many ways to write escapes.
             (r'\\"[^\n]*', Comment),
             (r'\\[fn]\w', String.Escape),
-            (r'\\\(..', String.Escape),
+            (r'\\\(.{2}', String.Escape),
             (r'\\.\[.*\]', String.Escape),
             (r'\\.', String.Escape),
             (r'\\\n', Text, 'request'),
@@ -613,7 +614,6 @@ class RstLexer(RegexLexer):
 
     def _handle_sourcecode(self, match):
         from pygments.lexers import get_lexer_by_name
-        from pygments.util import ClassNotFound
 
         # section header
         yield match.start(1), Punctuation, match.group(1)
@@ -653,6 +653,13 @@ class RstLexer(RegexLexer):
         for item in do_insertions(ins, lexer.get_tokens_unprocessed(code)):
             yield item
 
+    # from docutils.parsers.rst.states
+    closers = u'\'")]}>\u2019\u201d\xbb!?'
+    unicode_delimiters = u'\u2010\u2011\u2012\u2013\u2014\u00a0'
+    end_string_suffix = (r'((?=$)|(?=[-/:.,; \n\x00%s%s]))'
+                         % (re.escape(unicode_delimiters),
+                            re.escape(closers)))
+
     tokens = {
         'root': [
             # Heading with overline
@@ -689,9 +696,9 @@ class RstLexer(RegexLexer):
              bygroups(Punctuation, Text, Operator.Word, Punctuation, Text,
                       using(this, state='inline'))),
             # A reference target
-            (r'^( *\.\.)(\s*)([\w\t ]+:)(.*?)$',
+            (r'^( *\.\.)(\s*)(_(?:[^:\\]|\\.)+:)(.*?)$',
              bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
-            # A footnote target
+            # A footnote/citation target
             (r'^( *\.\.)(\s*)(\[.+\])(.*?)$',
              bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
             # A substitution def
@@ -730,10 +737,9 @@ class RstLexer(RegexLexer):
             (r'.', Text),
         ],
         'literal': [
-            (r'[^`\\]+', String),
-            (r'\\.', String),
-            (r'``', String, '#pop'),
-            (r'[`\\]', String),
+            (r'[^`]+', String),
+            (r'``' + end_string_suffix, String, '#pop'),
+            (r'`', String),
         ]
     }
 
@@ -761,21 +767,23 @@ class VimLexer(RegexLexer):
     """
     name = 'VimL'
     aliases = ['vim']
-    filenames = ['*.vim', '.vimrc']
+    filenames = ['*.vim', '.vimrc', '.exrc', '.gvimrc',
+                 '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc']
     mimetypes = ['text/x-vim']
     flags = re.MULTILINE
 
     tokens = {
         'root': [
-            # Who decided that doublequote was a good comment character??
             (r'^\s*".*', Comment),
-            (r'(?<=\s)"[^\-:.%#=*].*', Comment),
 
             (r'[ \t]+', Text),
             # TODO: regexes can have other delims
             (r'/(\\\\|\\/|[^\n/])*/', String.Regex),
             (r'"(\\\\|\\"|[^\n"])*"', String.Double),
             (r"'(\\\\|\\'|[^\n'])*'", String.Single),
+
+            # Who decided that doublequote was a good comment character??
+            (r'(?<=\s)"[^\-:.%#=*].*', Comment),
             (r'-?\d+', Number),
             (r'#[0-9a-f]{6}', Number.Hex),
             (r'^:', Punctuation),
@@ -876,106 +884,106 @@ class SquidConfLexer(RegexLexer):
     mimetypes = ['text/x-squidconf']
     flags = re.IGNORECASE
 
-    keywords = [ "acl", "always_direct", "announce_host",
-                 "announce_period", "announce_port", "announce_to",
-                 "anonymize_headers", "append_domain", "as_whois_server",
-                 "auth_param_basic", "authenticate_children",
-                 "authenticate_program", "authenticate_ttl", "broken_posts",
-                 "buffered_logs", "cache_access_log", "cache_announce",
-                 "cache_dir", "cache_dns_program", "cache_effective_group",
-                 "cache_effective_user", "cache_host", "cache_host_acl",
-                 "cache_host_domain", "cache_log", "cache_mem",
-                 "cache_mem_high", "cache_mem_low", "cache_mgr",
-                 "cachemgr_passwd", "cache_peer", "cache_peer_access",
-                 "cahce_replacement_policy", "cache_stoplist",
-                 "cache_stoplist_pattern", "cache_store_log", "cache_swap",
-                 "cache_swap_high", "cache_swap_log", "cache_swap_low",
-                 "client_db", "client_lifetime", "client_netmask",
-                 "connect_timeout", "coredump_dir", "dead_peer_timeout",
-                 "debug_options", "delay_access", "delay_class",
-                 "delay_initial_bucket_level", "delay_parameters",
-                 "delay_pools", "deny_info", "dns_children", "dns_defnames",
-                 "dns_nameservers", "dns_testnames", "emulate_httpd_log",
-                 "err_html_text", "fake_user_agent", "firewall_ip",
-                 "forwarded_for", "forward_snmpd_port", "fqdncache_size",
-                 "ftpget_options", "ftpget_program", "ftp_list_width",
-                 "ftp_passive", "ftp_user", "half_closed_clients",
-                 "header_access", "header_replace", "hierarchy_stoplist",
-                 "high_response_time_warning", "high_page_fault_warning",
-                 "htcp_port", "http_access", "http_anonymizer", "httpd_accel",
-                 "httpd_accel_host", "httpd_accel_port",
-                 "httpd_accel_uses_host_header", "httpd_accel_with_proxy",
-                 "http_port", "http_reply_access", "icp_access",
-                 "icp_hit_stale", "icp_port", "icp_query_timeout",
-                 "ident_lookup", "ident_lookup_access", "ident_timeout",
-                 "incoming_http_average", "incoming_icp_average",
-                 "inside_firewall", "ipcache_high", "ipcache_low",
-                 "ipcache_size", "local_domain", "local_ip", "logfile_rotate",
-                 "log_fqdn", "log_icp_queries", "log_mime_hdrs",
-                 "maximum_object_size", "maximum_single_addr_tries",
-                 "mcast_groups", "mcast_icp_query_timeout", "mcast_miss_addr",
-                 "mcast_miss_encode_key", "mcast_miss_port", "memory_pools",
-                 "memory_pools_limit", "memory_replacement_policy",
-                 "mime_table", "min_http_poll_cnt", "min_icp_poll_cnt",
-                 "minimum_direct_hops", "minimum_object_size",
-                 "minimum_retry_timeout", "miss_access", "negative_dns_ttl",
-                 "negative_ttl", "neighbor_timeout", "neighbor_type_domain",
-                 "netdb_high", "netdb_low", "netdb_ping_period",
-                 "netdb_ping_rate", "never_direct", "no_cache",
-                 "passthrough_proxy", "pconn_timeout", "pid_filename",
-                 "pinger_program", "positive_dns_ttl", "prefer_direct",
-                 "proxy_auth", "proxy_auth_realm", "query_icmp", "quick_abort",
-                 "quick_abort", "quick_abort_max", "quick_abort_min",
-                 "quick_abort_pct", "range_offset_limit", "read_timeout",
-                 "redirect_children", "redirect_program",
-                 "redirect_rewrites_host_header", "reference_age",
-                 "reference_age", "refresh_pattern", "reload_into_ims",
-                 "request_body_max_size", "request_size", "request_timeout",
-                 "shutdown_lifetime", "single_parent_bypass",
-                 "siteselect_timeout", "snmp_access", "snmp_incoming_address",
-                 "snmp_port", "source_ping", "ssl_proxy",
-                 "store_avg_object_size", "store_objects_per_bucket",
-                 "strip_query_terms", "swap_level1_dirs", "swap_level2_dirs",
-                 "tcp_incoming_address", "tcp_outgoing_address",
-                 "tcp_recv_bufsize", "test_reachability", "udp_hit_obj",
-                 "udp_hit_obj_size", "udp_incoming_address",
-                 "udp_outgoing_address", "unique_hostname", "unlinkd_program",
-                 "uri_whitespace", "useragent_log", "visible_hostname",
-                 "wais_relay", "wais_relay_host", "wais_relay_port",
-                 ]
-
-    opts = [ "proxy-only", "weight", "ttl", "no-query", "default",
-             "round-robin", "multicast-responder", "on", "off", "all",
-             "deny", "allow", "via", "parent", "no-digest", "heap", "lru",
-             "realm", "children", "credentialsttl", "none", "disable",
-             "offline_toggle", "diskd", "q1", "q2",
-             ]
-
-    actions = [ "shutdown", "info", "parameter", "server_list",
-                "client_list", r'squid\.conf',
-                ]
-
-    actions_stats = [ "objects", "vm_objects", "utilization",
-                      "ipcache", "fqdncache", "dns", "redirector", "io",
-                      "reply_headers", "filedescriptors", "netdb",
-                      ]
-
-    actions_log = [ "status", "enable", "disable", "clear"]
-
-    acls = [ "url_regex", "urlpath_regex", "referer_regex", "port",
-             "proto", "req_mime_type", "rep_mime_type", "method",
-             "browser", "user", "src", "dst", "time", "dstdomain", "ident",
-             "snmp_community",
-             ]
-
-    ip_re = r'\b(?:\d{1,3}\.){3}\d{1,3}\b'
+    keywords = [
+        "access_log", "acl", "always_direct", "announce_host",
+        "announce_period", "announce_port", "announce_to", "anonymize_headers",
+        "append_domain", "as_whois_server", "auth_param_basic",
+        "authenticate_children", "authenticate_program", "authenticate_ttl",
+        "broken_posts", "buffered_logs", "cache_access_log", "cache_announce",
+        "cache_dir", "cache_dns_program", "cache_effective_group",
+        "cache_effective_user", "cache_host", "cache_host_acl",
+        "cache_host_domain", "cache_log", "cache_mem", "cache_mem_high",
+        "cache_mem_low", "cache_mgr", "cachemgr_passwd", "cache_peer",
+        "cache_peer_access", "cahce_replacement_policy", "cache_stoplist",
+        "cache_stoplist_pattern", "cache_store_log", "cache_swap",
+        "cache_swap_high", "cache_swap_log", "cache_swap_low", "client_db",
+        "client_lifetime", "client_netmask", "connect_timeout", "coredump_dir",
+        "dead_peer_timeout", "debug_options", "delay_access", "delay_class",
+        "delay_initial_bucket_level", "delay_parameters", "delay_pools",
+        "deny_info", "dns_children", "dns_defnames", "dns_nameservers",
+        "dns_testnames", "emulate_httpd_log", "err_html_text",
+        "fake_user_agent", "firewall_ip", "forwarded_for", "forward_snmpd_port",
+        "fqdncache_size", "ftpget_options", "ftpget_program", "ftp_list_width",
+        "ftp_passive", "ftp_user", "half_closed_clients", "header_access",
+        "header_replace", "hierarchy_stoplist", "high_response_time_warning",
+        "high_page_fault_warning", "hosts_file", "htcp_port", "http_access",
+        "http_anonymizer", "httpd_accel", "httpd_accel_host",
+        "httpd_accel_port", "httpd_accel_uses_host_header",
+        "httpd_accel_with_proxy", "http_port", "http_reply_access",
+        "icp_access", "icp_hit_stale", "icp_port", "icp_query_timeout",
+        "ident_lookup", "ident_lookup_access", "ident_timeout",
+        "incoming_http_average", "incoming_icp_average", "inside_firewall",
+        "ipcache_high", "ipcache_low", "ipcache_size", "local_domain",
+        "local_ip", "logfile_rotate", "log_fqdn", "log_icp_queries",
+        "log_mime_hdrs", "maximum_object_size", "maximum_single_addr_tries",
+        "mcast_groups", "mcast_icp_query_timeout", "mcast_miss_addr",
+        "mcast_miss_encode_key", "mcast_miss_port", "memory_pools",
+        "memory_pools_limit", "memory_replacement_policy", "mime_table",
+        "min_http_poll_cnt", "min_icp_poll_cnt", "minimum_direct_hops",
+        "minimum_object_size", "minimum_retry_timeout", "miss_access",
+        "negative_dns_ttl", "negative_ttl", "neighbor_timeout",
+        "neighbor_type_domain", "netdb_high", "netdb_low", "netdb_ping_period",
+        "netdb_ping_rate", "never_direct", "no_cache", "passthrough_proxy",
+        "pconn_timeout", "pid_filename", "pinger_program", "positive_dns_ttl",
+        "prefer_direct", "proxy_auth", "proxy_auth_realm", "query_icmp",
+        "quick_abort", "quick_abort", "quick_abort_max", "quick_abort_min",
+        "quick_abort_pct", "range_offset_limit", "read_timeout",
+        "redirect_children", "redirect_program",
+        "redirect_rewrites_host_header", "reference_age", "reference_age",
+        "refresh_pattern", "reload_into_ims", "request_body_max_size",
+        "request_size", "request_timeout", "shutdown_lifetime",
+        "single_parent_bypass", "siteselect_timeout", "snmp_access",
+        "snmp_incoming_address", "snmp_port", "source_ping", "ssl_proxy",
+        "store_avg_object_size", "store_objects_per_bucket",
+        "strip_query_terms", "swap_level1_dirs", "swap_level2_dirs",
+        "tcp_incoming_address", "tcp_outgoing_address", "tcp_recv_bufsize",
+        "test_reachability", "udp_hit_obj", "udp_hit_obj_size",
+        "udp_incoming_address", "udp_outgoing_address", "unique_hostname",
+        "unlinkd_program", "uri_whitespace", "useragent_log",
+        "visible_hostname", "wais_relay", "wais_relay_host", "wais_relay_port",
+    ]
+
+    opts = [
+        "proxy-only", "weight", "ttl", "no-query", "default", "round-robin",
+        "multicast-responder", "on", "off", "all", "deny", "allow", "via",
+        "parent", "no-digest", "heap", "lru", "realm", "children", "q1", "q2",
+        "credentialsttl", "none", "disable", "offline_toggle", "diskd",
+    ]
+
+    actions = [
+        "shutdown", "info", "parameter", "server_list", "client_list",
+        r'squid\.conf',
+    ]
+
+    actions_stats = [
+        "objects", "vm_objects", "utilization", "ipcache", "fqdncache", "dns",
+        "redirector", "io", "reply_headers", "filedescriptors", "netdb",
+    ]
+
+    actions_log = ["status", "enable", "disable", "clear"]
+
+    acls = [
+        "url_regex", "urlpath_regex", "referer_regex", "port", "proto",
+        "req_mime_type", "rep_mime_type", "method", "browser", "user", "src",
+        "dst", "time", "dstdomain", "ident", "snmp_community",
+    ]
+
+    ip_re = (
+        r'(?:(?:(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|0x0*[0-9a-f]{1,2}|'
+        r'0+[1-3]?[0-7]{0,2})(?:\.(?:[3-9]\d?|2(?:5[0-5]|[0-4]?\d)?|1\d{0,2}|'
+        r'0x0*[0-9a-f]{1,2}|0+[1-3]?[0-7]{0,2})){3})|(?!.*::.*::)(?:(?!:)|'
+        r':(?=:))(?:[0-9a-f]{0,4}(?:(?<=::)|(?<!::):)){6}(?:[0-9a-f]{0,4}'
+        r'(?:(?<=::)|(?<!::):)[0-9a-f]{0,4}(?:(?<=::)|(?<!:)|(?<=:)(?<!::):)|'
+        r'(?:25[0-4]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-4]|2[0-4]\d|1\d\d|'
+        r'[1-9]?\d)){3}))'
+    )
 
     def makelistre(list):
-        return r'\b(?:'+'|'.join(list)+r')\b'
+        return r'\b(?:' + '|'.join(list) + r')\b'
 
     tokens = {
         'root': [
-            (r'\s+', Text),
+            (r'\s+', Whitespace),
             (r'#', Comment, 'comment'),
             (makelistre(keywords), Keyword),
             (makelistre(opts), Name.Constant),
@@ -984,8 +992,8 @@ class SquidConfLexer(RegexLexer):
             (r'stats/'+makelistre(actions), String),
             (r'log/'+makelistre(actions)+r'=', String),
             (makelistre(acls), Keyword),
-            (ip_re+r'(?:/(?:'+ip_re+r')|\d+)?', Number),
-            (r'\b\d+\b', Number),
+            (ip_re + r'(?:/(?:' + ip_re + r'|\b\d+\b))?', Number.Float),
+            (r'(?:\b\d+\b(?:-\b\d+|%)?)', Number),
             (r'\S+', Text),
         ],
         'comment': [
@@ -1010,11 +1018,11 @@ class DebianControlLexer(RegexLexer):
             (r'^(Description)', Keyword, 'description'),
             (r'^(Maintainer)(:\s*)', bygroups(Keyword, Text), 'maintainer'),
             (r'^((Build-)?Depends)', Keyword, 'depends'),
-            (r'^((?:Python-)?Version)(:\s*)([^\s]+)$',
+            (r'^((?:Python-)?Version)(:\s*)(\S+)$',
              bygroups(Keyword, Text, Number)),
-            (r'^((?:Installed-)?Size)(:\s*)([^\s]+)$',
+            (r'^((?:Installed-)?Size)(:\s*)(\S+)$',
              bygroups(Keyword, Text, Number)),
-            (r'^(MD5Sum|SHA1|SHA256)(:\s*)([^\s]+)$',
+            (r'^(MD5Sum|SHA1|SHA256)(:\s*)(\S+)$',
              bygroups(Keyword, Text, Number)),
             (r'^([a-zA-Z\-0-9\.]*?)(:\s*)(.*?)$',
              bygroups(Keyword, Whitespace, String)),
@@ -1026,7 +1034,8 @@ class DebianControlLexer(RegexLexer):
             (r'.', Text),
         ],
         'description': [
-            (r'(.*)(Homepage)(: )([^\s]+)', bygroups(Text, String, Name, Name.Class)),
+            (r'(.*)(Homepage)(: )(\S+)',
+             bygroups(Text, String, Name, Name.Class)),
             (r':.*\n', Generic.Strong),
             (r' .*\n', Text),
             ('', Text, '#pop'),
@@ -1039,9 +1048,9 @@ class DebianControlLexer(RegexLexer):
             (r'\|', Operator),
             (r'[\s]+', Text),
             (r'[}\)]\s*$', Text, '#pop'),
-            (r'[}]', Text),
+            (r'}', Text),
             (r'[^,]$', Name.Function, '#pop'),
-            (r'([\+\.a-zA-Z0-9-][\s\n]*)', Name.Function),
+            (r'([\+\.a-zA-Z0-9-])(\s*)', bygroups(Name.Function, Text)),
             (r'\[.*?\]', Name.Entity),
         ],
         'depend_vers': [
@@ -1378,7 +1387,8 @@ class YamlLexer(ExtendedRegexLexer):
         # ignored and regular whitespaces in quoted scalars
         'quoted-scalar-whitespaces': [
             # leading and trailing whitespaces are ignored
-            (r'^[ ]+|[ ]+$', Text),
+            (r'^[ ]+', Text),
+            (r'[ ]+$', Text),
             # line breaks are ignored
             (r'\n+', Text),
             # other whitespaces are a part of the value
@@ -1447,7 +1457,8 @@ class YamlLexer(ExtendedRegexLexer):
             # the scalar ends with a comment
             (r'[ ]+(?=#)', Text, '#pop'),
             # leading and trailing whitespaces are ignored
-            (r'^[ ]+|[ ]+$', Text),
+            (r'^[ ]+', Text),
+            (r'[ ]+$', Text),
             # line breaks are ignored
             (r'\n+', Text),
             # other whitespaces are a part of the value
@@ -1606,3 +1617,137 @@ class CMakeLexer(RegexLexer):
         ]
     }
 
+
+class HttpLexer(RegexLexer):
+    """
+    Lexer for HTTP sessions.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'HTTP'
+    aliases = ['http']
+
+    flags = re.DOTALL
+
+    def header_callback(self, match):
+        if match.group(1).lower() == 'content-type':
+            content_type = match.group(5).strip()
+            if ';' in content_type:
+                content_type = content_type[:content_type.find(';')].strip()
+            self.content_type = content_type
+        yield match.start(1), Name.Attribute, match.group(1)
+        yield match.start(2), Text, match.group(2)
+        yield match.start(3), Operator, match.group(3)
+        yield match.start(4), Text, match.group(4)
+        yield match.start(5), Literal, match.group(5)
+        yield match.start(6), Text, match.group(6)
+
+    def content_callback(self, match):
+        content_type = getattr(self, 'content_type', None)
+        content = match.group()
+        offset = match.start()
+        if content_type:
+            from pygments.lexers import get_lexer_for_mimetype
+            try:
+                lexer = get_lexer_for_mimetype(content_type)
+            except ClassNotFound:
+                pass
+            else:
+                for idx, token, value in lexer.get_tokens_unprocessed(content):
+                    yield offset + idx, token, value
+                return
+        yield offset, Text, content
+
+    tokens = {
+        'root': [
+            (r'(GET|POST|PUT|DELETE|HEAD|OPTIONS|TRACE)( +)([^ ]+)( +)'
+             r'(HTTPS?)(/)(1\.[01])(\r?\n|$)',
+             bygroups(Name.Function, Text, Name.Namespace, Text,
+                      Keyword.Reserved, Operator, Number, Text),
+             'headers'),
+            (r'(HTTPS?)(/)(1\.[01])( +)(\d{3})( +)([^\r\n]+)(\r?\n|$)',
+             bygroups(Keyword.Reserved, Operator, Number, Text, Number,
+                      Text, Name.Exception, Text),
+             'headers'),
+        ],
+        'headers': [
+            (r'([^\s:]+)( *)(:)( *)([^\r\n]+)(\r?\n|$)', header_callback),
+            (r'\r?\n', Text, 'content')
+        ],
+        'content': [
+            (r'.+', content_callback)
+        ]
+    }
+
+
+class PyPyLogLexer(RegexLexer):
+    """
+    Lexer for PyPy log files.
+
+    *New in Pygments 1.5.*
+    """
+    name = "PyPy Log"
+    aliases = ["pypylog", "pypy"]
+    filenames = ["*.pypylog"]
+    mimetypes = ['application/x-pypylog']
+
+    tokens = {
+        "root": [
+            (r"\[\w+\] {jit-log-.*?$", Keyword, "jit-log"),
+            (r"\[\w+\] {jit-backend-counts$", Keyword, "jit-backend-counts"),
+            include("extra-stuff"),
+        ],
+        "jit-log": [
+            (r"\[\w+\] jit-log-.*?}$", Keyword, "#pop"),
+
+            (r"^\+\d+: ", Comment),
+            (r"[ifp]\d+", Name),
+            (r"ptr\d+", Name),
+            (r"(\()(\w+(?:\.\w+)?)(\))",
+             bygroups(Punctuation, Name.Builtin, Punctuation)),
+            (r"[\[\]=,()]", Punctuation),
+            (r"(\d+\.\d+|inf|-inf)", Number.Float),
+            (r"-?\d+", Number.Integer),
+            (r"'.*'", String),
+            (r"(None|descr|ConstClass|ConstPtr|TargetToken)", Name),
+            (r"<.*?>", Name.Builtin),
+            (r"(label|debug_merge_point|jump|finish)", Name.Class),
+            (r"(int_add_ovf|int_add|int_sub_ovf|int_sub|int_mul_ovf|int_mul|"
+             r"int_floordiv|int_mod|int_lshift|int_rshift|int_and|int_or|"
+             r"int_xor|int_eq|int_ne|int_ge|int_gt|int_le|int_lt|int_is_zero|"
+             r"int_is_true|"
+             r"uint_floordiv|uint_ge|uint_lt|"
+             r"float_add|float_sub|float_mul|float_truediv|"
+             r"float_eq|float_ne|float_ge|float_gt|float_le|float_lt|float_abs|"
+             r"ptr_eq|ptr_ne|instance_ptr_eq|instance_ptr_ne|"
+             r"cast_int_to_float|cast_float_to_int|"
+             r"force_token|quasiimmut_field|same_as|virtual_ref_finish|"
+             r"virtual_ref|mark_opaque_ptr|"
+             r"call_may_force|call_assembler|call_loopinvariant|"
+             r"call_release_gil|call_pure|call|"
+             r"new_with_vtable|new_array|newstr|newunicode|new|"
+             r"arraylen_gc|"
+             r"getarrayitem_gc_pure|getarrayitem_gc|setarrayitem_gc|"
+             r"getarrayitem_raw|setarrayitem_raw|getfield_gc_pure|"
+             r"getfield_gc|getinteriorfield_gc|setinteriorfield_gc|"
+             r"getfield_raw|setfield_gc|setfield_raw|"
+             r"strgetitem|strsetitem|strlen|copystrcontent|"
+             r"unicodegetitem|unicodesetitem|unicodelen|"
+             r"guard_true|guard_false|guard_value|guard_isnull|"
+             r"guard_nonnull_class|guard_nonnull|guard_class|guard_no_overflow|"
+             r"guard_not_forced|guard_no_exception|guard_not_invalidated)",
+             Name.Builtin),
+            include("extra-stuff"),
+        ],
+        "jit-backend-counts": [
+            (r"\[\w+\] jit-backend-counts}$", Keyword, "#pop"),
+            (r":", Punctuation),
+            (r"\d+", Number),
+            include("extra-stuff"),
+        ],
+        "extra-stuff": [
+            (r"\s+", Text),
+            (r"#.*?$", Comment),
+        ],
+    }
index 11bc21751d355ff83207b58b16692e4ec2943a2f..f45abf5723ba3f4bbc47c820ec378ab81c06da76 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for web-related languages and markup.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -22,11 +22,11 @@ from pygments.lexers.agile import RubyLexer
 from pygments.lexers.compiled import ScalaLexer
 
 
-__all__ = ['HtmlLexer', 'XmlLexer', 'JavascriptLexer', 'CssLexer',
+__all__ = ['HtmlLexer', 'XmlLexer', 'JavascriptLexer', 'JSONLexer', 'CssLexer',
            'PhpLexer', 'ActionScriptLexer', 'XsltLexer', 'ActionScript3Lexer',
            'MxmlLexer', 'HaxeLexer', 'HamlLexer', 'SassLexer', 'ScssLexer',
            'ObjectiveJLexer', 'CoffeeScriptLexer', 'DuelLexer', 'ScamlLexer',
-           'JadeLexer', 'XQueryLexer']
+           'JadeLexer', 'XQueryLexer', 'DtdLexer', 'DartLexer']
 
 
 class JavascriptLexer(RegexLexer):
@@ -36,9 +36,9 @@ class JavascriptLexer(RegexLexer):
 
     name = 'JavaScript'
     aliases = ['js', 'javascript']
-    filenames = ['*.js']
+    filenames = ['*.js']
     mimetypes = ['application/javascript', 'application/x-javascript',
-                 'text/x-javascript', 'text/javascript']
+                 'text/x-javascript', 'text/javascript']
 
     flags = re.DOTALL
     tokens = {
@@ -56,7 +56,7 @@ class JavascriptLexer(RegexLexer):
             (r'', Text, '#pop')
         ],
         'badregex': [
-            ('\n', Text, '#pop')
+            (r'\n', Text, '#pop')
         ],
         'root': [
             (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
@@ -68,7 +68,7 @@ class JavascriptLexer(RegexLexer):
             (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|'
              r'throw|try|catch|finally|new|delete|typeof|instanceof|void|'
              r'this)\b', Keyword, 'slashstartsregex'),
-            (r'(var|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
+            (r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
             (r'(abstract|boolean|byte|char|class|const|debugger|double|enum|export|'
              r'extends|final|float|goto|implements|import|int|interface|long|native|'
              r'package|private|protected|public|short|static|super|synchronized|throws|'
@@ -89,6 +89,74 @@ class JavascriptLexer(RegexLexer):
     }
 
 
+class JSONLexer(RegexLexer):
+    """
+    For JSON data structures.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'JSON'
+    aliases = ['json']
+    filenames = ['*.json']
+    mimetypes = [ 'application/json', ]
+
+    flags = re.DOTALL
+    tokens = {
+        'whitespace': [
+            (r'\s+', Text),
+        ],
+
+        # represents a simple terminal value
+        'simplevalue':[
+            (r'(true|false|null)\b', Keyword.Constant),
+            (r'-?[0-9]+', Number.Integer),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+        ],
+
+
+        # the right hand side of an object, after the attribute name
+        'objectattribute': [
+            include('value'),
+            (r':', Punctuation),
+            # comma terminates the attribute but expects more
+            (r',', Punctuation, '#pop'),
+            # a closing bracket terminates the entire object, so pop twice
+            (r'}', Punctuation, ('#pop', '#pop')),
+        ],
+
+        # a json object - { attr, attr, ... }
+        'objectvalue': [
+            include('whitespace'),
+            (r'"(\\\\|\\"|[^"])*"', Name.Tag, 'objectattribute'),
+            (r'}', Punctuation, '#pop'),
+        ],
+
+        # json array - [ value, value, ... }
+        'arrayvalue': [
+            include('whitespace'),
+            include('value'),
+            (r',', Punctuation),
+            (r']', Punctuation, '#pop'),
+        ],
+
+        # a json value - either a simple value or a complex value (object or array)
+        'value': [
+            include('whitespace'),
+            include('simplevalue'),
+            (r'{', Punctuation, 'objectvalue'),
+            (r'\[', Punctuation, 'arrayvalue'),
+        ],
+
+
+        # the root of a json document whould be a value
+        'root': [
+            include('value'),
+        ],
+
+    }
+
+
 class ActionScriptLexer(RegexLexer):
     """
     For ActionScript source code.
@@ -99,8 +167,8 @@ class ActionScriptLexer(RegexLexer):
     name = 'ActionScript'
     aliases = ['as', 'actionscript']
     filenames = ['*.as']
-    mimetypes = ['application/x-actionscript', 'text/x-actionscript',
-                 'text/actionscript']
+    mimetypes = ['application/x-actionscript3', 'text/x-actionscript3',
+                 'text/actionscript3']
 
     flags = re.DOTALL
     tokens = {
@@ -172,9 +240,6 @@ class ActionScriptLexer(RegexLexer):
         ]
     }
 
-    def analyse_text(text):
-        return 0.05
-
 
 class ActionScript3Lexer(RegexLexer):
     """
@@ -190,6 +255,7 @@ class ActionScript3Lexer(RegexLexer):
                  'text/actionscript']
 
     identifier = r'[$a-zA-Z_][a-zA-Z0-9_]*'
+    typeidentifier = identifier + '(?:\.<\w+>)?'
 
     flags = re.DOTALL | re.MULTILINE
     tokens = {
@@ -198,12 +264,13 @@ class ActionScript3Lexer(RegexLexer):
             (r'(function\s+)(' + identifier + r')(\s*)(\()',
              bygroups(Keyword.Declaration, Name.Function, Text, Operator),
              'funcparams'),
-            (r'(var|const)(\s+)(' + identifier + r')(\s*)(:)(\s*)(' + identifier + r')',
+            (r'(var|const)(\s+)(' + identifier + r')(\s*)(:)(\s*)(' +
+             typeidentifier + r')',
              bygroups(Keyword.Declaration, Text, Name, Text, Punctuation, Text,
                       Keyword.Type)),
             (r'(import|package)(\s+)((?:' + identifier + r'|\.)+)(\s*)',
              bygroups(Keyword, Text, Name.Namespace, Text)),
-            (r'(new)(\s+)(' + identifier + r')(\s*)(\()',
+            (r'(new)(\s+)(' + typeidentifier + r')(\s*)(\()',
              bygroups(Keyword, Text, Keyword.Type, Text, Operator)),
             (r'//.*?\n', Comment.Single),
             (r'/\*.*?\*/', Comment.Multiline),
@@ -229,18 +296,18 @@ class ActionScript3Lexer(RegexLexer):
             (r'[0-9]+', Number.Integer),
             (r'"(\\\\|\\"|[^"])*"', String.Double),
             (r"'(\\\\|\\'|[^'])*'", String.Single),
-            (r'[~\^\*!%&<>\|+=:;,/?\\{}\[\]();.-]+', Operator),
+            (r'[~\^\*!%&<>\|+=:;,/?\\{}\[\]().-]+', Operator),
         ],
         'funcparams': [
             (r'\s+', Text),
             (r'(\s*)(\.\.\.)?(' + identifier + r')(\s*)(:)(\s*)(' +
-             identifier + r'|\*)(\s*)',
+             typeidentifier + r'|\*)(\s*)',
              bygroups(Text, Punctuation, Name, Text, Operator, Text,
                       Keyword.Type, Text), 'defval'),
             (r'\)', Operator, 'type')
         ],
         'type': [
-            (r'(\s*)(:)(\s*)(' + identifier + r'|\*)',
+            (r'(\s*)(:)(\s*)(' + typeidentifier + r'|\*)',
              bygroups(Text, Operator, Text, Keyword.Type), '#pop:2'),
             (r'\s*', Text, '#pop:2')
         ],
@@ -252,8 +319,9 @@ class ActionScript3Lexer(RegexLexer):
     }
 
     def analyse_text(text):
-        if re.match(r'\w+\s*:\s*\w', text): return 0.3
-        return 0.1
+        if re.match(r'\w+\s*:\s*\w', text):
+            return 0.3
+        return 0
 
 
 class CssLexer(RegexLexer):
@@ -315,7 +383,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(?:-x|-y|)|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|'
@@ -388,7 +456,7 @@ class CssLexer(RegexLexer):
             (r'[\[\]();]+', Punctuation),
             (r'"(\\\\|\\"|[^"])*"', String.Double),
             (r"'(\\\\|\\'|[^'])*'", String.Single),
-            (r'[a-zA-Z][a-zA-Z0-9]+', Name)
+            (r'[a-zA-Z_][a-zA-Z0-9_]+', Name)
         ]
     }
 
@@ -431,13 +499,13 @@ class ObjectiveJLexer(RegexLexer):
             (';', Punctuation),
         ],
         'whitespace': [
-            (r'(@import)(\s+)("(\\\\|\\"|[^"])*")',
+            (r'(@import)(\s+)("(?:\\\\|\\"|[^"])*")',
              bygroups(Comment.Preproc, Text, String.Double)),
-            (r'(@import)(\s+)(<(\\\\|\\>|[^>])*>)',
+            (r'(@import)(\s+)(<(?:\\\\|\\>|[^>])*>)',
              bygroups(Comment.Preproc, Text, String.Double)),
-            (r'(#(?:include|import))(\s+)("(\\\\|\\"|[^"])*")',
+            (r'(#(?:include|import))(\s+)("(?:\\\\|\\"|[^"])*")',
              bygroups(Comment.Preproc, Text, String.Double)),
-            (r'(#(?:include|import))(\s+)(<(\\\\|\\>|[^>])*>)',
+            (r'(#(?:include|import))(\s+)(<(?:\\\\|\\>|[^>])*>)',
              bygroups(Comment.Preproc, Text, String.Double)),
 
             (r'#if\s+0', Comment.Preproc, 'if0'),
@@ -458,7 +526,7 @@ class ObjectiveJLexer(RegexLexer):
             (r'', Text, '#pop'),
         ],
         'badregex': [
-            ('\n', Text, '#pop'),
+            (r'\n', Text, '#pop'),
         ],
         'statements': [
             (r'(L|@)?"', String, 'string'),
@@ -565,7 +633,7 @@ class ObjectiveJLexer(RegexLexer):
             # parameters
             (r'(\(' + _ws + ')'                 # open paren
              r'([^\)]+)'                        # type
-             r'(' + _ws + r'\)' + _ws + r')+'   # close paren
+             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)),
 
@@ -577,7 +645,7 @@ class ObjectiveJLexer(RegexLexer):
             (r'(:)', Name.Function),
 
             # var args
-            (r'(,' + _ws + r'...)', using(this)),
+            (r'(,' + _ws + r'\.\.\.)', using(this)),
 
             # param name
             (r'([$a-zA-Z_][a-zA-Z0-9_]+)', Text),
@@ -748,7 +816,7 @@ class PhpLexer(RegexLexer):
              r'array|__wakeup|E_ALL|NULL|final|php_user_filter|interface|'
              r'implements|public|private|protected|abstract|clone|try|'
              r'catch|throw|this|use|namespace)\b', Keyword),
-            ('(true|false|null)\b', Keyword.Constant),
+            (r'(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),
             (r'[\\a-zA-Z_][\\a-zA-Z0-9_]*', Name.Other),
@@ -826,6 +894,92 @@ class PhpLexer(RegexLexer):
         return rv
 
 
+class DtdLexer(RegexLexer):
+    """
+    A lexer for DTDs (Document Type Definitions).
+
+    *New in Pygments 1.5.*
+    """
+
+    flags = re.MULTILINE | re.DOTALL
+
+    name = 'DTD'
+    aliases = ['dtd']
+    filenames = ['*.dtd']
+    mimetypes = ['application/xml-dtd']
+
+    tokens = {
+        'root': [
+            include('common'),
+
+            (r'(<!ELEMENT)(\s+)(\S+)',
+                bygroups(Keyword, Text, Name.Tag), 'element'),
+            (r'(<!ATTLIST)(\s+)(\S+)',
+                bygroups(Keyword, Text, Name.Tag), 'attlist'),
+            (r'(<!ENTITY)(\s+)(\S+)',
+                bygroups(Keyword, Text, Name.Entity), 'entity'),
+            (r'(<!NOTATION)(\s+)(\S+)',
+                bygroups(Keyword, Text, Name.Tag), 'notation'),
+            (r'(<!\[)([^\[\s]+)(\s*)(\[)', # conditional sections
+                bygroups(Keyword, Name.Entity, Text, Keyword)),
+
+            (r'(<!DOCTYPE)(\s+)([^>\s]+)',
+                bygroups(Keyword, Text, Name.Tag)),
+            (r'PUBLIC|SYSTEM', Keyword.Constant),
+            (r'[\[\]>]', Keyword),
+        ],
+
+        'common': [
+            (r'\s+', Text),
+            (r'(%|&)[^;]*;', Name.Entity),
+            ('<!--', Comment, 'comment'),
+            (r'[(|)*,?+]', Operator),
+            (r'"[^"]*"', String.Double),
+            (r'\'[^\']*\'', String.Single),
+        ],
+
+        'comment': [
+            ('[^-]+', Comment),
+            ('-->', Comment, '#pop'),
+            ('-', Comment),
+        ],
+
+        'element': [
+            include('common'),
+            (r'EMPTY|ANY|#PCDATA', Keyword.Constant),
+            (r'[^>\s\|()?+*,]+', Name.Tag),
+            (r'>', Keyword, '#pop'),
+        ],
+
+        'attlist': [
+            include('common'),
+            (r'CDATA|IDREFS|IDREF|ID|NMTOKENS|NMTOKEN|ENTITIES|ENTITY|NOTATION', Keyword.Constant),
+            (r'#REQUIRED|#IMPLIED|#FIXED', Keyword.Constant),
+            (r'xml:space|xml:lang', Keyword.Reserved),
+            (r'[^>\s\|()?+*,]+', Name.Attribute),
+            (r'>', Keyword, '#pop'),
+        ],
+
+        'entity': [
+            include('common'),
+            (r'SYSTEM|PUBLIC|NDATA', Keyword.Constant),
+            (r'[^>\s\|()?+*,]+', Name.Entity),
+            (r'>', Keyword, '#pop'),
+        ],
+
+        'notation': [
+            include('common'),
+            (r'SYSTEM|PUBLIC', Keyword.Constant),
+            (r'[^>\s\|()?+*,]+', Name.Attribute),
+            (r'>', Keyword, '#pop'),
+        ],
+    }
+
+    def analyse_text(text):
+        if not looks_like_xml(text) and \
+            ('<!ELEMENT' in text or '<!ATTLIST' in text or '<!ENTITY' in text):
+            return 0.8
+
 class XmlLexer(RegexLexer):
     """
     Generic lexer for XML (eXtensible Markup Language).
@@ -837,8 +991,7 @@ class XmlLexer(RegexLexer):
     aliases = ['xml']
     filenames = ['*.xml', '*.xsl', '*.rss', '*.xslt', '*.xsd', '*.wsdl']
     mimetypes = ['text/xml', 'application/xml', 'image/svg+xml',
-                 'application/rss+xml', 'application/atom+xml',
-                 'application/xsl+xml', 'application/xslt+xml']
+                 'application/rss+xml', 'application/atom+xml']
 
     tokens = {
         'root': [
@@ -884,6 +1037,7 @@ class XsltLexer(XmlLexer):
     name = 'XSLT'
     aliases = ['xslt']
     filenames = ['*.xsl', '*.xslt']
+    mimetypes = ['application/xsl+xml', 'application/xslt+xml']
 
     EXTRA_KEYWORDS = set([
         'apply-imports', 'apply-templates', 'attribute',
@@ -1015,7 +1169,7 @@ class HaxeLexer(RegexLexer):
           include('codekeywords'),
           (r'[();,\[\]]', Punctuation),
           (r'(?:=|\+=|-=|\*=|/=|%=|&=|\|=|\^=|<<=|>>=|>>>=|\|\||&&|'
-           r'\.\.\.|==|!=|>|<|>=|<=|\||&|\^|<<|>>|>>>|\+|\-|\*|/|%|'
+           r'\.\.\.|==|!=|>|<|>=|<=|\||&|\^|<<|>>>|>>|\+|\-|\*|/|%|'
            r'!|\+\+|\-\-|~|\.|\?|\:)',
            Operator),
           (ident, Name),
@@ -1241,7 +1395,7 @@ class HamlLexer(ExtendedRegexLexer):
 
         'eval-or-plain': [
             (r'[&!]?==', Punctuation, 'plain'),
-            (r'([&!]?[=~])(' + _comma_dot + '*\n)',
+            (r'([&!]?[=~])(' + _comma_dot + r'*\n)',
              bygroups(Punctuation, using(RubyLexer)),
              'root'),
             (r'', Text, 'plain'),
@@ -1250,18 +1404,18 @@ class HamlLexer(ExtendedRegexLexer):
         'content': [
             include('css'),
             (r'%[a-z0-9_:-]+', Name.Tag, 'tag'),
-            (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
-            (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
+            (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
+            (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
              bygroups(Comment, Comment.Special, Comment),
              '#pop'),
-            (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
+            (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
              '#pop'),
-            (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
+            (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
                                                  'haml-comment-block'), '#pop'),
-            (r'(-)(' + _comma_dot + '*\n)',
+            (r'(-)(' + _comma_dot + r'*\n)',
              bygroups(Punctuation, using(RubyLexer)),
              '#pop'),
-            (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
+            (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
              '#pop'),
             include('eval-or-plain'),
         ],
@@ -1536,7 +1690,7 @@ class SassLexer(ExtendedRegexLexer):
 
         'import': [
             (r'[ \t]+', Text),
-            (r'[^\s]+', String),
+            (r'\S+', String),
             (r'\n', Text, 'root'),
         ],
 
@@ -1630,20 +1784,25 @@ class CoffeeScriptLexer(RegexLexer):
     tokens = {
         'commentsandwhitespace': [
             (r'\s+', Text),
+            (r'###.*?###', Comment.Multiline),
             (r'#.*?\n', Comment.Single),
         ],
+        'multilineregex': [
+            include('commentsandwhitespace'),
+            (r'///([gim]+\b|\B)', String.Regex, '#pop'),
+            (r'/', String.Regex),
+            (r'[^/#]+', String.Regex)
+        ],
         'slashstartsregex': [
             include('commentsandwhitespace'),
-            (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
+            (r'///', String.Regex, ('#pop', 'multilineregex')),
+            (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'),
+            # this next expr leads to infinite loops root -> slashstartsregex
+            #(r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
             include('commentsandwhitespace'),
             (r'\+\+|--|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|=|'
              r'\|\||\\(?=\n)|(<<|>>>?|==?|!=?|[-<>+*`%&\|\^/])=?',
@@ -1665,13 +1824,47 @@ class CoffeeScriptLexer(RegexLexer):
               'slashstartsregex'),
             (r'@[$a-zA-Z_][a-zA-Z0-9_\.:]*\s*[:=]\s', Name.Variable.Instance,
               'slashstartsregex'),
+            (r'@', Name.Other, 'slashstartsregex'),
             (r'@?[$a-zA-Z_][a-zA-Z0-9_]*', Name.Other, 'slashstartsregex'),
             (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),
-        ]
+            ('"""', String, 'tdqs'),
+            ("'''", String, 'tsqs'),
+            ('"', String, 'dqs'),
+            ("'", String, 'sqs'),
+        ],
+        'strings': [
+            (r'[^#\\\'"]+', String),
+            # note that all coffee script strings are multi-line.
+            # hashmarks, quotes and backslashes must be parsed one at a time
+        ],
+        'interpoling_string' : [
+            (r'}', String.Interpol, "#pop"),
+            include('root')
+        ],
+        'dqs': [
+            (r'"', String, '#pop'),
+            (r'\\.|\'', String), # double-quoted string don't need ' escapes
+            (r'#{', String.Interpol, "interpoling_string"),
+            include('strings')
+        ],
+        'sqs': [
+            (r"'", String, '#pop'),
+            (r'#|\\.|"', String), # single quoted strings don't need " escapses
+            include('strings')
+        ],
+        'tdqs': [
+            (r'"""', String, '#pop'),
+            (r'\\.|\'|"', String), # no need to escape quotes in triple-string
+            (r'#{', String.Interpol, "interpoling_string"),
+            include('strings'),
+        ],
+        'tsqs': [
+            (r"'''", String, '#pop'),
+            (r'#|\\.|\'|"', String), # no need to escape quotes in triple-strings
+            include('strings')
+        ],
     }
 
 class DuelLexer(RegexLexer):
@@ -1739,7 +1932,7 @@ class ScamlLexer(ExtendedRegexLexer):
 
         'eval-or-plain': [
             (r'[&!]?==', Punctuation, 'plain'),
-            (r'([&!]?[=~])(' + _dot + '*\n)',
+            (r'([&!]?[=~])(' + _dot + r'*\n)',
              bygroups(Punctuation, using(ScalaLexer)),
              'root'),
             (r'', Text, 'plain'),
@@ -1748,21 +1941,21 @@ class ScamlLexer(ExtendedRegexLexer):
         'content': [
             include('css'),
             (r'%[a-z0-9_:-]+', Name.Tag, 'tag'),
-            (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
-            (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
+            (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
+            (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
              bygroups(Comment, Comment.Special, Comment),
              '#pop'),
-            (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
+            (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
              '#pop'),
-            (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
+            (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
                                                  'scaml-comment-block'), '#pop'),
-            (r'(-@\s*)(import)?(' + _dot + '*\n)',
+            (r'(-@\s*)(import)?(' + _dot + r'*\n)',
              bygroups(Punctuation, Keyword, using(ScalaLexer)),
              '#pop'),
-            (r'(-)(' + _dot + '*\n)',
+            (r'(-)(' + _dot + r'*\n)',
              bygroups(Punctuation, using(ScalaLexer)),
              '#pop'),
-            (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
+            (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
              '#pop'),
             include('eval-or-plain'),
         ],
@@ -1849,31 +2042,31 @@ class JadeLexer(ExtendedRegexLexer):
 
         'eval-or-plain': [
             (r'[&!]?==', Punctuation, 'plain'),
-            (r'([&!]?[=~])(' + _dot + '*\n)',
+            (r'([&!]?[=~])(' + _dot + r'*\n)',
              bygroups(Punctuation, using(ScalaLexer)),  'root'),
             (r'', Text, 'plain'),
         ],
 
         'content': [
             include('css'),
-            (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
-            (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
+            (r'!!!' + _dot + r'*\n', Name.Namespace, '#pop'),
+            (r'(/)(\[' + _dot + '*?\])(' + _dot + r'*\n)',
              bygroups(Comment, Comment.Special, Comment),
              '#pop'),
-            (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
+            (r'/' + _dot + r'*\n', _starts_block(Comment, 'html-comment-block'),
              '#pop'),
-            (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
+            (r'-#' + _dot + r'*\n', _starts_block(Comment.Preproc,
                                                  'scaml-comment-block'), '#pop'),
-            (r'(-@\s*)(import)?(' + _dot + '*\n)',
+            (r'(-@\s*)(import)?(' + _dot + r'*\n)',
              bygroups(Punctuation, Keyword, using(ScalaLexer)),
              '#pop'),
-            (r'(-)(' + _dot + '*\n)',
+            (r'(-)(' + _dot + r'*\n)',
              bygroups(Punctuation, using(ScalaLexer)),
              '#pop'),
-            (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
+            (r':' + _dot + r'*\n', _starts_block(Name.Decorator, 'filter-block'),
              '#pop'),
             (r'[a-z0-9_:-]+', Name.Tag, 'tag'),
-            (r'|', Text, 'eval-or-plain'),
+            (r'\|', Text, 'eval-or-plain'),
         ],
 
         'tag': [
@@ -1949,24 +2142,24 @@ class XQueryLexer(ExtendedRegexLexer):
     #    ur"[\u2C00-\u2FEF]|[\u3001-\uD7FF]|[\uF900-\uFDCF]|[\uFDF0-\uFFFD]|"
     #    ur"[\u10000-\uEFFFF]"
     #)
-    ncnamestartchar = r"[A-Z]|_|[a-z]"
+    ncnamestartchar = r"(?:[A-Z]|_|[a-z])"
     # FIX UNICODE LATER
     #ncnamechar = ncnamestartchar + (ur"|-|\.|[0-9]|\u00B7|[\u0300-\u036F]|"
     #                                ur"[\u203F-\u2040]")
-    ncnamechar = ncnamestartchar + r"|-|\.|[0-9]"
-    ncname = "((%s)+(%s)*)" % (ncnamestartchar, ncnamechar)
-    pitarget_namestartchar = r"[A-KN-WY-Z]|_|:|[a-kn-wy-z]"
-    pitarget_namechar = pitarget_namestartchar + r"|-|\.|[0-9]"
-    pitarget = "(%s)+(%s)*" % (pitarget_namestartchar, pitarget_namechar)
+    ncnamechar = r"(?:" + ncnamestartchar + r"|-|\.|[0-9])"
+    ncname = "(?:%s+%s*)" % (ncnamestartchar, ncnamechar)
+    pitarget_namestartchar = r"(?:[A-KN-WY-Z]|_|:|[a-kn-wy-z])"
+    pitarget_namechar = r"(?:" + pitarget_namestartchar + r"|-|\.|[0-9])"
+    pitarget = "%s+%s*" % (pitarget_namestartchar, pitarget_namechar)
     prefixedname = "%s:%s" % (ncname, ncname)
     unprefixedname = ncname
-    qname = "((%s)|(%s))" %(prefixedname, unprefixedname)
+    qname = "(?:%s|%s)" % (prefixedname, unprefixedname)
 
-    entityref = r'&(lt|gt|amp|quot|apos|nbsp);'
-    charref = r'&#[0-9]+;|&#x[0-9a-fA-F]+;'
+    entityref = r'(?:&(?:lt|gt|amp|quot|apos|nbsp);)'
+    charref = r'(?:&#[0-9]+;|&#x[0-9a-fA-F]+;)'
 
-    stringdouble = r'("((' + entityref + r')|(' + charref + r')|("")|([^&"]))*")'
-    stringsingle = r"('((" + entityref + r")|(" + charref + r")|('')|([^&']))*')"
+    stringdouble = r'(?:"(?:' + entityref + r'|' + charref + r'|""|[^&"])*")'
+    stringsingle = r"(?:'(?:" + entityref + r"|" + charref + r"|''|[^&'])*')"
 
     # FIX UNICODE LATER
     #elementcontentchar = (ur'\t|\r|\n|[\u0020-\u0025]|[\u0028-\u003b]|'
@@ -1986,6 +2179,12 @@ class XQueryLexer(ExtendedRegexLexer):
 
     flags = re.DOTALL | re.MULTILINE | re.UNICODE
 
+    def punctuation_root_callback(lexer, match, ctx):
+        yield match.start(), Punctuation, match.group(1)
+        # transition to root always - don't pop off stack
+        ctx.stack = ['root']
+        ctx.pos = match.end()
+
     def operator_root_callback(lexer, match, ctx):
         yield match.start(), Operator, match.group(1)
         # transition to root always - don't pop off stack
@@ -2167,6 +2366,11 @@ class XQueryLexer(ExtendedRegexLexer):
         ctx.stack = ['root']#.append('root')
         ctx.pos = match.end()
 
+    def pushstate_operator_attribute_callback(lexer, match, ctx):
+        yield match.start(), Name.Attribute, match.group(1)
+        ctx.stack.append('operator')
+        ctx.pos = match.end()
+
     def pushstate_operator_callback(lexer, match, ctx):
         yield match.start(), Keyword, match.group(1)
         yield match.start(), Text, match.group(2)
@@ -2192,19 +2396,24 @@ class XQueryLexer(ExtendedRegexLexer):
 
             (r'(\{)', pushstate_root_callback),
             (r'then|else|external|at|div|except', Keyword, 'root'),
+            (r'order by', Keyword, 'root'),
             (r'is|mod|order\s+by|stable\s+order\s+by', Keyword, 'root'),
             (r'and|or', Operator.Word, 'root'),
             (r'(eq|ge|gt|le|lt|ne|idiv|intersect|in)(?=\b)',
              Operator.Word, 'root'),
             (r'return|satisfies|to|union|where|preserve\s+strip',
              Keyword, 'root'),
-            (r'(::|;|>=|>>|>|\[|<=|<<|<|-|\*|!=|\+|//|/|\||:=|,|=)',
+            (r'(>=|>>|>|<=|<<|<|-|\*|!=|\+|\||:=|=)',
              operator_root_callback),
-            (r'(castable|cast)(\s+)(as)',
+            (r'(::|;|\[|//|/|,)',
+             punctuation_root_callback),
+            (r'(castable|cast)(\s+)(as)\b',
              bygroups(Keyword, Text, Keyword), 'singletype'),
-            (r'(instance)(\s+)(of)|(treat)(\s+)(as)',
+            (r'(instance)(\s+)(of)\b',
              bygroups(Keyword, Text, Keyword), 'itemtype'),
-            (r'(case)|(as)', Keyword, 'itemtype'),
+            (r'(treat)(\s+)(as)\b',
+             bygroups(Keyword, Text, Keyword), 'itemtype'),
+            (r'(case|as)\b', Keyword, 'itemtype'),
             (r'(\))(\s*)(as)',
              bygroups(Punctuation, Text, Keyword), 'itemtype'),
             (r'\$', Name.Variable, 'varname'),
@@ -2229,8 +2438,8 @@ class XQueryLexer(ExtendedRegexLexer):
         'namespacedecl': [
             include('whitespace'),
             (r'\(:', Comment, 'comment'),
-            (r'(at)(\s+)'+stringdouble, bygroups(Keyword, Text, String.Double)),
-            (r"(at)(\s+)"+stringsingle, bygroups(Keyword, Text, String.Single)),
+            (r'(at)(\s+)('+stringdouble+')', bygroups(Keyword, Text, String.Double)),
+            (r"(at)(\s+)("+stringsingle+')', bygroups(Keyword, Text, String.Single)),
             (stringdouble, String.Double),
             (stringsingle, String.Single),
             (r',', Punctuation),
@@ -2262,10 +2471,10 @@ class XQueryLexer(ExtendedRegexLexer):
             include('whitespace'),
             (r'\(:', Comment, 'comment'),
             (r'\$', Punctuation, 'varname'),
-            (r'void\s*\(\s*\)',
+            (r'(void)(\s*)(\()(\s*)(\))',
              bygroups(Keyword, Text, Punctuation, Text, Punctuation), 'operator'),
             (r'(element|attribute|schema-element|schema-attribute|comment|text|'
-             r'node|binary|document-node)(\s*)(\()',
+             r'node|binary|document-node|empty-sequence)(\s*)(\()',
              pushstate_occurrenceindicator_kindtest_callback),
             # Marklogic specific type?
             (r'(processing-instruction)(\s*)(\()',
@@ -2277,9 +2486,9 @@ class XQueryLexer(ExtendedRegexLexer):
             (r'\(\#', Punctuation, 'pragma'),
             (r';', Punctuation, '#pop'),
             (r'then|else', Keyword, '#pop'),
-            (r'(at)(\s+)' + stringdouble,
+            (r'(at)(\s+)(' + stringdouble + ')',
              bygroups(Keyword, Text, String.Double), 'namespacedecl'),
-            (r'(at)(\s+)' + stringsingle,
+            (r'(at)(\s+)(' + stringsingle + ')',
              bygroups(Keyword, Text, String.Single), 'namespacedecl'),
             (r'except|intersect|in|is|return|satisfies|to|union|where',
              Keyword, 'root'),
@@ -2290,16 +2499,16 @@ class XQueryLexer(ExtendedRegexLexer):
              bygroups(Keyword, Text, Keyword, Text, Keyword), 'root'),
             (r'(castable|cast)(\s+)(as)',
              bygroups(Keyword, Text, Keyword), 'singletype'),
-            (r'(instance)(\s+)(of)|(treat)(\s+)(as)',
-             bygroups(Keyword, Text, Keyword)),
+            (r'(treat)(\s+)(as)', bygroups(Keyword, Text, Keyword)),
+            (r'(instance)(\s+)(of)', bygroups(Keyword, Text, Keyword)),
             (r'case|as', Keyword, 'itemtype'),
             (r'(\))(\s*)(as)', bygroups(Operator, Text, Keyword), 'itemtype'),
-            (ncname + r'(:\*)', Keyword.Type, 'operator'),
+            (ncname + r':\*', Keyword.Type, 'operator'),
             (qname, Keyword.Type, 'occurrenceindicator'),
         ],
         'kindtest': [
             (r'\(:', Comment, 'comment'),
-            (r'({)', Punctuation, 'root'),
+            (r'{', Punctuation, 'root'),
             (r'(\))([*+?]?)', popstate_kindtest_callback),
             (r'\*', Name, 'closekindtest'),
             (qname, Name, 'closekindtest'),
@@ -2308,7 +2517,7 @@ class XQueryLexer(ExtendedRegexLexer):
         'kindtestforpi': [
             (r'\(:', Comment, 'comment'),
             (r'\)', Punctuation, '#pop'),
-            (ncname, bygroups(Name.Variable, Name.Variable)),
+            (ncname, Name.Variable),
             (stringdouble, String.Double),
             (stringsingle, String.Single),
         ],
@@ -2322,8 +2531,8 @@ class XQueryLexer(ExtendedRegexLexer):
         'xml_comment': [
             (r'(-->)', popstate_xmlcomment_callback),
             (r'[^-]{1,2}', Literal),
-            (r'\u009|\u00A|\u00D|[\u0020-\u00D7FF]|[\u00E000-\u00FFFD]|'
-             r'[\u0010000-\u0010FFFF]', Literal),
+            (ur'\t|\r|\n|[\u0020-\U0000D7FF]|[\U0000E000-\U0000FFFD]|'
+             ur'[\U00010000-\U0010FFFF]', Literal),
         ],
         'processing_instruction': [
             (r'\s+', Text, 'processing_instruction_content'),
@@ -2332,13 +2541,13 @@ class XQueryLexer(ExtendedRegexLexer):
         ],
         'processing_instruction_content': [
             (r'\?>', String.Doc, '#pop'),
-            (r'\u009|\u00A|\u00D|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
-             r'[\u10000-\u10FFFF]', Literal),
+            (ur'\t|\r|\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
+             ur'[\U00010000-\U0010FFFF]', Literal),
         ],
         'cdata_section': [
             (r']]>', String.Doc, '#pop'),
-            (r'\u009|\u00A|\u00D|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
-             r'[\u10000-\u10FFFF]', Literal),
+            (ur'\t|\r|\n|[\u0020-\uD7FF]|[\uE000-\uFFFD]|'
+             ur'[\U00010000-\U0010FFFF]', Literal),
         ],
         'start_tag': [
             include('whitespace'),
@@ -2406,9 +2615,9 @@ class XQueryLexer(ExtendedRegexLexer):
         ],
         'pragmacontents': [
             (r'#\)', Punctuation, 'operator'),
-            (r'\u009|\u00A|\u00D|[\u0020-\u00D7FF]|[\u00E000-\u00FFFD]|'
-             r'[\u0010000-\u0010FFFF]', Literal),
-            (r'(\s*)', Text),
+            (ur'\t|\r|\n|[\u0020-\U0000D7FF]|[\U0000E000-\U0000FFFD]|'
+             ur'[\U00010000-\U0010FFFF]', Literal),
+            (r'(\s+)', Text),
         ],
         'occurrenceindicator': [
             include('whitespace'),
@@ -2480,7 +2689,7 @@ class XQueryLexer(ExtendedRegexLexer):
             (r'(\))(\s+)(as)', bygroups(Operator, Text, Keyword), 'itemtype'),
 
             (r'(element|attribute|schema-element|schema-attribute|comment|'
-             r'text|node|document-node)(\s+)(\()',
+             r'text|node|document-node|empty-sequence)(\s+)(\()',
              pushstate_operator_kindtest_callback),
 
             (r'(processing-instruction)(\s+)(\()',
@@ -2514,8 +2723,9 @@ class XQueryLexer(ExtendedRegexLexer):
             (r'(element)(\s+)(?=' +qname+ r')',
              bygroups(Keyword, Text), 'element_qname'),
             #PROCESSING_INSTRUCTION
-            (r'(processing-instruction)(\s+)' + ncname + r'(\s*)(\{)',
-             bygroups(Keyword, Text, Name.Variable, Text, Punctuation), 'operator'),
+            (r'(processing-instruction)(\s+)(' + ncname + r')(\s*)(\{)',
+             bygroups(Keyword, Text, Name.Variable, Text, Punctuation),
+             'operator'),
 
             (r'(declare|define)(\s+)(function)',
              bygroups(Keyword, Text, Keyword)),
@@ -2557,16 +2767,82 @@ class XQueryLexer(ExtendedRegexLexer):
             (r'(catch)(\s*)(\()(\$)',
              bygroups(Keyword, Text, Punctuation, Name.Variable), 'varname'),
 
-            (r'@' + qname, Name.Attribute),
-            (r'@\*', Name.Attribute),
-            (r'@' + ncname, Name.Attribute),
+            (r'(@' + qname + ')', pushstate_operator_attribute_callback),
+            (r'(@\*)', pushstate_operator_attribute_callback),
+            (r'(@' + ncname + ')', pushstate_operator_attribute_callback),
 
             (r'//|/|\+|-|;|,|\(|\)', Punctuation),
 
             # STANDALONE QNAMES
-            (qname + r'(?=\s*[{])', Name.Variable, 'qname_braren'),
-            (qname + r'(?=\s*[(])', Name.Function, 'qname_braren'),
+            (qname + r'(?=\s*{)', Name.Variable, 'qname_braren'),
+            (qname + r'(?=\s*\()', Name.Function, 'qname_braren'),
             (qname, Name.Variable, 'operator'),
         ]
     }
 
+
+class DartLexer(RegexLexer):
+    """
+    For `Dart <http://dartlang.org/>`_ source code.
+
+    *New in Pygments 1.5.*
+    """
+
+    name = 'Dart'
+    aliases = ['dart']
+    filenames = ['*.dart']
+    mimetypes = ['text/x-dart']
+
+    flags = re.MULTILINE | re.DOTALL
+
+    tokens = {
+        'root': [
+            (r'#!(.*?)$', Comment.Preproc),
+            (r'(#)(import|library|source)', bygroups(Text, Keyword)),
+            (r'[^\S\n]+', Text),
+            (r'//.*?\n', Comment.Single),
+            (r'/\*.*?\*/', Comment.Multiline),
+            (r'(class|interface)(\s+)',
+             bygroups(Keyword.Declaration, Text), 'class'),
+            (r'(assert|break|case|catch|continue|default|do|else|finally|for|'
+             r'if|in|is|new|return|super|switch|this|throw|try|while)\b',
+             Keyword),
+            (r'(abstract|const|extends|factory|final|get|implements|'
+             r'native|operator|set|static|typedef|var)\b', Keyword.Declaration),
+            (r'(bool|double|Dynamic|int|num|Object|String|void)', Keyword.Type),
+            (r'(false|null|true)', Keyword.Constant),
+            (r'@"(\\\\|\\"|[^"])*"', String.Double), # raw string
+            (r"@'(\\\\|\\'|[^'])*'", String.Single), # raw string
+            (r'"', String.Double, 'string_double'),
+            (r"'", String.Single, 'string_single'),
+            (r'[a-zA-Z_$][a-zA-Z0-9_]*:', Name.Label),
+            (r'[a-zA-Z_$][a-zA-Z0-9_]*', Name),
+            (r'[~!%^&*+=|?:<>/-]', Operator),
+            (r'[(){}\[\],.;]', Punctuation),
+            (r'0[xX][0-9a-fA-F]+', Number.Hex),
+            # DIGIT+ (‘.’ DIGIT*)? EXPONENT?
+            (r'\d+(\.\d*)?([eE][+-]?\d+)?', Number),
+            (r'\.\d+([eE][+-]?\d+)?', Number), # â€˜.’ DIGIT+ EXPONENT?
+            (r'\n', Text)
+            # pseudo-keyword negate intentionally left out
+        ],
+        'class': [
+            (r'[a-zA-Z_$][a-zA-Z0-9_]*', Name.Class, '#pop')
+        ],
+        'string_double': [
+            (r'"', String.Double, '#pop'),
+            (r'[^"$]+', String.Double),
+            (r'(\$)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(String.Interpol, Name)),
+            (r'(\$\{)(.*?)(\})',
+             bygroups(String.Interpol, using(this), String.Interpol)),
+            (r'\$+', String.Double)
+        ],
+        'string_single': [
+            (r"'", String.Single, '#pop'),
+            (r"[^'$]+", String.Single),
+            (r'(\$)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(String.Interpol, Name)),
+            (r'(\$\{)(.*?)(\})',
+             bygroups(String.Interpol, using(this), String.Interpol)),
+            (r'\$+', String.Single)
+        ]
+    }
index cb59c9e64442f8e5a93374e66d2a24ce56750dd1..ea606b9c4722f31303ddc6db627849cf80492fc2 100644 (file)
@@ -32,7 +32,7 @@
         yourfilter = yourfilter:YourFilter
 
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 try:
index a486f05b8a10594b824b8f001c98999646886199..2acd6e6b6e762bc12cd524ce0e8345f1ace08615 100644 (file)
@@ -12,7 +12,7 @@
     Have a look at the `DelphiLexer` to get an idea of how to use
     this scanner.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import re
index 7bb1f3f3732f77dda9025ae033fc5494dbf9a938..470fe99fcf4c9b210fdd002013751958f2b841b8 100644 (file)
@@ -5,7 +5,7 @@
 
     Basic style object.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index d777c9c560a8e689dc85c4147a45ab67976de1ab..2be93da4b85842065f86e4ab51dee7db4907bf7c 100644 (file)
@@ -5,7 +5,7 @@
 
     Contains built-in styles.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -33,6 +33,7 @@ STYLE_MAP = {
     'vim':      'vim::VimStyle',
     'vs':       'vs::VisualStudioStyle',
     'tango':    'tango::TangoStyle',
+    'rrt':      'rrt::RrtStyle',
 }
 
 
index c494ec42f3ee7537ffaed2f809e8040655ef0320..a311487c80194e72a21292dafa28b4699023f47e 100644 (file)
@@ -5,7 +5,7 @@
 
     A colorful style, inspired by the terminal highlighting style.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 8d4ca08205b16289e9d8c72a778bd905ddcbdeba..ce6120b5cdd6604d1aa642b261b630892451c994 100644 (file)
@@ -5,7 +5,7 @@
 
     Style similar to the style used in the Borland IDEs.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 805bcf8b7cc0e629b7d46b159da5b81962a9ee92..fdec8a2f0e2df3d07dda9e26ebcf7bd30ba67c3a 100644 (file)
@@ -5,7 +5,7 @@
 
     Simple black/white only style.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index e9fb60b9b1210c48310b3ee890330aef58966350..819e81ba7f9fed04aea015c832049714c439010a 100644 (file)
@@ -5,7 +5,7 @@
 
     A colorful style, inspired by CodeRay.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index a494dba228470714ee87c54984f6ee5b0a241969..d90f08d8a89e76c17121bca44d87ab9d22616613 100644 (file)
@@ -5,7 +5,7 @@
 
     The default highlighting style.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 6283feddbbf3f9195e507eab6182cf433b2fb868..96640f87353c808debcad5117615c95527851526 100644 (file)
@@ -5,7 +5,7 @@
 
     A highlighting style for Pygments, inspired by Emacs.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index d5393d27ca097b622c2659f0b4a140a9ee0005ed..25dda6ca95cb30901b23729b172062143af0d4cc 100644 (file)
@@ -5,7 +5,7 @@
 
     A modern style based on the VIM pyte theme.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 5eb4decec095aceddbc05ffce1e5b1d7a74bd0d3..6f6f2864deab08ae07330da368c25ad14d4d3d73 100644 (file)
@@ -5,7 +5,7 @@
 
     pygments version of my "fruity" vim theme.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -30,7 +30,6 @@ class FruityStyle(Style):
         Number:             '#0086f7 bold',
         Name.Tag:           '#fb660a bold',
         Name.Variable:      '#fb660a',
-        Name.Constant:      '#fb660a',
         Comment:            '#008800 bg:#0f140f italic',
         Name.Attribute:     '#ff0086 bold',
         String:             '#0086d2',
index 0537c9e606d1c3be885886caaa75ecf8afc6ba77..2f6894194eb99fdc960a8ceededda9fb89c49109 100644 (file)
@@ -8,7 +8,7 @@
     This is a port of the style used in the `php port`_ of pygments
     by Manni. The style is called 'default' there.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 90c36646bed9ad98032a8492c1b32690d200183f..b53381228d6ecfd8fbebf126c43bf72481c30611 100644 (file)
@@ -7,7 +7,7 @@
 
     http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 01eeff312b239204453530f8a9e067233306e42b..03494fb6fa6c8a6d844a46ccad8251ee6b766c69 100644 (file)
@@ -5,7 +5,7 @@
 
     Murphy's style from CodeRay.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 7c552ec1fad72647e702979245fc92b47fc6f7ee..53749e64c34ab5e3dc90d9fcb2811c88fc8ada47 100644 (file)
@@ -5,7 +5,7 @@
 
     pygments version of my "native" vim theme.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 2ca542336b41f84f33213461b5c9a0fcabcf6018..ca8f6206b59e2056b4e578eebd40bf8a9bf7cd60 100644 (file)
@@ -7,7 +7,7 @@
 
     .. _pastie: http://pastie.caboo.se/
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 89388adf4941efa0b4db882a46324d4a1f7c5828..73f9bd3cc0a580dccdf878862f576ae1c2844042 100644 (file)
@@ -7,7 +7,7 @@
 
     .. _perldoc: http://perldoc.perl.org/
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
diff --git a/pygments/styles/rrt.py b/pygments/styles/rrt.py
new file mode 100644 (file)
index 0000000..1c36385
--- /dev/null
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+"""
+    pygments.styles.rrt
+    ~~~~~~~~~~~~~~~~~~~
+
+    pygments "rrt" theme, based on Zap and Emacs defaults.
+
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+from pygments.style import Style
+from pygments.token import Comment, Name, Keyword, String
+
+
+class RrtStyle(Style):
+    """
+    Minimalistic "rrt" theme, based on Zap and Emacs defaults.
+    """
+
+    background_color = '#000000'
+    highlight_color = '#0000ff'
+
+    styles = {
+        Comment:            '#00ff00',
+        Name.Function:      '#ffff00',
+        Name.Variable:      '#eedd82',
+        Name.Constant:      '#7fffd4',
+        Keyword:            '#ff0000',
+        Comment.Preproc:    '#e5e5e5',
+        String:             '#87ceeb',
+        Keyword.Type:       '#ee82ee',
+    }
index 933cdadffa09f863ad7b8247fb7e1ee8881a673c..fea7ae5de692976a961ace0f1b756a4e32161dde 100644 (file)
@@ -33,7 +33,7 @@
     have been chosen to have the same style.  Similarly, keywords (Keyword.*),
     and Operator.Word (and, or, in) have been assigned the same style.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index f82571360b191a534fd06b04ae45716ebbb8dbc0..468a5822b6006375fb77818c2473c649d826e7a5 100644 (file)
@@ -5,7 +5,7 @@
 
     Port of the default trac highlighter design.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 04562879e050f358f9cafb8d0cb5b9f9031a3955..0aab8bcddb386b4f9e2c6950672b307be8948469 100644 (file)
@@ -5,7 +5,7 @@
 
     A highlighting style for Pygments, inspired by vim.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 7fbca3e77ba89429b8c7e3e34241f2b407a8d980..5cdda4ae1f9c7bdb489feca43dbeeaefeefb98b3 100644 (file)
@@ -5,7 +5,7 @@
 
     Simple style with MS Visual Studio colors.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 1f5139237bc2abdbdfba0f8053a66e85cccb7fa4..cf78cca2e054f629c23ba0acedafe9a8c786b21c 100644 (file)
@@ -5,7 +5,7 @@
 
     Basic token types and the standard tokens.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 8144a2736ab507a32617e070e3a28b1995f5c7e5..847bc3ea8789b91cf24fa868a953d6a7ee5f745b 100644 (file)
@@ -8,7 +8,7 @@
 
     Inspired by chartypes_create.py from the MoinMoin project.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 from pygments.util import u_prefix
index 46c5a125d1c0522b8682706cdd883a08e075133b..f8c6c824a628e56ccddf4e4d0df548b43719a020 100644 (file)
@@ -5,7 +5,7 @@
 
     Utility functions.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -118,7 +118,7 @@ def make_analysator(f):
             return 0.0
         try:
             return min(1.0, max(0.0, float(rv)))
-        except ValueError:
+        except (ValueError, TypeError):
             return 0.0
     text_analyse.__doc__ = f.__doc__
     return staticmethod(text_analyse)
index 798297b9c037c5517cb7fd5965450ac5699a56be..e1c7544db454683e8775e2a8f9ea895438aab1c6 100755 (executable)
@@ -7,7 +7,7 @@
     Make sure each Python file has a correct file header
     including copyright and license information.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -30,7 +30,7 @@ def checker(*suffixes, **kwds):
 
 
 name_mail_re = r'[\w ]+(<.*?>)?'
-copyright_re = re.compile(r'^    :copyright: Copyright (?:\d{4}-)?2010 by '
+copyright_re = re.compile(r'^    :copyright: Copyright 2006-2012 by '
                           r'the Pygments team, see AUTHORS\.$', re.UNICODE)
 copyright_2_re = re.compile(r'^                %s(, %s)*[,.]$' %
                             (name_mail_re, name_mail_re), re.UNICODE)
index d78e4a73556d1812adbb0c1ad3c4e197b976093f..35db143fec6ac57e2447e62bd65c90ef995a57cf 100755 (executable)
@@ -7,7 +7,7 @@
     Find code tags in specified files and/or directories
     and create a report in HTML format.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index cb22ae892f3df758487ddfcd4629598ef497a191..453f16edea5dd0f3ae1660be5d6d8024d46fde76 100755 (executable)
@@ -8,7 +8,7 @@
     the text where Error tokens are being generated, along
     with some context.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -24,6 +24,7 @@ except ImportError:
 from pygments.lexer import RegexLexer
 from pygments.lexers import get_lexer_for_filename, get_lexer_by_name
 from pygments.token import Error, Text, _TokenType
+from pygments.cmdline import _parse_options
 
 
 class DebuggingRegexLexer(RegexLexer):
@@ -83,16 +84,16 @@ class DebuggingRegexLexer(RegexLexer):
                     break
 
 
-def main(fn, lexer=None):
+def main(fn, lexer=None, options={}):
     if lexer is not None:
         lx = get_lexer_by_name(lexer)
     else:
         try:
-            lx = get_lexer_for_filename(os.path.basename(fn))
+            lx = get_lexer_for_filename(os.path.basename(fn), **options)
         except ValueError:
             try:
                 name, rest = fn.split('_', 1)
-                lx = get_lexer_by_name(name)
+                lx = get_lexer_by_name(name, **options)
             except ValueError:
                 raise AssertionError('no lexer found for file %r' % fn)
     debug_lexer = False
@@ -100,10 +101,12 @@ def main(fn, lexer=None):
     if lx.__class__.__bases__ == (RegexLexer,):
         lx.__class__.__bases__ = (DebuggingRegexLexer,)
         debug_lexer = True
+    elif lx.__class__.__bases__ == (DebuggingRegexLexer,):
+        # already debugged before
+        debug_lexer = True
     lno = 1
     text = file(fn, 'U').read()
     text = text.strip('\n') + '\n'
-    text = text.decode('latin1')
     tokens = []
     states = []
 
@@ -120,10 +123,10 @@ def main(fn, lexer=None):
             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):
+                for tok, state in map(None, tokens, states):
                     show_token(tok, state)
             else:
-                for i in range(len(tokens) - num, len(tokens)):
+                for i in range(max(len(tokens) - num, 0), len(tokens)):
                     show_token(tokens[i], states[i])
             print 'Error token:'
             l = len(repr(val))
@@ -140,7 +143,7 @@ def main(fn, lexer=None):
             else:
                 states.append(None)
     if showall:
-        for tok, state in zip(tokens, states):
+        for tok, state in map(None, tokens, states):
             show_token(tok, state)
     return 0
 
@@ -148,10 +151,11 @@ def main(fn, lexer=None):
 num = 10
 showall = False
 lexer = None
+options = {}
 
 if __name__ == '__main__':
     import getopt
-    opts, args = getopt.getopt(sys.argv[1:], 'n:l:a')
+    opts, args = getopt.getopt(sys.argv[1:], 'n:l:aO:')
     for opt, val in opts:
         if opt == '-n':
             num = int(val)
@@ -159,7 +163,9 @@ if __name__ == '__main__':
             showall = True
         elif opt == '-l':
             lexer = val
+        elif opt == '-O':
+            options = _parse_options([val])
     ret = 0
     for f in args:
-        ret += main(f, lexer)
+        ret += main(f, lexer, options)
     sys.exit(bool(ret))
index 1ecf7148829aaa8ffa44ea1a1faab01dcdf23d25..153c88c3fc248cd950e629f20ecd01f7e0569b80 100644 (file)
@@ -22,11 +22,16 @@ def getkw(input, output):
 
             # Extract all the shortened versions
             for i in r_item.finditer(m.group(2)):
-                d.append((i.group(1), "%s%s" % (i.group(1), i.group(2) or '')))
-            d.sort()
+                d.append('(%r,%r)' %
+                         (i.group(1), "%s%s" % (i.group(1), i.group(2) or '')))
+
+    output_info['option'].append("('nnoremap','nnoremap')")
+    output_info['option'].append("('inoremap','inoremap')")
+    output_info['option'].append("('vnoremap','vnoremap')")
 
     for a, b in output_info.items():
-        print >>out, '%s=%r' % (a, b)
+        b.sort()
+        print >>out, '%s=[%s]' % (a, ','.join(b))
 
 def is_keyword(w, keywords):
     for i in range(len(w), 0, -1):
@@ -35,4 +40,4 @@ def is_keyword(w, keywords):
     return False
 
 if __name__ == "__main__":
-    getkw("/usr/share/vim/vim70/syntax/vim.vim", "temp.py")
+    getkw("/usr/share/vim/vim73/syntax/vim.vim", "temp.py")
index 2b9380b155f07342cb87c06a2eb1ebeee3878dc4..caee9a808c1ebac393ceb88f6085fd3d17deac96 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@
     .. _Pygments tip:
        http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -60,7 +60,7 @@ else:
 
 setup(
     name = 'Pygments',
-    version = '1.4',
+    version = '1.5',
     url = 'http://pygments.org/',
     license = 'BSD License',
     author = 'Georg Brandl',
diff --git a/tests/examplefiles/antlr_throws b/tests/examplefiles/antlr_throws
new file mode 100644 (file)
index 0000000..816d891
--- /dev/null
@@ -0,0 +1 @@
+public f throws a, b, c : x ;
index 7e19f887509cdaa39ce2d3ab4d8f3dcc75acd65b..d6b08424a771c91b6662f492a1e4202fb0046a22 100644 (file)
@@ -7,7 +7,7 @@
                        private static const ADD_SONG:uint = 1;
                        private static const SONG_DETAIL:uint = 2;
                        
-                       private var playList:PlayList = new PlayList();
+                       private var playList:PlayList = new PlayList.<T>();
 
                        private function initApp():void
                        {
@@ -24,7 +24,7 @@
                        }
 
 
-                       private function sortList(sortField:SortProperty):void
+                       private function sortList(sortField:SortProperty.<T>):void
                        {
                                // Make all the sort type buttons enabled.
                                // The active one will be grayed-out below
index ff435b77537fbe53d3ba1ca88aaa4fb7dce38321..6dd55ff2a3c8778bb741d1db1e9b9c54d45e82db 100644 (file)
@@ -22,3 +22,19 @@ end function;
 define constant $blue-car = make(<car>, model: "Viper");
 define constant $black-car = make(<car>, model: "Town Car", sunroof?: #t);
 define constant $red-car = make(<car>, model: "F40", sunroof?: #f);
+
+define method foo() => _ :: <boolean>
+  #t
+end method;
+
+define method foo() => _ :: <boolean>;
+  #t
+end method;
+
+define method \+()
+end;
+
+define constant $symbol = #"hello";
+define variable *vector* = #[3.5, 5]
+define constant $list = #(1, 2);
+define constant $pair = #(1 . "foo")
diff --git a/tests/examplefiles/coq_RelationClasses b/tests/examplefiles/coq_RelationClasses
new file mode 100644 (file)
index 0000000..94c51bf
--- /dev/null
@@ -0,0 +1,447 @@
+(* -*- coding: utf-8 -*- *)
+(************************************************************************)
+(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
+(* <O___,, *   INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011     *)
+(*   \VV/  **************************************************************)
+(*    //   *      This file is distributed under the terms of the       *)
+(*         *       GNU Lesser General Public License Version 2.1        *)
+(************************************************************************)
+
+(** *  Typeclass-based relations, tactics and standard instances
+
+   This is the basic theory needed to formalize morphisms and setoids.
+
+   Author: Matthieu Sozeau
+   Institution: LRI, CNRS UMR 8623 - University Paris Sud
+*)
+
+(* $Id: RelationClasses.v 14641 2011-11-06 11:59:10Z herbelin $ *)
+
+Require Export Coq.Classes.Init.
+Require Import Coq.Program.Basics.
+Require Import Coq.Program.Tactics.
+Require Import Coq.Relations.Relation_Definitions.
+
+(** We allow to unfold the [relation] definition while doing morphism search. *)
+
+Notation inverse R := (flip (R:relation _) : relation _).
+
+Definition complement {A} (R : relation A) : relation A := fun x y => R x y -> False.
+
+(** Opaque for proof-search. *)
+Typeclasses Opaque complement.
+
+(** These are convertible. *)
+
+Lemma complement_inverse : forall A (R : relation A), complement (inverse R) = inverse (complement R).
+Proof. reflexivity. Qed.
+
+(** We rebind relations in separate classes to be able to overload each proof. *)
+
+Set Implicit Arguments.
+Unset Strict Implicit.
+
+Class Reflexive {A} (R : relation A) :=
+  reflexivity : forall x, R x x.
+
+Class Irreflexive {A} (R : relation A) :=
+  irreflexivity : Reflexive (complement R).
+
+Hint Extern 1 (Reflexive (complement _)) => class_apply @irreflexivity : typeclass_instances.
+
+Class Symmetric {A} (R : relation A) :=
+  symmetry : forall x y, R x y -> R y x.
+
+Class Asymmetric {A} (R : relation A) :=
+  asymmetry : forall x y, R x y -> R y x -> False.
+
+Class Transitive {A} (R : relation A) :=
+  transitivity : forall x y z, R x y -> R y z -> R x z.
+
+Hint Resolve @irreflexivity : ord.
+
+Unset Implicit Arguments.
+
+(** A HintDb for relations. *)
+
+Ltac solve_relation :=
+  match goal with
+  | [ |- ?R ?x ?x ] => reflexivity
+  | [ H : ?R ?x ?y |- ?R ?y ?x ] => symmetry ; exact H
+  end.
+
+Hint Extern 4 => solve_relation : relations.
+
+(** We can already dualize all these properties. *)
+
+Generalizable Variables A B C D R S T U l eqA eqB eqC eqD.
+
+Lemma flip_Reflexive `{Reflexive A R} : Reflexive (flip R).
+Proof. tauto. Qed.
+
+Hint Extern 3 (Reflexive (flip _)) => apply flip_Reflexive : typeclass_instances.
+
+Program Definition flip_Irreflexive `(Irreflexive A R) : Irreflexive (flip R) :=
+  irreflexivity (R:=R).
+
+Program Definition flip_Symmetric `(Symmetric A R) : Symmetric (flip R) :=
+  fun x y H => symmetry (R:=R) H.
+
+Program Definition flip_Asymmetric `(Asymmetric A R) : Asymmetric (flip R) :=
+  fun x y H H' => asymmetry (R:=R) H H'.
+
+Program Definition flip_Transitive `(Transitive A R) : Transitive (flip R) :=
+  fun x y z H H' => transitivity (R:=R) H' H.
+
+Hint Extern 3 (Irreflexive (flip _)) => class_apply flip_Irreflexive : typeclass_instances.
+Hint Extern 3 (Symmetric (flip _)) => class_apply flip_Symmetric : typeclass_instances.
+Hint Extern 3 (Asymmetric (flip _)) => class_apply flip_Asymmetric : typeclass_instances.
+Hint Extern 3 (Transitive (flip _)) => class_apply flip_Transitive : typeclass_instances.
+
+Definition Reflexive_complement_Irreflexive `(Reflexive A (R : relation A))
+   : Irreflexive (complement R).
+Proof. firstorder. Qed.
+
+Definition complement_Symmetric `(Symmetric A (R : relation A)) : Symmetric (complement R).
+Proof. firstorder. Qed.
+
+Hint Extern 3 (Symmetric (complement _)) => class_apply complement_Symmetric : typeclass_instances.
+Hint Extern 3 (Irreflexive (complement _)) => class_apply Reflexive_complement_Irreflexive : typeclass_instances.
+
+(** * Standard instances. *)
+
+Ltac reduce_hyp H :=
+  match type of H with
+    | context [ _ <-> _ ] => fail 1
+    | _ => red in H ; try reduce_hyp H
+  end.
+
+Ltac reduce_goal :=
+  match goal with
+    | [ |- _ <-> _ ] => fail 1
+    | _ => red ; intros ; try reduce_goal
+  end.
+
+Tactic Notation "reduce" "in" hyp(Hid) := reduce_hyp Hid.
+
+Ltac reduce := reduce_goal.
+
+Tactic Notation "apply" "*" constr(t) :=
+  first [ refine t | refine (t _) | refine (t _ _) | refine (t _ _ _) | refine (t _ _ _ _) |
+    refine (t _ _ _ _ _) | refine (t _ _ _ _ _ _) | refine (t _ _ _ _ _ _ _) ].
+
+Ltac simpl_relation :=
+  unfold flip, impl, arrow ; try reduce ; program_simpl ;
+    try ( solve [ intuition ]).
+
+Local Obligation Tactic := simpl_relation.
+
+(** Logical implication. *)
+
+Program Instance impl_Reflexive : Reflexive impl.
+Program Instance impl_Transitive : Transitive impl.
+
+(** Logical equivalence. *)
+
+Program Instance iff_Reflexive : Reflexive iff.
+Program Instance iff_Symmetric : Symmetric iff.
+Program Instance iff_Transitive : Transitive iff.
+
+(** Leibniz equality. *)
+
+Instance eq_Reflexive {A} : Reflexive (@eq A) := @eq_refl A.
+Instance eq_Symmetric {A} : Symmetric (@eq A) := @eq_sym A.
+Instance eq_Transitive {A} : Transitive (@eq A) := @eq_trans A.
+
+(** Various combinations of reflexivity, symmetry and transitivity. *)
+
+(** A [PreOrder] is both Reflexive and Transitive. *)
+
+Class PreOrder {A} (R : relation A) : Prop := {
+  PreOrder_Reflexive :> Reflexive R ;
+  PreOrder_Transitive :> Transitive R }.
+
+(** A partial equivalence relation is Symmetric and Transitive. *)
+
+Class PER {A} (R : relation A) : Prop := {
+  PER_Symmetric :> Symmetric R ;
+  PER_Transitive :> Transitive R }.
+
+(** Equivalence relations. *)
+
+Class Equivalence {A} (R : relation A) : Prop := {
+  Equivalence_Reflexive :> Reflexive R ;
+  Equivalence_Symmetric :> Symmetric R ;
+  Equivalence_Transitive :> Transitive R }.
+
+(** An Equivalence is a PER plus reflexivity. *)
+
+Instance Equivalence_PER `(Equivalence A R) : PER R | 10 :=
+  { PER_Symmetric := Equivalence_Symmetric ;
+    PER_Transitive := Equivalence_Transitive }.
+
+(** We can now define antisymmetry w.r.t. an equivalence relation on the carrier. *)
+
+Class Antisymmetric A eqA `{equ : Equivalence A eqA} (R : relation A) :=
+  antisymmetry : forall {x y}, R x y -> R y x -> eqA x y.
+
+Program Definition flip_antiSymmetric `(Antisymmetric A eqA R) :
+  Antisymmetric A eqA (flip R).
+Proof. firstorder. Qed.
+
+(** Leibinz equality [eq] is an equivalence relation.
+   The instance has low priority as it is always applicable
+   if only the type is constrained. *)
+
+Program Instance eq_equivalence : Equivalence (@eq A) | 10.
+
+(** Logical equivalence [iff] is an equivalence relation. *)
+
+Program Instance iff_equivalence : Equivalence iff.
+
+(** We now develop a generalization of results on relations for arbitrary predicates.
+   The resulting theory can be applied to homogeneous binary relations but also to
+   arbitrary n-ary predicates. *)
+
+Local Open Scope list_scope.
+
+(* Notation " [ ] " := nil : list_scope. *)
+(* Notation " [ x ; .. ; y ] " := (cons x .. (cons y nil) ..) (at level 1) : list_scope. *)
+
+(** A compact representation of non-dependent arities, with the codomain singled-out. *)
+
+Fixpoint arrows (l : list Type) (r : Type) : Type :=
+  match l with
+    | nil => r
+    | A :: l' => A -> arrows l' r
+  end.
+
+(** We can define abbreviations for operation and relation types based on [arrows]. *)
+
+Definition unary_operation A := arrows (A::nil) A.
+Definition binary_operation A := arrows (A::A::nil) A.
+Definition ternary_operation A := arrows (A::A::A::nil) A.
+
+(** We define n-ary [predicate]s as functions into [Prop]. *)
+
+Notation predicate l := (arrows l Prop).
+
+(** Unary predicates, or sets. *)
+
+Definition unary_predicate A := predicate (A::nil).
+
+(** Homogeneous binary relations, equivalent to [relation A]. *)
+
+Definition binary_relation A := predicate (A::A::nil).
+
+(** We can close a predicate by universal or existential quantification. *)
+
+Fixpoint predicate_all (l : list Type) : predicate l -> Prop :=
+  match l with
+    | nil => fun f => f
+    | A :: tl => fun f => forall x : A, predicate_all tl (f x)
+  end.
+
+Fixpoint predicate_exists (l : list Type) : predicate l -> Prop :=
+  match l with
+    | nil => fun f => f
+    | A :: tl => fun f => exists x : A, predicate_exists tl (f x)
+  end.
+
+(** Pointwise extension of a binary operation on [T] to a binary operation
+   on functions whose codomain is [T].
+   For an operator on [Prop] this lifts the operator to a binary operation. *)
+
+Fixpoint pointwise_extension {T : Type} (op : binary_operation T)
+  (l : list Type) : binary_operation (arrows l T) :=
+  match l with
+    | nil => fun R R' => op R R'
+    | A :: tl => fun R R' =>
+      fun x => pointwise_extension op tl (R x) (R' x)
+  end.
+
+(** Pointwise lifting, equivalent to doing [pointwise_extension] and closing using [predicate_all]. *)
+
+Fixpoint pointwise_lifting (op : binary_relation Prop)  (l : list Type) : binary_relation (predicate l) :=
+  match l with
+    | nil => fun R R' => op R R'
+    | A :: tl => fun R R' =>
+      forall x, pointwise_lifting op tl (R x) (R' x)
+  end.
+
+(** The n-ary equivalence relation, defined by lifting the 0-ary [iff] relation. *)
+
+Definition predicate_equivalence {l : list Type} : binary_relation (predicate l) :=
+  pointwise_lifting iff l.
+
+(** The n-ary implication relation, defined by lifting the 0-ary [impl] relation. *)
+
+Definition predicate_implication {l : list Type} :=
+  pointwise_lifting impl l.
+
+(** Notations for pointwise equivalence and implication of predicates. *)
+
+Infix "<∙>" := predicate_equivalence (at level 95, no associativity) : predicate_scope.
+Infix "-∙>" := predicate_implication (at level 70, right associativity) : predicate_scope.
+
+Open Local Scope predicate_scope.
+
+(** The pointwise liftings of conjunction and disjunctions.
+   Note that these are [binary_operation]s, building new relations out of old ones. *)
+
+Definition predicate_intersection := pointwise_extension and.
+Definition predicate_union := pointwise_extension or.
+
+Infix "/∙\" := predicate_intersection (at level 80, right associativity) : predicate_scope.
+Infix "\∙/" := predicate_union (at level 85, right associativity) : predicate_scope.
+
+(** The always [True] and always [False] predicates. *)
+
+Fixpoint true_predicate {l : list Type} : predicate l :=
+  match l with
+    | nil => True
+    | A :: tl => fun _ => @true_predicate tl
+  end.
+
+Fixpoint false_predicate {l : list Type} : predicate l :=
+  match l with
+    | nil => False
+    | A :: tl => fun _ => @false_predicate tl
+  end.
+
+Notation "∙⊤∙" := true_predicate : predicate_scope.
+Notation "∙⊥∙" := false_predicate : predicate_scope.
+
+(** Predicate equivalence is an equivalence, and predicate implication defines a preorder. *)
+
+Program Instance predicate_equivalence_equivalence : Equivalence (@predicate_equivalence l).
+  Next Obligation.
+    induction l ; firstorder.
+  Qed.
+  Next Obligation.
+    induction l ; firstorder.
+  Qed.
+  Next Obligation.
+    fold pointwise_lifting.
+    induction l. firstorder.
+    intros. simpl in *. pose (IHl (x x0) (y x0) (z x0)).
+    firstorder.
+  Qed.
+
+Program Instance predicate_implication_preorder :
+  PreOrder (@predicate_implication l).
+  Next Obligation.
+    induction l ; firstorder.
+  Qed.
+  Next Obligation.
+    induction l. firstorder.
+    unfold predicate_implication in *. simpl in *.
+    intro. pose (IHl (x x0) (y x0) (z x0)). firstorder.
+  Qed.
+
+(** We define the various operations which define the algebra on binary relations,
+   from the general ones. *)
+
+Definition relation_equivalence {A : Type} : relation (relation A) :=
+  @predicate_equivalence (_::_::nil).
+
+Class subrelation {A:Type} (R R' : relation A) : Prop :=
+  is_subrelation : @predicate_implication (A::A::nil) R R'.
+
+Implicit Arguments subrelation [[A]].
+
+Definition relation_conjunction {A} (R : relation A) (R' : relation A) : relation A :=
+  @predicate_intersection (A::A::nil) R R'.
+
+Definition relation_disjunction {A} (R : relation A) (R' : relation A) : relation A :=
+  @predicate_union (A::A::nil) R R'.
+
+(** Relation equivalence is an equivalence, and subrelation defines a partial order. *)
+
+Set Automatic Introduction.
+
+Instance relation_equivalence_equivalence (A : Type) :
+  Equivalence (@relation_equivalence A).
+Proof. exact (@predicate_equivalence_equivalence (A::A::nil)). Qed.
+
+Instance relation_implication_preorder A : PreOrder (@subrelation A).
+Proof. exact (@predicate_implication_preorder (A::A::nil)). Qed.
+
+(** *** Partial Order.
+   A partial order is a preorder which is additionally antisymmetric.
+   We give an equivalent definition, up-to an equivalence relation
+   on the carrier. *)
+
+Class PartialOrder {A} eqA `{equ : Equivalence A eqA} R `{preo : PreOrder A R} :=
+  partial_order_equivalence : relation_equivalence eqA (relation_conjunction R (inverse R)).
+
+(** The equivalence proof is sufficient for proving that [R] must be a morphism
+   for equivalence (see Morphisms).
+   It is also sufficient to show that [R] is antisymmetric w.r.t. [eqA] *)
+
+Instance partial_order_antisym `(PartialOrder A eqA R) : ! Antisymmetric A eqA R.
+Proof with auto.
+  reduce_goal.
+  pose proof partial_order_equivalence as poe. do 3 red in poe.
+  apply <- poe. firstorder.
+Qed.
+
+(** The partial order defined by subrelation and relation equivalence. *)
+
+Program Instance subrelation_partial_order :
+  ! PartialOrder (relation A) relation_equivalence subrelation.
+
+  Next Obligation.
+  Proof.
+    unfold relation_equivalence in *. firstorder.
+  Qed.
+
+Typeclasses Opaque arrows predicate_implication predicate_equivalence
+  relation_equivalence pointwise_lifting.
+
+(** Rewrite relation on a given support: declares a relation as a rewrite
+   relation for use by the generalized rewriting tactic.
+   It helps choosing if a rewrite should be handled
+   by the generalized or the regular rewriting tactic using leibniz equality.
+   Users can declare an [RewriteRelation A RA] anywhere to declare default
+   relations. This is also done automatically by the [Declare Relation A RA]
+   commands. *)
+
+Class RewriteRelation {A : Type} (RA : relation A).
+
+Instance: RewriteRelation impl.
+Instance: RewriteRelation iff.
+Instance: RewriteRelation (@relation_equivalence A).
+
+(** Any [Equivalence] declared in the context is automatically considered
+   a rewrite relation. *)
+
+Instance equivalence_rewrite_relation `(Equivalence A eqA) : RewriteRelation eqA.
+
+(** Strict Order *)
+
+Class StrictOrder {A : Type} (R : relation A) := {
+  StrictOrder_Irreflexive :> Irreflexive R ;
+  StrictOrder_Transitive :> Transitive R
+}.
+
+Instance StrictOrder_Asymmetric `(StrictOrder A R) : Asymmetric R.
+Proof. firstorder. Qed.
+
+(** Inversing a [StrictOrder] gives another [StrictOrder] *)
+
+Lemma StrictOrder_inverse `(StrictOrder A R) : StrictOrder (inverse R).
+Proof. firstorder. Qed.
+
+(** Same for [PartialOrder]. *)
+
+Lemma PreOrder_inverse `(PreOrder A R) : PreOrder (inverse R).
+Proof. firstorder. Qed.
+
+Hint Extern 3 (StrictOrder (inverse _)) => class_apply StrictOrder_inverse : typeclass_instances.
+Hint Extern 3 (PreOrder (inverse _)) => class_apply PreOrder_inverse : typeclass_instances.
+
+Lemma PartialOrder_inverse `(PartialOrder A eqA R) : PartialOrder eqA (inverse R).
+Proof. firstorder. Qed.
+
+Hint Extern 3 (PartialOrder (inverse _)) => class_apply PartialOrder_inverse : typeclass_instances.
diff --git a/tests/examplefiles/example.cls b/tests/examplefiles/example.cls
new file mode 100644 (file)
index 0000000..d36ad6f
--- /dev/null
@@ -0,0 +1,15 @@
+USING Progress.Lang.*.
+
+CLASS Test INHERITS Progress.Sucks:
+
+  DEFINE PRIVATE VARIABLE cTest AS CHAR NO-UNDO.
+
+  CONSTRUCTOR PUBLIC Test():
+    SUPER().
+    MESSAGE "Why are you punishing yourself by coding in this language?".
+  END CONSTRUCTOR.
+
+  METHOD PUBLIC LOGICAL Blowup(INPUT iTime AS INT):
+  END.
+
+END CLASS.
diff --git a/tests/examplefiles/example.gs b/tests/examplefiles/example.gs
new file mode 100644 (file)
index 0000000..eb8372d
--- /dev/null
@@ -0,0 +1,106 @@
+package example
+
+uses java.util.*
+
+uses java.io.File
+
+class Person extends Contact implements IEmailable {
+
+  var _name : String
+  var _age : Integer as Age 
+  var _relationship : Relationship as readonly RelationshipOfPerson
+
+  delegate _emailHelper represents IEmailable
+
+  enum Relationship {
+    FRIEND,
+    FAMILY,
+    BUSINESS_CONTACT
+  }
+
+  // Map of names to people
+  static var ALL_PEOPLE = new HashMap<String, Person>()
+
+  /* Constructs a new Person */
+  construct( name : String, age : Integer, relationship : Relationship ) {
+    _name = name
+    _age = age
+    _relationship = relationship
+    _emailHelper = new EmailHelper( this )
+  }
+
+  property get Name():String{
+    return _name
+  }
+
+  property set Name(name : String){
+    _name = name
+  }
+
+  /* Implement IEmailable#getEmailName() */
+  override function getEmailName():String{
+    return Name
+  }
+
+  function incrementAge() {
+    _age++
+  }
+
+  @Deprecated
+  function printPersonInfo() {
+    print( "Person { Name : ${Name}, Age : ${Age}, Relationship : ${RelationshipOfPerson} }" )
+  }
+
+  static function addPerson(p : Person){
+    if(ALL_PEOPLE.containsKey(p?.Name)) {
+      throw new IllegalArgumentException( "There is already someone named '${p.Name}'." )
+    }
+    ALL_PEOPLE[p.Name] = p
+  }
+
+  static function addAllPeople( contacts : List<Contact> ) {
+    for( contact in contacts ) {
+      if( contact typeis Person and not ALL_PEOPLE.containsKey( contact.Name )) {
+        addPerson( contact )
+      }
+    }
+  }
+
+  static function getAllPeopleOlderThanNOrderedByName( age : int ) {
+    var allPeople = ALL_PEOPLE.Values
+
+    return allPeople.where( \ p -> p.Age > age ).orderBy( \ p -> p.Name )
+  }
+
+  static function loadPersonFromDB( id : Integer ) {
+    using( var conn = DBConnectionManager.getConnection(),
+      var stmt = conn.prepareStatement( "SELECT name, age, relationship FROM PEOPLE WHERE ID=?") ){
+
+      stmt.setInt( 0, 0 )
+      var result = stmt.executeQuery()
+      if( result.next() ) {
+         addPerson( new Person( result.getString( "name" ),
+                    result.getInt( "age" ),
+                    Relationship.valueOf( result.getString( "relationship" ) ) ) )
+
+      }
+    }
+  }
+
+  /* Loads in people from a CSV */
+  static function loadFromFile( file : File ) {
+    file.eachLine( \ line -> {
+      if( line.HasContent ) {
+        addPerson( line.toPerson() )
+      }
+    })
+  }
+
+  /* Save people to a CSV */
+  static function saveToFile( file : File ) {
+    using( var writer = new FileWriter( file ) ) {
+      print( PersonCSVTemplate.renderToString( ALL_PEOPLE.Values ) )
+      PersonCSVTemplate.render( writer, ALL_PEOPLE.Values )
+    }
+  }
+}
\ No newline at end of file
diff --git a/tests/examplefiles/example.gst b/tests/examplefiles/example.gst
new file mode 100644 (file)
index 0000000..55fedb4
--- /dev/null
@@ -0,0 +1,7 @@
+<%!-- defined in example/PersonCSVTemplate.gst --%>
+
+<%@ params( users : Collection <User> ) %>
+
+<%  for( user in users ) { %>
+
+${user.LastName}, ${user.FirstName}, ${user.Department}  <%  } %>
\ No newline at end of file
diff --git a/tests/examplefiles/example.kt b/tests/examplefiles/example.kt
new file mode 100644 (file)
index 0000000..5929133
--- /dev/null
@@ -0,0 +1,47 @@
+package addressbook
+
+class Contact(
+  val name : String,
+  val emails : List<EmailAddress>,
+  val addresses : List<PostalAddress>,
+  val phonenums : List<PhoneNumber>
+)
+
+class EmailAddress(
+  val user : String,
+  val host : String
+)
+
+class PostalAddress(
+  val streetAddress : String,
+  val city : String,
+  val zip : String,
+  val state : USState?,
+  val country : Country
+) {
+   assert {(state == null) xor (country == Countries["US"]) }
+}
+
+class PhoneNumber(
+  val country : Country,
+  val areaCode : Int,
+  val number : Long
+)
+
+object Countries {
+  fun get(id : CountryID) : Country = countryTable[id]
+  
+  private var table : Map<String, Country>? = null
+  private val countryTable : Map<String, Country>
+    get() {
+      if (table == null) {
+        table = HashMap()
+        for (line in TextFile("countries.txt").lines(stripWhiteSpace = true)) {
+          table[line] = Country(line)
+        }
+      }
+      return table
+    }
+}
+
+class Country(val name : String)
\ No newline at end of file
diff --git a/tests/examplefiles/example.moon b/tests/examplefiles/example.moon
new file mode 100644 (file)
index 0000000..d4415e3
--- /dev/null
@@ -0,0 +1,629 @@
+-- transform.moon
+-- Leaf Corcoran (leafot@gmail.com) 2011
+--
+-- This is part of the MoonScript compiler. See <http://moonscript.org>
+-- MoonScript is licensed under the MIT License
+--
+
+module "moonscript.transform", package.seeall
+
+types = require "moonscript.types"
+util = require "moonscript.util"
+data = require "moonscript.data"
+
+import reversed from util
+import ntype, build, smart_node, is_slice from types
+import insert from table
+
+export Statement, Value, NameProxy, LocalName, Run
+
+-- always declares as local
+class LocalName
+  new: (@name) => self[1] = "temp_name"
+  get_name: => @name
+
+class NameProxy
+  new: (@prefix) =>
+    self[1] = "temp_name"
+
+  get_name: (scope) =>
+    if not @name
+      @name = scope\free_name @prefix, true
+    @name
+
+  chain: (...) =>
+    items = {...} -- todo: fix ... propagation
+    items = for i in *items
+      if type(i) == "string"
+        {"dot", i}
+      else
+        i
+
+    build.chain {
+      base: self
+      unpack items
+    }
+
+  index: (key) =>
+    build.chain {
+      base: self, {"index", key}
+    }
+
+  __tostring: =>
+    if @name
+      ("name<%s>")\format @name
+    else
+      ("name<prefix(%s)>")\format @prefix
+
+class Run
+  new: (@fn) =>
+    self[1] = "run"
+
+  call: (state) =>
+    self.fn state
+
+-- transform the last stm is a list of stms
+-- will puke on group
+apply_to_last = (stms, fn) ->
+  -- find last (real) exp
+  last_exp_id = 0
+  for i = #stms, 1, -1
+    stm = stms[i]
+    if stm and util.moon.type(stm) != Run
+      last_exp_id = i
+      break
+
+  return for i, stm in ipairs stms
+    if i == last_exp_id
+      fn stm
+    else
+      stm
+
+-- is a body a sindle expression/statement
+is_singular = (body) ->
+  return false if #body != 1
+  if "group" == ntype body
+    is_singular body[2]
+  else
+    true
+
+constructor_name = "new"
+
+class Transformer
+  new: (@transformers, @scope) =>
+    @seen_nodes = {}
+
+  transform: (scope, node, ...) =>
+    -- print scope, node, ...
+    return node if @seen_nodes[node]
+    @seen_nodes[node] = true
+    while true
+      transformer = @transformers[ntype node]
+      res = if transformer
+        transformer(scope, node, ...) or node
+      else
+        node
+      return node if res == node
+      node = res
+
+  __call: (node, ...) =>
+    @transform @scope, node, ...
+
+  instance: (scope) =>
+    Transformer @transformers, scope
+
+  can_transform: (node) =>
+    @transformers[ntype node] != nil
+
+construct_comprehension = (inner, clauses) ->
+  current_stms = inner
+  for _, clause in reversed clauses
+    t = clause[1]
+    current_stms = if t == "for"
+      _, names, iter = unpack clause
+      {"foreach", names, iter, current_stms}
+    elseif t == "when"
+      _, cond = unpack clause
+      {"if", cond, current_stms}
+    else
+      error "Unknown comprehension clause: "..t
+    current_stms = {current_stms}
+
+  current_stms[1]
+
+Statement = Transformer {
+  assign: (node) =>
+    _, names, values = unpack node
+    -- bubble cascading assigns
+    if #values == 1 and types.cascading[ntype values[1]]
+      values[1] = @transform.statement values[1], (stm) ->
+        t = ntype stm
+        if types.is_value stm
+          {"assign", names, {stm}}
+        else
+          stm
+
+      build.group {
+        {"declare", names}
+        values[1]
+      }
+    else
+      node
+
+  export: (node) =>
+    -- assign values if they are included
+    if #node > 2
+      if node[2] == "class"
+        cls = smart_node node[3]
+        build.group {
+          {"export", {cls.name}}
+          cls
+        }
+      else
+        build.group {
+          node
+          build.assign {
+            names: node[2]
+            values: node[3]
+          }
+        }
+    else
+      nil
+
+  update: (node) =>
+    _, name, op, exp = unpack node
+    op_final = op\match "^(.+)=$"
+    error "Unknown op: "..op if not op_final
+    build.assign_one name, {"exp", name, op_final, exp}
+
+  import: (node) =>
+    _, names, source = unpack node
+
+    stubs = for name in *names
+      if type(name) == "table"
+        name
+      else
+        {"dot", name}
+
+    real_names = for name in *names
+      type(name) == "table" and name[2] or name
+
+    if type(source) == "string"
+      build.assign {
+        names: real_names
+        values: [build.chain { base: source, stub} for stub in *stubs]
+      }
+    else
+      source_name = NameProxy "table"
+      build.group {
+        {"declare", real_names}
+        build["do"] {
+          build.assign_one source_name, source
+          build.assign {
+            names: real_names
+            values: [build.chain { base: source_name, stub} for stub in *stubs]
+          }
+        }
+      }
+
+  comprehension: (node, action) =>
+    _, exp, clauses = unpack node
+
+    action = action or (exp) -> {exp}
+    construct_comprehension action(exp), clauses
+
+  -- handle cascading return decorator
+  if: (node, ret) =>
+    if ret
+      smart_node node
+      -- mutate all the bodies
+      node['then'] = apply_to_last node['then'], ret
+      for i = 4, #node
+        case = node[i]
+        body_idx = #node[i]
+        case[body_idx] = apply_to_last case[body_idx], ret
+    node
+
+  with: (node, ret) =>
+    _, exp, block = unpack node
+    scope_name = NameProxy "with"
+    build["do"] {
+      build.assign_one scope_name, exp
+      Run => @set "scope_var", scope_name
+      build.group block
+      if ret
+        ret scope_name
+    }
+
+  foreach: (node) =>
+    smart_node node
+    if ntype(node.iter) == "unpack"
+      list = node.iter[2]
+
+      index_name = NameProxy "index"
+      list_name = NameProxy "list"
+
+      slice_var = nil
+      bounds = if is_slice list
+        slice = list[#list]
+        table.remove list
+        table.remove slice, 1
+
+        slice[2] = if slice[2] and slice[2] != ""
+          max_tmp_name = NameProxy "max"
+          slice_var = build.assign_one max_tmp_name, slice[2]
+          {"exp", max_tmp_name, "<", 0
+            "and", {"length", list_name}, "+", max_tmp_name
+            "or", max_tmp_name }
+        else
+          {"length", list_name}
+
+        slice
+      else
+        {1, {"length", list_name}}
+
+      build.group {
+        build.assign_one list_name, list
+        slice_var
+        build["for"] {
+          name: index_name
+          bounds: bounds
+          body: {
+            {"assign", node.names, {list_name\index index_name}}
+            build.group node.body
+          }
+        }
+      }
+
+  switch: (node, ret) =>
+    _, exp, conds = unpack node
+    exp_name = NameProxy "exp"
+
+    -- convert switch conds into if statment conds
+    convert_cond = (cond) ->
+      t, case_exp, body = unpack cond
+      out = {}
+      insert out, t == "case" and "elseif" or "else"
+      if  t != "else"
+        insert out, {"exp", case_exp, "==", exp_name} if t != "else"
+      else
+        body = case_exp
+
+      if ret
+        body = apply_to_last body, ret
+
+      insert out, body
+
+      out
+
+    first = true
+    if_stm = {"if"}
+    for cond in *conds
+      if_cond = convert_cond cond
+      if first
+        first = false
+        insert if_stm, if_cond[2]
+        insert if_stm, if_cond[3]
+      else
+        insert if_stm, if_cond
+
+    build.group {
+      build.assign_one exp_name, exp
+      if_stm
+    }
+
+  class: (node) =>
+    _, name, parent_val, body = unpack node
+
+    -- split apart properties and statements
+    statements = {}
+    properties = {}
+    for item in *body
+      switch item[1]
+        when "stm"
+          insert statements, item[2]
+        when "props"
+          for tuple in *item[2,]
+            insert properties, tuple
+
+    -- find constructor
+    constructor = nil
+    properties = for tuple in *properties
+      if tuple[1] == constructor_name
+        constructor = tuple[2]
+        nil
+      else
+        tuple
+
+    parent_cls_name = NameProxy "parent"
+    base_name = NameProxy "base"
+    self_name = NameProxy "self"
+    cls_name = NameProxy "class"
+
+    if not constructor
+      constructor = build.fndef {
+        args: {{"..."}}
+        arrow: "fat"
+        body: {
+          build["if"] {
+            cond: parent_cls_name
+            then: {
+              build.chain { base: "super", {"call", {"..."}} }
+            }
+          }
+        }
+      }
+    else
+      smart_node constructor
+      constructor.arrow = "fat"
+
+    cls = build.table {
+      {"__init", constructor}
+      {"__base", base_name}
+      {"__name", {"string", '"', name}} -- "quote the string"
+      {"__parent", parent_cls_name}
+    }
+
+    -- look up a name in the class object
+    class_lookup = build["if"] {
+      cond: {"exp", "val", "==", "nil", "and", parent_cls_name}
+      then: {
+        parent_cls_name\index"name"
+      }
+    }
+    insert class_lookup, {"else", {"val"}}
+
+    cls_mt = build.table {
+      {"__index", build.fndef {
+        args: {{"cls"}, {"name"}}
+        body: {
+          build.assign_one LocalName"val", build.chain {
+            base: "rawget", {"call", {base_name, "name"}}
+          }
+          class_lookup
+        }
+      }}
+      {"__call", build.fndef {
+        args: {{"cls"}, {"..."}}
+        body: {
+          build.assign_one self_name, build.chain {
+            base: "setmetatable"
+            {"call", {"{}", base_name}}
+          }
+          build.chain {
+            base: "cls.__init"
+            {"call", {self_name, "..."}}
+          }
+          self_name
+        }
+      }}
+    }
+
+    cls = build.chain {
+      base: "setmetatable"
+      {"call", {cls, cls_mt}}
+    }
+
+    value = nil
+    with build
+      value = .block_exp {
+        Run =>
+          @set "super", (block, chain) ->
+            if chain
+              slice = [item for item in *chain[3,]]
+              new_chain = {"chain", parent_cls_name}
+
+              head = slice[1]
+
+              if head == nil
+                return parent_cls_name
+
+              switch head[1]
+                -- calling super, inject calling name and self into chain
+                when "call"
+                  calling_name = block\get"current_block"
+                  slice[1] = {"call", {"self", unpack head[2]}}
+                  act = if ntype(calling_name) != "value" then "index" else "dot"
+                  insert new_chain, {act, calling_name}
+
+                -- colon call on super, replace class with self as first arg
+                when "colon"
+                  call = head[3]
+                  insert new_chain, {"dot", head[2]}
+                  slice[1] = { "call", { "self", unpack call[2] } }
+
+              insert new_chain, item for item in *slice
+
+              new_chain
+            else
+              parent_cls_name
+
+        .assign_one parent_cls_name, parent_val == "" and "nil" or parent_val
+        .assign_one base_name, {"table", properties}
+        .assign_one base_name\chain"__index", base_name
+
+        build["if"] {
+          cond: parent_cls_name
+          then: {
+            .chain {
+              base: "setmetatable"
+              {"call", {
+                base_name,
+                .chain { base: parent_cls_name,  {"dot", "__base"}}
+              }}
+            }
+          }
+        }
+
+        .assign_one cls_name, cls
+        .assign_one base_name\chain"__class", cls_name
+
+        .group if #statements > 0 {
+          .assign_one LocalName"self", cls_name
+          .group statements
+        } else {}
+
+        cls_name
+      }
+
+      value = .group {
+        .declare names: {name}
+        .assign {
+          names: {name}
+          values: {value}
+        }
+      }
+
+    value
+}
+
+class Accumulator
+  body_idx: { for: 4, while: 3, foreach: 4 }
+
+  new: =>
+    @accum_name = NameProxy "accum"
+    @value_name = NameProxy "value"
+    @len_name = NameProxy "len"
+
+  -- wraps node and mutates body
+  convert: (node) =>
+    index = @body_idx[ntype node]
+    node[index] = @mutate_body node[index]
+    @wrap node
+
+  -- wrap the node into a block_exp
+  wrap: (node) =>
+    build.block_exp {
+      build.assign_one @accum_name, build.table!
+      build.assign_one @len_name, 0
+      node
+      @accum_name
+    }
+
+  -- mutates the body of a loop construct to save last value into accumulator
+  -- can optionally skip nil results
+  mutate_body: (body, skip_nil=true) =>
+    val = if not skip_nil and is_singular body
+      with body[1]
+        body = {}
+    else
+      body = apply_to_last body, (n) ->
+        build.assign_one @value_name, n
+      @value_name
+
+    update = {
+      {"update", @len_name, "+=", 1}
+      build.assign_one @accum_name\index(@len_name), val
+    }
+
+    if skip_nil
+      table.insert body, build["if"] {
+        cond: {"exp", @value_name, "!=", "nil"}
+        then: update
+      }
+    else
+      table.insert body, build.group update
+
+    body
+
+default_accumulator = (node) =>
+  Accumulator!\convert node
+
+
+implicitly_return = (scope) ->
+  fn = (stm) ->
+    t = ntype stm
+    if types.manual_return[t] or not types.is_value stm
+      stm
+    elseif types.cascading[t]
+      scope.transform.statement stm, fn
+    else
+      if t == "comprehension" and not types.comprehension_has_value stm
+        stm
+      else
+        {"return", stm}
+
+  fn
+
+Value = Transformer {
+  for: default_accumulator
+  while: default_accumulator
+  foreach: default_accumulator
+
+  comprehension: (node) =>
+    a = Accumulator!
+    node = @transform.statement node, (exp) ->
+      a\mutate_body {exp}, false
+    a\wrap node
+
+  tblcomprehension: (node) =>
+    _, key_exp, value_exp, clauses = unpack node
+
+    accum = NameProxy "tbl"
+    dest = build.chain { base: accum, {"index", key_exp} }
+    inner = build.assign_one dest, value_exp
+
+    build.block_exp {
+      build.assign_one accum, build.table!
+      construct_comprehension {inner}, clauses
+      accum
+    }
+
+  fndef: (node) =>
+    smart_node node
+    node.body = apply_to_last node.body, implicitly_return self
+    node
+
+  if: (node) => build.block_exp { node }
+  with: (node) => build.block_exp { node }
+  switch: (node) =>
+    build.block_exp { node }
+
+  -- pull out colon chain
+  chain: (node) =>
+    stub = node[#node]
+    if type(stub) == "table" and stub[1] == "colon_stub"
+      table.remove node, #node
+
+      base_name = NameProxy "base"
+      fn_name = NameProxy "fn"
+
+      is_super = node[2] == "super"
+      @transform.value build.block_exp {
+        build.assign {
+          names: {base_name}
+          values: {node}
+        }
+
+        build.assign {
+          names: {fn_name}
+          values: {
+            build.chain { base: base_name, {"dot", stub[2]} }
+          }
+        }
+
+        build.fndef {
+          args: {{"..."}}
+          body: {
+            build.chain {
+              base: fn_name, {"call", {is_super and "self" or base_name, "..."}}
+            }
+          }
+        }
+      }
+
+  block_exp: (node) =>
+    _, body = unpack node
+
+    fn = nil
+    arg_list = {}
+
+    insert body, Run =>
+      if @has_varargs
+        insert arg_list, "..."
+        insert fn.args, {"..."}
+
+    fn = smart_node build.fndef body: body
+    build.chain { base: {"parens", fn}, {"call", arg_list} }
+}
+
diff --git a/tests/examplefiles/example.nim b/tests/examplefiles/example.nim
new file mode 100644 (file)
index 0000000..319da01
--- /dev/null
@@ -0,0 +1,1010 @@
+import glib2, gtk2, gdk2, gtksourceview, dialogs, os, pango, osproc, strutils
+import pegs, streams
+import settings, types, cfg, search
+
+{.push callConv:cdecl.}
+
+const
+  NimrodProjectExt = ".nimprj"
+
+var win: types.MainWin
+win.Tabs = @[]
+
+search.win = addr(win)
+
+var lastSession: seq[string] = @[]
+
+var confParseFail = False # This gets set to true
+                          # When there is an error parsing the config
+
+# Load the settings
+try:
+  win.settings = cfg.load(lastSession)
+except ECFGParse:
+  # TODO: Make the dialog show the exception
+  confParseFail = True
+  win.settings = cfg.defaultSettings()
+except EIO:
+  win.settings = cfg.defaultSettings()
+
+proc getProjectTab(): int = 
+  for i in 0..high(win.tabs): 
+    if win.tabs[i].filename.endswith(NimrodProjectExt): return i
+
+proc saveTab(tabNr: int, startpath: string) =
+  if tabNr < 0: return
+  if win.Tabs[tabNr].saved: return
+  var path = ""
+  if win.Tabs[tabNr].filename == "":
+    path = ChooseFileToSave(win.w, startpath) 
+    # dialogs.nim STOCK_OPEN instead of STOCK_SAVE
+  else: 
+    path = win.Tabs[tabNr].filename
+  
+  if path != "":
+    var buffer = PTextBuffer(win.Tabs[tabNr].buffer)
+    # Get the text from the TextView
+    var startIter: TTextIter
+    buffer.getStartIter(addr(startIter))
+    
+    var endIter: TTextIter
+    buffer.getEndIter(addr(endIter))
+    
+    var text = buffer.getText(addr(startIter), addr(endIter), False)
+    # Save it to a file
+    var f: TFile
+    if open(f, path, fmWrite):
+      f.write(text)
+      f.close()
+      
+      win.tempStuff.lastSaveDir = splitFile(path).dir
+      
+      # Change the tab name and .Tabs.filename etc.
+      win.Tabs[tabNr].filename = path
+      win.Tabs[tabNr].saved = True
+      var name = extractFilename(path)
+      
+      var cTab = win.Tabs[tabNr]
+      cTab.label.setText(name)
+    else:
+      error(win.w, "Unable to write to file")  
+
+proc saveAllTabs() =
+  for i in 0..high(win.tabs): 
+    saveTab(i, os.splitFile(win.tabs[i].filename).dir)
+
+# GTK Events
+# -- w(PWindow)
+proc destroy(widget: PWidget, data: pgpointer) {.cdecl.} =
+  # gather some settings
+  win.settings.VPanedPos = PPaned(win.sourceViewTabs.getParent()).getPosition()
+  win.settings.winWidth = win.w.allocation.width
+  win.settings.winHeight = win.w.allocation.height
+
+  # save the settings
+  win.save()
+  # then quit
+  main_quit()
+
+proc delete_event(widget: PWidget, event: PEvent, user_data: pgpointer): bool =
+  var quit = True
+  for i in low(win.Tabs)..len(win.Tabs)-1:
+    if not win.Tabs[i].saved:
+      var askSave = dialogNewWithButtons("", win.w, 0,
+                            STOCK_SAVE, RESPONSE_ACCEPT, STOCK_CANCEL, 
+                            RESPONSE_CANCEL,
+                            "Close without saving", RESPONSE_REJECT, nil)
+      askSave.setTransientFor(win.w)
+      # TODO: Make this dialog look better
+      var label = labelNew(win.Tabs[i].filename & 
+          " is unsaved, would you like to save it ?")
+      PBox(askSave.vbox).pack_start(label, False, False, 0)
+      label.show()
+
+      var resp = askSave.run()
+      gtk2.destroy(PWidget(askSave))
+      case resp
+      of RESPONSE_ACCEPT:
+        saveTab(i, os.splitFile(win.tabs[i].filename).dir)
+        quit = True
+      of RESPONSE_CANCEL:
+        quit = False
+        break
+      of RESPONSE_REJECT:
+        quit = True
+      else:
+        quit = False
+        break
+
+  # If False is returned the window will close
+  return not quit
+
+proc windowState_Changed(widget: PWidget, event: PEventWindowState, 
+                         user_data: pgpointer) =
+  win.settings.winMaximized = (event.newWindowState and 
+                               WINDOW_STATE_MAXIMIZED) != 0
+
+# -- SourceView(PSourceView) & SourceBuffer
+proc updateStatusBar(buffer: PTextBuffer){.cdecl.} =
+  # Incase this event gets fired before
+  # bottomBar is initialized
+  if win.bottomBar != nil and not win.tempStuff.stopSBUpdates:  
+    var iter: TTextIter
+    
+    win.bottomBar.pop(0)
+    buffer.getIterAtMark(addr(iter), buffer.getInsert())
+    var row = getLine(addr(iter)) + 1
+    var col = getLineOffset(addr(iter))
+    discard win.bottomBar.push(0, "Line: " & $row & " Column: " & $col)
+  
+proc cursorMoved(buffer: PTextBuffer, location: PTextIter, 
+                 mark: PTextMark, user_data: pgpointer){.cdecl.} =
+  updateStatusBar(buffer)
+
+proc onCloseTab(btn: PButton, user_data: PWidget) =
+  if win.sourceViewTabs.getNPages() > 1:
+    var tab = win.sourceViewTabs.pageNum(user_data)
+    win.sourceViewTabs.removePage(tab)
+
+    win.Tabs.delete(tab)
+
+proc onSwitchTab(notebook: PNotebook, page: PNotebookPage, pageNum: guint, 
+                 user_data: pgpointer) =
+  if win.Tabs.len()-1 >= pageNum:
+    win.w.setTitle("Aporia IDE - " & win.Tabs[pageNum].filename)
+
+proc createTabLabel(name: string, t_child: PWidget): tuple[box: PWidget,
+                    label: PLabel] =
+  var box = hboxNew(False, 0)
+  var label = labelNew(name)
+  var closebtn = buttonNew()
+  closeBtn.setLabel(nil)
+  var iconSize = iconSizeFromName("tabIconSize")
+  if iconSize == 0:
+     iconSize = iconSizeRegister("tabIconSize", 10, 10)
+  var image = imageNewFromStock(STOCK_CLOSE, iconSize)
+  discard gSignalConnect(closebtn, "clicked", G_Callback(onCloseTab), t_child)
+  closebtn.setImage(image)
+  gtk2.setRelief(closebtn, RELIEF_NONE)
+  box.packStart(label, True, True, 0)
+  box.packEnd(closebtn, False, False, 0)
+  box.showAll()
+  return (box, label)
+
+proc changed(buffer: PTextBuffer, user_data: pgpointer) =
+  # Update the 'Line & Column'
+  #updateStatusBar(buffer)
+
+  # Change the tabs state to 'unsaved'
+  # and add '*' to the Tab Name
+  var current = win.SourceViewTabs.getCurrentPage()
+  var name = ""
+  if win.Tabs[current].filename == "":
+    win.Tabs[current].saved = False
+    name = "Untitled *"
+  else:
+    win.Tabs[current].saved = False
+    name = extractFilename(win.Tabs[current].filename) & " *"
+  
+  var cTab = win.Tabs[current]
+  cTab.label.setText(name)
+
+# Other(Helper) functions
+
+proc initSourceView(SourceView: var PWidget, scrollWindow: var PScrolledWindow,
+                    buffer: var PSourceBuffer) =
+  # This gets called by addTab
+  # Each tabs creates a new SourceView
+  # SourceScrolledWindow(ScrolledWindow)
+  scrollWindow = scrolledWindowNew(nil, nil)
+  scrollWindow.setPolicy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
+  scrollWindow.show()
+  
+  # SourceView(gtkSourceView)
+  SourceView = sourceViewNew(buffer)
+  PSourceView(SourceView).setInsertSpacesInsteadOfTabs(True)
+  PSourceView(SourceView).setIndentWidth(win.settings.indentWidth)
+  PSourceView(SourceView).setShowLineNumbers(win.settings.showLineNumbers)
+  PSourceView(SourceView).setHighlightCurrentLine(
+               win.settings.highlightCurrentLine)
+  PSourceView(SourceView).setShowRightMargin(win.settings.rightMargin)
+  PSourceView(SourceView).setAutoIndent(win.settings.autoIndent)
+
+  var font = font_description_from_string(win.settings.font)
+  SourceView.modifyFont(font)
+  
+  scrollWindow.add(SourceView)
+  SourceView.show()
+
+  buffer.setHighlightMatchingBrackets(
+      win.settings.highlightMatchingBrackets)
+  
+  # UGLY workaround for yet another compiler bug:
+  discard gsignalConnect(buffer, "mark-set", 
+                         GCallback(aporia.cursorMoved), nil)
+  discard gsignalConnect(buffer, "changed", GCallback(aporia.changed), nil)
+
+  # -- Set the syntax highlighter scheme
+  buffer.setScheme(win.scheme)
+
+proc addTab(name, filename: string) =
+  ## Adds a tab, if filename is not "" reads the file. And sets
+  ## the tabs SourceViews text to that files contents.
+  assert(win.nimLang != nil)
+  var buffer: PSourceBuffer = sourceBufferNew(win.nimLang)
+
+  if filename != nil and filename != "":
+    var lang = win.langMan.guessLanguage(filename, nil)
+    if lang != nil:
+      buffer.setLanguage(lang)
+    else:
+      buffer.setHighlightSyntax(False)
+
+  var nam = name
+  if nam == "": nam = "Untitled"
+  if filename == "": nam.add(" *")
+  elif filename != "" and name == "":
+    # Disable the undo/redo manager.
+    buffer.begin_not_undoable_action()
+  
+    # Load the file.
+    var file: string = readFile(filename)
+    if file != nil:
+      buffer.set_text(file, len(file))
+      
+    # Enable the undo/redo manager.
+    buffer.end_not_undoable_action()
+      
+    # Get the name.ext of the filename, for the tabs title
+    nam = extractFilename(filename)
+  
+  # Init the sourceview
+  var sourceView: PWidget
+  var scrollWindow: PScrolledWindow
+  initSourceView(sourceView, scrollWindow, buffer)
+
+  var (TabLabel, labelText) = createTabLabel(nam, scrollWindow)
+  # Add a tab
+  discard win.SourceViewTabs.appendPage(scrollWindow, TabLabel)
+
+  var nTab: Tab
+  nTab.buffer = buffer
+  nTab.sourceView = sourceView
+  nTab.label = labelText
+  nTab.saved = (filename != "")
+  nTab.filename = filename
+  win.Tabs.add(nTab)
+
+  PTextView(SourceView).setBuffer(nTab.buffer)
+
+# GTK Events Contd.
+# -- TopMenu & TopBar
+
+proc newFile(menuItem: PMenuItem, user_data: pgpointer) =
+  addTab("", "")
+  win.sourceViewTabs.setCurrentPage(win.Tabs.len()-1)
+  
+proc openFile(menuItem: PMenuItem, user_data: pgpointer) =
+  var startpath = ""
+  var currPage = win.SourceViewTabs.getCurrentPage()
+  if currPage <% win.tabs.len: 
+    startpath = os.splitFile(win.tabs[currPage].filename).dir
+
+  if startpath.len == 0:
+    # Use lastSavePath as the startpath
+    startpath = win.tempStuff.lastSaveDir
+    if startpath.len == 0:
+      startpath = os.getHomeDir()
+
+  var files = ChooseFilesToOpen(win.w, startpath)
+  if files.len() > 0:
+    for f in items(files):
+      try:
+        addTab("", f)
+      except EIO:
+        error(win.w, "Unable to read from file")
+    # Switch to the newly created tab
+    win.sourceViewTabs.setCurrentPage(win.Tabs.len()-1)
+  
+proc saveFile_Activate(menuItem: PMenuItem, user_data: pgpointer) =
+  var current = win.SourceViewTabs.getCurrentPage()
+  saveTab(current, os.splitFile(win.tabs[current].filename).dir)
+
+proc saveFileAs_Activate(menuItem: PMenuItem, user_data: pgpointer) =
+  var current = win.SourceViewTabs.getCurrentPage()
+  var (filename, saved) = (win.Tabs[current].filename, win.Tabs[current].saved)
+
+  win.Tabs[current].saved = False
+  win.Tabs[current].filename = ""
+  saveTab(current, os.splitFile(filename).dir)
+  # If the user cancels the save file dialog. Restore the previous filename
+  # and saved state
+  if win.Tabs[current].filename == "":
+    win.Tabs[current].filename = filename
+    win.Tabs[current].saved = saved
+
+proc undo(menuItem: PMenuItem, user_data: pgpointer) = 
+  var current = win.SourceViewTabs.getCurrentPage()
+  if win.Tabs[current].buffer.canUndo():
+    win.Tabs[current].buffer.undo()
+  
+proc redo(menuItem: PMenuItem, user_data: pgpointer) =
+  var current = win.SourceViewTabs.getCurrentPage()
+  if win.Tabs[current].buffer.canRedo():
+    win.Tabs[current].buffer.redo()
+    
+proc find_Activate(menuItem: PMenuItem, user_data: pgpointer) = 
+  # Get the selected text, and set the findEntry to it.
+  var currentTab = win.SourceViewTabs.getCurrentPage()
+  var insertIter: TTextIter
+  win.Tabs[currentTab].buffer.getIterAtMark(addr(insertIter), 
+                                      win.Tabs[currentTab].buffer.getInsert())
+  var insertOffset = addr(insertIter).getOffset()
+  
+  var selectIter: TTextIter
+  win.Tabs[currentTab].buffer.getIterAtMark(addr(selectIter), 
+                win.Tabs[currentTab].buffer.getSelectionBound())
+  var selectOffset = addr(selectIter).getOffset()
+  
+  if insertOffset != selectOffset:
+    var text = win.Tabs[currentTab].buffer.getText(addr(insertIter), 
+                                                   addr(selectIter), false)
+    win.findEntry.setText(text)
+
+  win.findBar.show()
+  win.findEntry.grabFocus()
+  win.replaceEntry.hide()
+  win.replaceLabel.hide()
+  win.replaceBtn.hide()
+  win.replaceAllBtn.hide()
+
+proc replace_Activate(menuitem: PMenuItem, user_data: pgpointer) =
+  win.findBar.show()
+  win.findEntry.grabFocus()
+  win.replaceEntry.show()
+  win.replaceLabel.show()
+  win.replaceBtn.show()
+  win.replaceAllBtn.show()
+  
+proc settings_Activate(menuitem: PMenuItem, user_data: pgpointer) =
+  settings.showSettings(win)
+  
+proc viewBottomPanel_Toggled(menuitem: PCheckMenuItem, user_data: pgpointer) =
+  win.settings.bottomPanelVisible = menuitem.itemGetActive()
+  if win.settings.bottomPanelVisible:
+    win.bottomPanelTabs.show()
+  else:
+    win.bottomPanelTabs.hide()
+
+var
+  pegLineError = peg"{[^(]*} '(' {\d+} ', ' \d+ ') Error:' \s* {.*}"
+  pegLineWarning = peg"{[^(]*} '(' {\d+} ', ' \d+ ') ' ('Warning:'/'Hint:') \s* {.*}"
+  pegOtherError = peg"'Error:' \s* {.*}"
+  pegSuccess = peg"'Hint: operation successful'.*"
+
+proc addText(textView: PTextView, text: string, colorTag: PTextTag = nil) =
+  if text != nil:
+    var iter: TTextIter
+    textView.getBuffer().getEndIter(addr(iter))
+
+    if colorTag == nil:
+      textView.getBuffer().insert(addr(iter), text, len(text))
+    else:
+      textView.getBuffer().insertWithTags(addr(iter), text, len(text), colorTag,
+                                          nil)
+
+proc createColor(textView: PTextView, name, color: string): PTextTag =
+  var tagTable = textView.getBuffer().getTagTable()
+  result = tagTable.tableLookup(name)
+  if result == nil:
+    result = textView.getBuffer().createTag(name, "foreground", color, nil)
+
+when not defined(os.findExe): 
+  proc findExe(exe: string): string = 
+    ## returns "" if the exe cannot be found
+    result = addFileExt(exe, os.exeExt)
+    if ExistsFile(result): return
+    var path = os.getEnv("PATH")
+    for candidate in split(path, pathSep): 
+      var x = candidate / result
+      if ExistsFile(x): return x
+    result = ""
+
+proc GetCmd(cmd, filename: string): string = 
+  var f = quoteIfContainsWhite(filename)
+  if cmd =~ peg"\s* '$' y'findExe' '(' {[^)]+} ')' {.*}":
+    var exe = quoteIfContainsWhite(findExe(matches[0]))
+    if exe.len == 0: exe = matches[0]
+    result = exe & " " & matches[1] % f
+  else:
+    result = cmd % f
+
+proc showBottomPanel() =
+  if not win.settings.bottomPanelVisible:
+    win.bottomPanelTabs.show()
+    win.settings.bottomPanelVisible = true
+    PCheckMenuItem(win.viewBottomPanelMenuItem).itemSetActive(true)
+  # Scroll to the end of the TextView
+  # This is stupid, it works sometimes... it's random
+  var endIter: TTextIter
+  win.outputTextView.getBuffer().getEndIter(addr(endIter))
+  discard win.outputTextView.scrollToIter(
+    addr(endIter), 0.25, False, 0.0, 0.0)
+
+proc compileRun(currentTab: int, shouldRun: bool) =
+  if win.Tabs[currentTab].filename.len == 0: return
+  # Clear the outputTextView
+  win.outputTextView.getBuffer().setText("", 0)
+
+  var outp = osProc.execProcess(GetCmd(win.settings.nimrodCmd,
+                                win.Tabs[currentTab].filename))
+  # Colors
+  var normalTag = createColor(win.outputTextView, "normalTag", "#3d3d3d")
+  var errorTag = createColor(win.outputTextView, "errorTag", "red")
+  var warningTag = createColor(win.outputTextView, "warningTag", "darkorange")
+  var successTag = createColor(win.outputTextView, "successTag", "darkgreen")
+  for x in outp.splitLines():
+    if x =~ pegLineError / pegOtherError:
+      win.outputTextView.addText("\n" & x, errorTag)
+    elif x=~ pegSuccess:
+      win.outputTextView.addText("\n" & x, successTag)
+      
+      # Launch the process
+      if shouldRun:
+        var filename = changeFileExt(win.Tabs[currentTab].filename, os.ExeExt)
+        var output = "\n" & osProc.execProcess(filename)
+        win.outputTextView.addText(output)
+    elif x =~ pegLineWarning:
+      win.outputTextView.addText("\n" & x, warningTag)
+    else:
+      win.outputTextView.addText("\n" & x, normalTag)
+  showBottomPanel()
+
+proc CompileCurrent_Activate(menuitem: PMenuItem, user_data: pgpointer) =
+  saveFile_Activate(nil, nil)
+  compileRun(win.SourceViewTabs.getCurrentPage(), false)
+  
+proc CompileRunCurrent_Activate(menuitem: PMenuItem, user_data: pgpointer) =
+  saveFile_Activate(nil, nil)
+  compileRun(win.SourceViewTabs.getCurrentPage(), true)
+
+proc CompileProject_Activate(menuitem: PMenuItem, user_data: pgpointer) =
+  saveAllTabs()
+  compileRun(getProjectTab(), false)
+  
+proc CompileRunProject_Activate(menuitem: PMenuItem, user_data: pgpointer) =
+  saveAllTabs()
+  compileRun(getProjectTab(), true)
+
+proc RunCustomCommand(cmd: string) = 
+  saveFile_Activate(nil, nil)
+  var currentTab = win.SourceViewTabs.getCurrentPage()
+  if win.Tabs[currentTab].filename.len == 0 or cmd.len == 0: return
+  # Clear the outputTextView
+  win.outputTextView.getBuffer().setText("", 0)
+  var outp = osProc.execProcess(GetCmd(cmd, win.Tabs[currentTab].filename))
+  var normalTag = createColor(win.outputTextView, "normalTag", "#3d3d3d")
+  for x in outp.splitLines():
+    win.outputTextView.addText("\n" & x, normalTag)
+  showBottomPanel()
+
+proc RunCustomCommand1(menuitem: PMenuItem, user_data: pgpointer) =
+  RunCustomCommand(win.settings.customCmd1)
+
+proc RunCustomCommand2(menuitem: PMenuItem, user_data: pgpointer) =
+  RunCustomCommand(win.settings.customCmd2)
+
+proc RunCustomCommand3(menuitem: PMenuItem, user_data: pgpointer) =
+  RunCustomCommand(win.settings.customCmd3)
+
+# -- FindBar
+
+proc nextBtn_Clicked(button: PButton, user_data: pgpointer) = findText(True)
+proc prevBtn_Clicked(button: PButton, user_data: pgpointer) = findText(False)
+
+proc replaceBtn_Clicked(button: PButton, user_data: pgpointer) =
+  var currentTab = win.SourceViewTabs.getCurrentPage()
+  var start, theEnd: TTextIter
+  if not win.Tabs[currentTab].buffer.getSelectionBounds(
+        addr(start), addr(theEnd)):
+    # If no text is selected, try finding a match.
+    findText(True)
+    if not win.Tabs[currentTab].buffer.getSelectionBounds(
+          addr(start), addr(theEnd)):
+      # No match
+      return
+  
+  # Remove the text
+  win.Tabs[currentTab].buffer.delete(addr(start), addr(theEnd))
+  # Insert the replacement
+  var text = getText(win.replaceEntry)
+  win.Tabs[currentTab].buffer.insert(addr(start), text, len(text))
+  
+proc replaceAllBtn_Clicked(button: PButton, user_data: pgpointer) =
+  var find = getText(win.findEntry)
+  var replace = getText(win.replaceEntry)
+  discard replaceAll(find, replace)
+  
+proc closeBtn_Clicked(button: PButton, user_data: pgpointer) = 
+  win.findBar.hide()
+
+proc caseSens_Changed(radiomenuitem: PRadioMenuitem, user_data: pgpointer) =
+  win.settings.search = "casesens"
+proc caseInSens_Changed(radiomenuitem: PRadioMenuitem, user_data: pgpointer) =
+  win.settings.search = "caseinsens"
+proc style_Changed(radiomenuitem: PRadioMenuitem, user_data: pgpointer) =
+  win.settings.search = "style"
+proc regex_Changed(radiomenuitem: PRadioMenuitem, user_data: pgpointer) =
+  win.settings.search = "regex"
+proc peg_Changed(radiomenuitem: PRadioMenuitem, user_data: pgpointer) =
+  win.settings.search = "peg"
+
+proc extraBtn_Clicked(button: PButton, user_data: pgpointer) =
+  var extraMenu = menuNew()
+  var group: PGSList
+
+  var caseSensMenuItem = radio_menu_item_new(group, "Case sensitive")
+  extraMenu.append(caseSensMenuItem)
+  discard signal_connect(caseSensMenuItem, "toggled", 
+                          SIGNAL_FUNC(caseSens_Changed), nil)
+  caseSensMenuItem.show()
+  group = caseSensMenuItem.ItemGetGroup()
+  
+  var caseInSensMenuItem = radio_menu_item_new(group, "Case insensitive")
+  extraMenu.append(caseInSensMenuItem)
+  discard signal_connect(caseInSensMenuItem, "toggled", 
+                          SIGNAL_FUNC(caseInSens_Changed), nil)
+  caseInSensMenuItem.show()
+  group = caseInSensMenuItem.ItemGetGroup()
+  
+  var styleMenuItem = radio_menu_item_new(group, "Style insensitive")
+  extraMenu.append(styleMenuItem)
+  discard signal_connect(styleMenuItem, "toggled", 
+                          SIGNAL_FUNC(style_Changed), nil)
+  styleMenuItem.show()
+  group = styleMenuItem.ItemGetGroup()
+  
+  var regexMenuItem = radio_menu_item_new(group, "Regex")
+  extraMenu.append(regexMenuItem)
+  discard signal_connect(regexMenuItem, "toggled", 
+                          SIGNAL_FUNC(regex_Changed), nil)
+  regexMenuItem.show()
+  group = regexMenuItem.ItemGetGroup()
+  
+  var pegMenuItem = radio_menu_item_new(group, "Pegs")
+  extraMenu.append(pegMenuItem)
+  discard signal_connect(pegMenuItem, "toggled", 
+                          SIGNAL_FUNC(peg_Changed), nil)
+  pegMenuItem.show()
+  
+  # Make the correct radio button active
+  case win.settings.search
+  of "casesens":
+    PCheckMenuItem(caseSensMenuItem).ItemSetActive(True)
+  of "caseinsens":
+    PCheckMenuItem(caseInSensMenuItem).ItemSetActive(True)
+  of "style":
+    PCheckMenuItem(styleMenuItem).ItemSetActive(True)
+  of "regex":
+    PCheckMenuItem(regexMenuItem).ItemSetActive(True)
+  of "peg":
+    PCheckMenuItem(pegMenuItem).ItemSetActive(True)
+
+  extraMenu.popup(nil, nil, nil, nil, 0, get_current_event_time())
+
+# GUI Initialization
+
+proc createAccelMenuItem(toolsMenu: PMenu, accGroup: PAccelGroup, 
+                         label: string, acc: gint,
+                         action: proc (i: PMenuItem, p: pgpointer)) = 
+  var result = menu_item_new(label)
+  result.addAccelerator("activate", accGroup, acc, 0, ACCEL_VISIBLE)
+  ToolsMenu.append(result)
+  show(result)
+  discard signal_connect(result, "activate", SIGNAL_FUNC(action), nil)
+
+proc createSeparator(menu: PMenu) =
+  var sep = separator_menu_item_new()
+  menu.append(sep)
+  sep.show()
+
+proc initTopMenu(MainBox: PBox) =
+  # Create a accelerator group, used for shortcuts
+  # like CTRL + S in SaveMenuItem
+  var accGroup = accel_group_new()
+  add_accel_group(win.w, accGroup)
+
+  # TopMenu(MenuBar)
+  var TopMenu = menuBarNew()
+  
+  # FileMenu
+  var FileMenu = menuNew()
+
+  var NewMenuItem = menu_item_new("New") # New
+  FileMenu.append(NewMenuItem)
+  show(NewMenuItem)
+  discard signal_connect(NewMenuItem, "activate", 
+                          SIGNAL_FUNC(newFile), nil)
+
+  createSeparator(FileMenu)
+
+  var OpenMenuItem = menu_item_new("Open...") # Open...
+  # CTRL + O
+  OpenMenuItem.add_accelerator("activate", accGroup, 
+                  KEY_o, CONTROL_MASK, ACCEL_VISIBLE) 
+  FileMenu.append(OpenMenuItem)
+  show(OpenMenuItem)
+  discard signal_connect(OpenMenuItem, "activate", 
+                          SIGNAL_FUNC(aporia.openFile), nil)
+  
+  var SaveMenuItem = menu_item_new("Save") # Save
+  # CTRL + S
+  SaveMenuItem.add_accelerator("activate", accGroup, 
+                  KEY_s, CONTROL_MASK, ACCEL_VISIBLE) 
+  FileMenu.append(SaveMenuItem)
+  show(SaveMenuItem)
+  discard signal_connect(SaveMenuItem, "activate", 
+                          SIGNAL_FUNC(saveFile_activate), nil)
+
+  var SaveAsMenuItem = menu_item_new("Save As...") # Save as...
+
+  SaveAsMenuItem.add_accelerator("activate", accGroup, 
+                  KEY_s, CONTROL_MASK or gdk2.SHIFT_MASK, ACCEL_VISIBLE) 
+  FileMenu.append(SaveAsMenuItem)
+  show(SaveAsMenuItem)
+  discard signal_connect(SaveAsMenuItem, "activate", 
+                          SIGNAL_FUNC(saveFileAs_Activate), nil)
+  
+  var FileMenuItem = menuItemNewWithMnemonic("_File")
+
+  FileMenuItem.setSubMenu(FileMenu)
+  FileMenuItem.show()
+  TopMenu.append(FileMenuItem)
+  
+  # Edit menu
+  var EditMenu = menuNew()
+
+  var UndoMenuItem = menu_item_new("Undo") # Undo
+  EditMenu.append(UndoMenuItem)
+  show(UndoMenuItem)
+  discard signal_connect(UndoMenuItem, "activate", 
+                          SIGNAL_FUNC(aporia.undo), nil)
+  
+  var RedoMenuItem = menu_item_new("Redo") # Undo
+  EditMenu.append(RedoMenuItem)
+  show(RedoMenuItem)
+  discard signal_connect(RedoMenuItem, "activate", 
+                          SIGNAL_FUNC(aporia.redo), nil)
+
+  createSeparator(EditMenu)
+  
+  var FindMenuItem = menu_item_new("Find") # Find
+  FindMenuItem.add_accelerator("activate", accGroup, 
+                  KEY_f, CONTROL_MASK, ACCEL_VISIBLE) 
+  EditMenu.append(FindMenuItem)
+  show(FindMenuItem)
+  discard signal_connect(FindMenuItem, "activate", 
+                          SIGNAL_FUNC(aporia.find_Activate), nil)
+
+  var ReplaceMenuItem = menu_item_new("Replace") # Replace
+  ReplaceMenuItem.add_accelerator("activate", accGroup, 
+                  KEY_h, CONTROL_MASK, ACCEL_VISIBLE) 
+  EditMenu.append(ReplaceMenuItem)
+  show(ReplaceMenuItem)
+  discard signal_connect(ReplaceMenuItem, "activate", 
+                          SIGNAL_FUNC(aporia.replace_Activate), nil)
+
+  createSeparator(EditMenu)
+  
+  var SettingsMenuItem = menu_item_new("Settings...") # Settings
+  EditMenu.append(SettingsMenuItem)
+  show(SettingsMenuItem)
+  discard signal_connect(SettingsMenuItem, "activate", 
+                          SIGNAL_FUNC(aporia.Settings_Activate), nil)
+
+  var EditMenuItem = menuItemNewWithMnemonic("_Edit")
+
+  EditMenuItem.setSubMenu(EditMenu)
+  EditMenuItem.show()
+  TopMenu.append(EditMenuItem)
+  
+  # View menu
+  var ViewMenu = menuNew()
+  
+  win.viewBottomPanelMenuItem = check_menu_item_new("Bottom Panel")
+  PCheckMenuItem(win.viewBottomPanelMenuItem).itemSetActive(
+         win.settings.bottomPanelVisible)
+  win.viewBottomPanelMenuItem.add_accelerator("activate", accGroup, 
+                  KEY_f9, CONTROL_MASK, ACCEL_VISIBLE) 
+  ViewMenu.append(win.viewBottomPanelMenuItem)
+  show(win.viewBottomPanelMenuItem)
+  discard signal_connect(win.viewBottomPanelMenuItem, "toggled", 
+                          SIGNAL_FUNC(aporia.viewBottomPanel_Toggled), nil)
+  
+  var ViewMenuItem = menuItemNewWithMnemonic("_View")
+
+  ViewMenuItem.setSubMenu(ViewMenu)
+  ViewMenuItem.show()
+  TopMenu.append(ViewMenuItem)       
+  
+  
+  # Tools menu
+  var ToolsMenu = menuNew()
+
+  createAccelMenuItem(ToolsMenu, accGroup, "Compile current file", 
+                      KEY_F4, aporia.CompileCurrent_Activate)
+  createAccelMenuItem(ToolsMenu, accGroup, "Compile & run current file", 
+                      KEY_F5, aporia.CompileRunCurrent_Activate)
+  createSeparator(ToolsMenu)
+  createAccelMenuItem(ToolsMenu, accGroup, "Compile project", 
+                      KEY_F8, aporia.CompileProject_Activate)
+  createAccelMenuItem(ToolsMenu, accGroup, "Compile & run project", 
+                      KEY_F9, aporia.CompileRunProject_Activate)
+  createSeparator(ToolsMenu)
+  createAccelMenuItem(ToolsMenu, accGroup, "Run custom command 1", 
+                      KEY_F1, aporia.RunCustomCommand1)
+  createAccelMenuItem(ToolsMenu, accGroup, "Run custom command 2", 
+                      KEY_F2, aporia.RunCustomCommand2)
+  createAccelMenuItem(ToolsMenu, accGroup, "Run custom command 3", 
+                      KEY_F3, aporia.RunCustomCommand3)
+  
+  var ToolsMenuItem = menuItemNewWithMnemonic("_Tools")
+  
+  ToolsMenuItem.setSubMenu(ToolsMenu)
+  ToolsMenuItem.show()
+  TopMenu.append(ToolsMenuItem)
+  
+  # Help menu
+  MainBox.packStart(TopMenu, False, False, 0)
+  TopMenu.show()
+
+proc initToolBar(MainBox: PBox) =
+  # TopBar(ToolBar)
+  var TopBar = toolbarNew()
+  TopBar.setStyle(TOOLBAR_ICONS)
+  
+  var NewFileItem = TopBar.insertStock(STOCK_NEW, "New File",
+                      "New File", SIGNAL_FUNC(aporia.newFile), nil, 0)
+  TopBar.appendSpace()
+  var OpenItem = TopBar.insertStock(STOCK_OPEN, "Open",
+                      "Open", SIGNAL_FUNC(aporia.openFile), nil, -1)
+  var SaveItem = TopBar.insertStock(STOCK_SAVE, "Save",
+                      "Save", SIGNAL_FUNC(saveFile_Activate), nil, -1)
+  TopBar.appendSpace()
+  var UndoItem = TopBar.insertStock(STOCK_UNDO, "Undo", 
+                      "Undo", SIGNAL_FUNC(aporia.undo), nil, -1)
+  var RedoItem = TopBar.insertStock(STOCK_REDO, "Redo",
+                      "Redo", SIGNAL_FUNC(aporia.redo), nil, -1)
+  
+  MainBox.packStart(TopBar, False, False, 0)
+  TopBar.show()
+  
+proc initSourceViewTabs() =
+  win.SourceViewTabs = notebookNew()
+  #win.sourceViewTabs.dragDestSet(DEST_DEFAULT_DROP, nil, 0, ACTION_MOVE)
+  discard win.SourceViewTabs.signalConnect(
+          "switch-page", SIGNAL_FUNC(onSwitchTab), nil)
+  #discard win.SourceViewTabs.signalConnect(
+  #        "drag-drop", SIGNAL_FUNC(svTabs_DragDrop), nil)
+  #discard win.SourceViewTabs.signalConnect(
+  #        "drag-data-received", SIGNAL_FUNC(svTabs_DragDataRecv), nil)
+  #discard win.SourceViewTabs.signalConnect(
+  #        "drag-motion", SIGNAL_FUNC(svTabs_DragMotion), nil)
+  win.SourceViewTabs.set_scrollable(True)
+  
+  win.SourceViewTabs.show()
+  if lastSession.len != 0:
+    for i in 0 .. len(lastSession)-1:
+      var splitUp = lastSession[i].split('|')
+      var (filename, offset) = (splitUp[0], splitUp[1])
+      addTab("", filename)
+      
+      var iter: TTextIter
+      win.Tabs[i].buffer.getIterAtOffset(addr(iter), offset.parseInt())
+      win.Tabs[i].buffer.moveMarkByName("insert", addr(iter))
+      win.Tabs[i].buffer.moveMarkByName("selection_bound", addr(iter))
+      
+      # TODO: Fix this..... :(
+      discard PTextView(win.Tabs[i].sourceView).
+          scrollToIter(addr(iter), 0.25, true, 0.0, 0.0)
+  else:
+    addTab("", "")
+  
+  # This doesn't work :\
+  win.Tabs[0].sourceView.grabFocus()
+
+  
+proc initBottomTabs() =
+  win.bottomPanelTabs = notebookNew()
+  if win.settings.bottomPanelVisible:
+    win.bottomPanelTabs.show()
+  
+  # output tab
+  var tabLabel = labelNew("Output")
+  var outputTab = vboxNew(False, 0)
+  discard win.bottomPanelTabs.appendPage(outputTab, tabLabel)
+  # Compiler tabs, gtktextview
+  var outputScrolledWindow = scrolledwindowNew(nil, nil)
+  outputScrolledWindow.setPolicy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
+  outputTab.packStart(outputScrolledWindow, true, true, 0)
+  outputScrolledWindow.show()
+  
+  win.outputTextView = textviewNew()
+  outputScrolledWindow.add(win.outputTextView)
+  win.outputTextView.show()
+  
+  outputTab.show()
+
+proc initTAndBP(MainBox: PBox) =
+  # This init's the HPaned, which splits the sourceViewTabs
+  # and the BottomPanelTabs
+  initSourceViewTabs()
+  initBottomTabs()
+  
+  var TAndBPVPaned = vpanedNew()
+  tandbpVPaned.pack1(win.sourceViewTabs, resize=True, shrink=False)
+  tandbpVPaned.pack2(win.bottomPanelTabs, resize=False, shrink=False)
+  MainBox.packStart(TAndBPVPaned, True, True, 0)
+  tandbpVPaned.setPosition(win.settings.VPanedPos)
+  TAndBPVPaned.show()
+
+proc initFindBar(MainBox: PBox) =
+  # Create a fixed container
+  win.findBar = HBoxNew(False, 0)
+  win.findBar.setSpacing(4)
+
+  # Add a Label 'Find'
+  var findLabel = labelNew("Find:")
+  win.findBar.packStart(findLabel, False, False, 0)
+  findLabel.show()
+
+  # Add a (find) text entry
+  win.findEntry = entryNew()
+  win.findBar.packStart(win.findEntry, False, False, 0)
+  discard win.findEntry.signalConnect("activate", SIGNAL_FUNC(
+                                      aporia.nextBtn_Clicked), nil)
+  win.findEntry.show()
+  var rq: TRequisition 
+  win.findEntry.sizeRequest(addr(rq))
+
+  # Make the (find) text entry longer
+  win.findEntry.set_size_request(190, rq.height)
+  
+  # Add a Label 'Replace' 
+  # - This Is only shown, when the 'Search & Replace'(CTRL + H) is shown
+  win.replaceLabel = labelNew("Replace:")
+  win.findBar.packStart(win.replaceLabel, False, False, 0)
+  #replaceLabel.show()
+  
+  # Add a (replace) text entry 
+  # - This Is only shown, when the 'Search & Replace'(CTRL + H) is shown
+  win.replaceEntry = entryNew()
+  win.findBar.packStart(win.replaceEntry, False, False, 0)
+  #win.replaceEntry.show()
+  var rq1: TRequisition 
+  win.replaceEntry.sizeRequest(addr(rq1))
+
+  # Make the (replace) text entry longer
+  win.replaceEntry.set_size_request(100, rq1.height)
+  
+  # Find next button
+  var nextBtn = buttonNew("Next")
+  win.findBar.packStart(nextBtn, false, false, 0)
+  discard nextBtn.signalConnect("clicked", 
+             SIGNAL_FUNC(aporia.nextBtn_Clicked), nil)
+  nextBtn.show()
+  var nxtBtnRq: TRequisition
+  nextBtn.sizeRequest(addr(nxtBtnRq))
+  
+  # Find previous button
+  var prevBtn = buttonNew("Previous")
+  win.findBar.packStart(prevBtn, false, false, 0)
+  discard prevBtn.signalConnect("clicked", 
+             SIGNAL_FUNC(aporia.prevBtn_Clicked), nil)
+  prevBtn.show()
+  
+  # Replace button
+  # - This Is only shown, when the 'Search & Replace'(CTRL + H) is shown
+  win.replaceBtn = buttonNew("Replace")
+  win.findBar.packStart(win.replaceBtn, false, false, 0)
+  discard win.replaceBtn.signalConnect("clicked", 
+             SIGNAL_FUNC(aporia.replaceBtn_Clicked), nil)
+  #replaceBtn.show()
+
+  # Replace all button
+  # - this Is only shown, when the 'Search & Replace'(CTRL + H) is shown
+  win.replaceAllBtn = buttonNew("Replace All")
+  win.findBar.packStart(win.replaceAllBtn, false, false, 0)
+  discard win.replaceAllBtn.signalConnect("clicked", 
+             SIGNAL_FUNC(aporia.replaceAllBtn_Clicked), nil)
+  #replaceAllBtn.show()
+  
+  # Right side ...
+  
+  # Close button - With a close stock image
+  var closeBtn = buttonNew()
+  var closeImage = imageNewFromStock(STOCK_CLOSE, ICON_SIZE_SMALL_TOOLBAR)
+  var closeBox = hboxNew(False, 0)
+  closeBtn.add(closeBox)
+  closeBox.show()
+  closeBox.add(closeImage)
+  closeImage.show()
+  discard closeBtn.signalConnect("clicked", 
+             SIGNAL_FUNC(aporia.closeBtn_Clicked), nil)
+  win.findBar.packEnd(closeBtn, False, False, 2)
+  closeBtn.show()
+  
+  # Extra button - When clicked shows a menu with options like 'Use regex'
+  var extraBtn = buttonNew()
+  var extraImage = imageNewFromStock(STOCK_PROPERTIES, ICON_SIZE_SMALL_TOOLBAR)
+
+  var extraBox = hboxNew(False, 0)
+  extraBtn.add(extraBox)
+  extraBox.show()
+  extraBox.add(extraImage)
+  extraImage.show()
+  discard extraBtn.signalConnect("clicked", 
+             SIGNAL_FUNC(aporia.extraBtn_Clicked), nil)
+  win.findBar.packEnd(extraBtn, False, False, 0)
+  extraBtn.show()
+  
+  MainBox.packStart(win.findBar, False, False, 0)
+  win.findBar.show()
+
+proc initStatusBar(MainBox: PBox) =
+  win.bottomBar = statusbarNew()
+  MainBox.packStart(win.bottomBar, False, False, 0)
+  win.bottomBar.show()
+  
+  discard win.bottomBar.push(0, "Line: 0 Column: 0")
+  
+proc initControls() =
+  # Load up the language style
+  win.langMan = languageManagerGetDefault()
+  var langpaths: array[0..1, cstring] = 
+          [cstring(os.getApplicationDir() / langSpecs), nil]
+  win.langMan.setSearchPath(addr(langpaths))
+  var nimLang = win.langMan.getLanguage("nimrod")
+  win.nimLang = nimLang
+  
+  # Load the scheme
+  var schemeMan = schemeManagerGetDefault()
+  var schemepaths: array[0..1, cstring] =
+          [cstring(os.getApplicationDir() / styles), nil]
+  schemeMan.setSearchPath(addr(schemepaths))
+  win.scheme = schemeMan.getScheme(win.settings.colorSchemeID)
+  
+  # Window
+  win.w = windowNew(gtk2.WINDOW_TOPLEVEL)
+  win.w.setDefaultSize(win.settings.winWidth, win.settings.winHeight)
+  win.w.setTitle("Aporia IDE")
+  if win.settings.winMaximized: win.w.maximize()
+  
+  win.w.show() # The window has to be shown before
+               # setting the position of the VPaned so that
+               # it gets set correctly, when the window is maximized.
+    
+  discard win.w.signalConnect("destroy", SIGNAL_FUNC(aporia.destroy), nil)
+  discard win.w.signalConnect("delete_event", 
+    SIGNAL_FUNC(aporia.delete_event), nil)
+  discard win.w.signalConnect("window-state-event", 
+    SIGNAL_FUNC(aporia.windowState_Changed), nil)
+  
+  # MainBox (vbox)
+  var MainBox = vboxNew(False, 0)
+  win.w.add(MainBox)
+  
+  initTopMenu(MainBox)
+  initToolBar(MainBox)
+  initTAndBP(MainBox)
+  initFindBar(MainBox)
+  initStatusBar(MainBox)
+  
+  MainBox.show()
+  if confParseFail:
+    dialogs.warning(win.w, "Error parsing config file, using default settings.")
+nimrod_init()
+initControls()
+main()
+
diff --git a/tests/examplefiles/example.p b/tests/examplefiles/example.p
new file mode 100644 (file)
index 0000000..e8c17e3
--- /dev/null
@@ -0,0 +1,34 @@
+{include.i}
+{nested.i {include.i}}
+
+&SCOPED-DEFINE MY_NAME "Abe"
+
+DEF VAR i AS INT NO-UNDO.
+i = 0xABE + 1337 / (1 * 1.00)
+
+def var clowercasetest as char no-undo.
+DEF VAR vardashtest AS DATETIME-TZ NO-UNDO.
+
+DEFINE TEMP-TABLE ttNames NO-UNDO
+  FIELD cName AS CHAR
+  INDEX IXPK_ttNames IS PRIMARY UNIQUE cName.
+
+/* One-line comment */
+/* Two-line
+   Comment  */
+/*
+  Nested
+  /*
+    Multiline
+    /*
+      Comment
+    */
+  */
+*/
+
+CREATE ttNames.
+ASSIGN ttNames.cName = {&MY_NAME}.
+
+FOR EACH ttNames:
+  MESSAGE "Hello, " + ttNames.cName + '!' VIEW-AS ALERT-BOX.
+END.
index 35b81ebb9b14f836f942165d685f179225f7ab2b..02f3bb0d0a83c86fd345d9e12d27cc86bcdc5ff1 100644 (file)
@@ -15,3 +15,5 @@ user@host:~/path$ su
 root@host:~#
 sh-3.1$ # on hardy
 sh$ # on etch
+(virtualenv-name)user@host:~$ ls -a
+
diff --git a/tests/examplefiles/example.sml b/tests/examplefiles/example.sml
new file mode 100644 (file)
index 0000000..31db47d
--- /dev/null
@@ -0,0 +1,156 @@
+structure C = struct
+   val a = 12
+   fun f x = x + 5
+end
+
+(*(*(*(*(* This file is all pretty strange Standard ML *)*)*)*) (**)*)
+(* Robert J. Simmons *)
+
+(* Comments (* can be nested *) *)
+structure S = struct
+  val x = (1, 2, "three")
+end
+
+structure Sv = struct
+  (* These look good *)
+  val x = (1, 2, "three")
+  val z = #2 x
+
+  (* Although these look bad (not all the numbers are constants),       *
+   * they never occur in practice, as they are equivalent to the above. *)
+  val x = {1 = 1, 3 = "three", 2 = 2}
+  val z = #
+            2 x
+
+  val || = 12
+end
+
+signature S = sig end
+
+structure S = struct
+  val x = (1, 2, "three")
+  datatype 'a t = T of 'a
+       and u = U of v * v
+  withtype v = {left: int t, right: int t}
+  exception E1 of int and E2
+  fun 'a id (x: 'a) : 'a = x
+
+  val 
+      'a id = fn (x : 'a) => x
+end
+
+signature R = sig
+  type t
+  val x : t
+  val f : t * int -> int
+end
+structure R : R = struct
+  datatype t = T of int
+  val x : t = T 0
+  fun f (T x, i : int) : int = x + i
+  fun 'a id (x: 'a) : 'a = x
+end
+
+signature BA_Z = sig 
+   val s: int
+   include S R
+end 
+
+structure b______ = struct (* What (* A * strange * name *) for ) a ( struct *)
+
+val !%&$#+-/:<=>?@\~`^|* = 3
+
+type struct' = int list
+and 'a sig' = 'a list
+and ('a, 'b) end' = 'b option * 'a list
+
+structure baz = struct
+  structure Bar = struct 
+    val foo = !%&$#+-/:<=>?@\~`^|*
+  end  
+end
+
+infixr +!+ 
+fun (a +!+ b) = (op +) (a, b)
+
+open baz S R
+
+val$$$ = fn x => fn y => fn z => fn w => w
+val (foo, ++, bar, ||) = (4, baz.Bar.foo, !%&$#+-/:<=>?@\~`^|*, Bar.foo)
+val _ = $$$foo++bar||
+
+val val'ue : ' list = []
+val struct3 : (' -> ') = fn x => x
+val end_struct_' : ('a -> 'a) = fn x => x
+val x : (''a -> ''a) = fn x => x
+val x : ('''' -> '''') = fn x => x
+val x : unit = print "Weird, huh?\n"
+val w = {x=1,y=2,##= =3,4=3}
+val {##=, x, 4=a,...} = w
+val z = #4 w
+val z = # ##= w
+
+fun f x y 0 = 4 
+  | f x y z = 4 + Sv.||
+
+exception Foo of int
+datatype ('0, 'b, '_, ') f'o'o = Bar | baZ12' | dsfa_fad | #@$ | Bug
+and (', ''', '''', ''''') bar = 
+   Bee of unit
+ | Ben of (', ''', '''', ''''') f'o'o * int
+ | X of ''' list
+
+fun q x = raise Foo x
+and h x = raise Foo (~x)
+
+val x = 4
+and y = 5
+
+fun q 0 = 4
+  | q 1 = (case 1 of 1 => 2 | 3 => 4 | x => y)
+  | q y = case y of 1 => 2 | 3 => 4 | x => y
+
+val x = ref true
+fun q 0 = 4
+  | q 1 = if false then case 1 of 1 => 2 | 3 => 4 | x => y else 19
+  | q 2 = (while !x handle Match => !x | Fail _ => !x do () ; 2)
+  | q x = (raise Match) handle Domain => 9 | Match => 3
+
+fun p 0 = 12
+  | p 1 = 8
+  | p 2 = r false
+  | p x = r true
+and r true = 19
+  | r false = 12
+
+val _ = 123
+val _ = 0001
+val _ = ~123
+val _ = ~0001
+val _ = 0w12412
+val _ = 0w12412
+val _ = 0xfA0
+val _ = ~0xfA0
+val _ = 0wxfA0
+val _ = 1.4
+val _ = ~1.4
+val _ = 1e~2
+val _ = 1E~2
+val _ = 1e2
+val _ = 1E2
+val _ = 1.4e~2
+val _ = 1.4E~2
+val _ = 1.4e2
+val _ = 1.4E2
+
+val c = #"\000"
+val st = "foo \
+        \ bar" ^ "baz \        
+        \ and \ 
+        \ such\n"
+
+val () = print st
+
+val _ = foo::bar::4::[++]
+
+end
diff --git a/tests/examplefiles/example.snobol b/tests/examplefiles/example.snobol
new file mode 100644 (file)
index 0000000..26ca5cf
--- /dev/null
@@ -0,0 +1,15 @@
+-SOME RANDOM DIRECTIVE WOULD GO HERE
+*
+* SNOBOL4 example file for lexer
+*
+ SOME.THING_OR_OTHER32 = 1 + 1.0 - 1E3 * 1E-3 ** 2.718284590E0
++ :F(END)S(IN_LOOP) 
+ PATTERN = LEN(3) ("GAR" | "BAR")
+IN_LOOP THING = INPUT :F(END)
+ THING LEN(3) ("GAR" | "BAR") :S(OK)
+ OUTPUT = THING " : Failure!" :(IN_LOOP)
+OK OUTPUT = THING ' : "Success"!' :(IN_LOOP)
+END
+FOOBAR
+FOOGAR
+THiNIg
diff --git a/tests/examplefiles/example.tea b/tests/examplefiles/example.tea
new file mode 100644 (file)
index 0000000..6859e34
--- /dev/null
@@ -0,0 +1,34 @@
+<% template example() {...}
+a = 123
+b = "test";
+c = 4.5
+d = call other()
+f = other2()
+
+define g as String
+
+h = true
+i = false
+j = null
+%>
+<html>
+<head>
+<title>Example<title>
+<body>
+<a href="http://example.com">Test link</a>
+<% // Second block
+if(a == 123 and b == "test") {
+    'yes'
+} else {
+    'no'
+}
+
+foreach(i in 1..10) {
+    i & ","
+}
+
+foreach(i in #(1,2,3) reverse {
+    i & ";"
+}
+
+%>
\ No newline at end of file
diff --git a/tests/examplefiles/example.u b/tests/examplefiles/example.u
new file mode 100644 (file)
index 0000000..42c8590
--- /dev/null
@@ -0,0 +1,548 @@
+ // This is a one line comment. 
+  /* an inner comment */ 
+ /* nested /* comments */ */ 
+  /* 
+    /* 
+       Multi-line. 
+    */ 
+  */ 
+
+// Binary blob escape. 
+//"some text \B(3)("\") ouhyeah" == "\"\\\"";
+"some text \B(3)("\") ouhyeah" == "\"\\\"";
+'some text \B(3)('\') ouhyeah' == '\'\\\'';
+
+//"\B(4)()"'()";
+"\B(4)()"'()";
+'\B(4)()'"()';
+
+//blob size limits
+"hey ! \B(0)() oh !"
+
+//blob format is wrong
+"hey ! \B(2)(aaa) oh !"
+"hey ! \B(100)(aaa) oh !"
+
+//multiple blob in a string
+"hey ! \B(3)(aaa) hey ! \B(3)(aaa) oh !"
+
+// multiple digits blob size 
+"hey ! \B(10)(aaaaaaaaaa)  !"
+"hey ! \B(10)(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)  !"
+"hey ! \B(100)(a)  !"
+
+// multiple digits blob size 
+"hey ! \B(007)(aaaaaaa)  !"
+"hey ! \B(007)(aa)  !"
+"hey ! \B(007)(aaaaaaaaaaaaaaaaaa)  !"
+
+// deprecated and restricted keyworks 
+emit Event.new;
+static int main();
+
+loopn (2) {echo("a");};
+
+foreach (var i : [1,2,3,4]) {
+       echo(i);
+};
+
+function() {};
+var 'if'; 
+var this.'else'; 
+var '%x'; 
+var '1 2 3'; 
+var this.'[]';
+       
+// angles 
+pi == 180deg; 
+pi == 200grad;
+       
+// Dictionary
+[ => ]; // The empty dictionary 
+
+// duration 
+1d   == 24h; 
+0.5d == 12h; 
+1h   == 60min; 
+1min == 60s; 
+1s   == 1000ms; 
+1s == 1; 
+1s 2s 3s == 6; 
+1s 1ms == 1.001; 
+1ms 1s == 1.001;
+       
+            1 == 1; 
+            1 == 1.0; 
+          1.2 == 1.2000; 
+      1.234e6 == 1234000; 
+        1e+11 == 1E+11; 
+         1e10 == 10000000000; 
+         1e30 == 1e10 * 1e10 * 1e10;
+       
+0.000001; 
+0.0000001; 
+0.00000000001; 
+1e+3; 
+1E-5; 
+       
+
+1.; 
+// [00004701:error] !!! syntax error: unexpected ;
+       
+      0x2a == 42; 
+      0x2A == 42; 
+  0xabcdef == 11259375; 
+  0xABCDEF == 11259375; 
+0xFFFFFFFF == 4294967295;
+       
+//123foo; 
+//[00005658:error] !!! syntax error: invalid token: '123foo' 
+//12.3foo; 
+//[00018827:error] !!! syntax error: invalid token: '12.3foo' 
+0xabcdef; 
+//[00060432] 11259375 
+//0xabcdefg; 
+//[00061848:error] !!! syntax error: invalid token: '0xabcdefg'
+       
+[]; // The empty list 
+[1, 2, 3]; 
+// Special characters. 
+"\"" == "\""; 
+"\\" == "\\"; 
+// ASCII characters. 
+"\a" == "\007"; "\a" == "\x07"; 
+"\b" == "\010"; "\b" == "\x08"; 
+"\f" == "\014"; "\f" == "\x0c"; 
+"\n" == "\012"; "\n" == "\x0a"; 
+"\r" == "\015"; "\r" == "\x0d"; 
+"\t" == "\011"; "\t" == "\x09"; 
+"\v" == "\013"; "\v" == "\x0b"; 
+// Octal escapes. 
+"\0" == "\00"; "\0" == "\000"; 
+"\0000" == "\0""0"; 
+"\062\063" == "23"; 
+// Hexadecimal escapes. 
+"\x00" == "\0"; 
+"\x32\x33" == "23"; 
+       
+"foo" "bar" "baz" == "foobarbaz";
+       
+// Tuples 
+(); 
+[00000000] () 
+(1,); 
+[00000000] (1,) 
+(1, 2); 
+[00000000] (1, 2) 
+(1, 2, 3, 4,); 
+[00000000] (1, 2, 3, 4)
+       
+function Global.verboseId(var x) 
+{ 
+  echo(x) | x 
+}|; 
+class verboseId(Global).math : verboseId(Math) 
+{ 
+}; 
+       
+{ 
+  for (3) 
+  { 
+    sleep(1s); 
+    echo("ping"); 
+  }, 
+  sleep(0.5s); 
+  for (3) 
+  { 
+    sleep(1s); 
+    echo("pong"); 
+  }, 
+}; 
+       1 + 1 ==    2; 
+       1 - 2 ==   -1; 
+       2 * 3 ==    6; 
+      10 / 2 ==    5; 
+     2 ** 10 == 1024; 
+    -(1 + 2) ==   -3; 
+   1 + 2 * 3 ==    7; 
+ (1 + 2) * 3 ==    9; 
+     -2 ** 2 ==   -4; 
+   - - - - 1 ==    1;
+
+a = b
+a += b
+a -= b
+a *= b
+a /= b
+a %= b
+a ^= b
+
+var value = 0|; 
+var valueAlias = value|; 
+value += 10; 
+valueAlias; 
+var myList = []|; 
+var myList.specialFeature = 42|; 
+myList += [1, 2, 3]; 
+myList.specialFeature; 
+var myOtherList = myList + [4, 5]; 
+myOtherList.specialFeature; 
+var something = []|; 
+var somethingElse = something|; 
+something += [1, 2]; 
+somethingElse += [3, 4]; 
+something; 
+       
+class Counter 
+{ 
+  var count = 0; 
+  function init (n)   { var this.count = n }; 
+  // Display the value, and the identity. 
+  function asString() { "%s @ %s" % [count, uid ] }; 
+  function '+'(var n) { new(count + n) }; 
+  function '-'(var n) { new(count - n) }; 
+}|;
+       
+class ImmutableCounter : Counter 
+{ 
+  function '+='(var n) { this + n }; 
+  function '-='(var n) { this - n }; 
+}|; 
+var ic1 = ImmutableCounter.new(0); 
+var ic2 = ic1; 
+ic1 += 1; 
+ic1; 
+ic2; 
+       
+
+a << b
+a >> b
+a ^ b
+4 << 2 == 16; 
+4 >> 2 ==  1;
+       
+!a
+a && b
+a || b
+true && true; 
+true || false; 
+!true == false; 
+true || (1 / 0); 
+(false && (1 / 0)) == false;
+       
+a == b
+a != b
+a === b
+a !== b
+a ~= b
+a =~= b
+a < b
+a <= b
+a > b
+a >= b
+assert{ 
+ ! (0 < 0); 
+    0 <= 0; 
+    0 == 0; 
+   0 !== 0; 
+}; 
+
+a in b
+a not in b
+a[args]
+a[args] = v
+1     in [0, 1, 2]; 
+3 not in [0, 1, 2]; 
+"one"   in     ["zero" => 0, "one" => 1, "two" => 2]; 
+"three" not in ["zero" => 0, "one" => 1, "two" => 2];
+       
+a.b
+a.b(args)
+a->b
+a->b = v
+a.&b
+var obj = Object.new|; 
+function obj.f() { 24 }|; 
+var f = function(a, b) { 
+  echo(b + a); 
+}| 
+f(1, 0); 
+       
+
+function g3() 
+{ 
+  return; // Stop execution at this point and return void 
+  echo(0); // This is not executed 
+}| 
+       
+Object.setProperty, to define/set a property.
+Object.getProperty, to get a property.
+Object.removeProperty, to delete a property.
+Object.hasProperty, to test for the existence of a property.
+Object.properties, to get all the properties of a slot.
+
+enum Suit 
+{ 
+  hearts, 
+  diamonds, 
+  clubs, 
+  spades, // Last comma is optional 
+}; 
+  
+for (var suit in Suit) 
+  echo("%s the ace of %s." % [find_ace(suit), suit]); 
+       
+switch ( ("foo", [1, 2]) ) 
+{ 
+  // The pattern does not match the values of the list. 
+  case ("foo", [2, 1]): 
+    echo("fail"); 
+  // The pattern does not match the tuple. 
+  case ["foo", [1, 2]]: 
+    echo("fail"); 
+  // The pattern matches and binds the variable "l" 
+  // but the condition is not verified. 
+  case ("foo", var l) if l.size == 0: 
+    echo("fail"); 
+  // The pattern matches. 
+  case ("foo", [var a, var b]): 
+    echo("foo(%s, %s)" % [a, b]); 
+}; 
+//[00000000] *** foo(1, 2)
+       
+{ 
+  ["b" => var b, "a" => var a] = ["a" => 1, "b" => 2, "c" => 3]; 
+  echo("a = %d, b = %d" % [a, b]); 
+}; 
+//[00000000] *** a = 1, b = 2
+       
+switch (["speed" => 2, "time" => 6s]) 
+{ 
+  case ["speed" => var s] if s > 3: 
+    echo("Too fast"); 
+  case ["speed" => var s, "time" => var t] if s * t > 10: 
+    echo("Too far"); 
+}; 
+//[00000000] *** Too far
+       
+try 
+{ 
+  throw ("message", 0) 
+} 
+catch (var e if e.isA(Exception)) 
+{ 
+  echo(e.message) 
+} 
+catch ((var msg, var value) if value.isA(Float)) 
+{ 
+  echo("%s: %d" % [msg, value]) 
+}; 
+//[00000000] *** message: 0
+       
+{ 
+  var e = Event.new; 
+  at (e?(var msg, var value) if value % 2 == 0) 
+    echo("%s: %d" % [msg, value]); 
+  // Does not trigger the "at" because the guard is not verified. 
+  e!("message", 1); 
+  // Trigger the "at". 
+  e!("message", 2); 
+}; 
+//[00000000] *** message: 2
+       
+for (var i = 0; i < 8; i++) 
+{ 
+  if (i % 2 != 0) 
+    continue; 
+  echo(i); 
+}; 
+
+do (1024) 
+{ 
+  assert(this == 1024); 
+  assert(sqrt == 32); 
+  setSlot("y", 23); 
+}.y; 
+{ 
+  var n = 10|; 
+  var res = []|; 
+  loop;{ 
+    n--; 
+    res << n; 
+    if (n == 0) 
+      break 
+  }; 
+  res 
+} 
+       
+{ 
+  var n = 10|; 
+  var res = []|; 
+  loop|{ 
+    n--; 
+    res << n; 
+    if (n == 0) 
+      break 
+  }; 
+  res 
+} 
+
+var j = 3| 
+while (0 < j) 
+{ 
+  echo(j); 
+  j--; 
+}; 
+
+{ 
+  var i = 4| 
+  while| (true) 
+  { 
+    i -= 1; 
+    echo ("in: " + i); 
+    if (i == 1) 
+      break 
+    else if (i == 2) 
+      continue; 
+    echo ("out: " + i); 
+  }; 
+}; 
+
+function test(e) 
+{ 
+  try 
+  { throw e;  } 
+  catch (0) 
+  { echo("zero") } 
+  catch ([var x, var y]) 
+  { echo(x + y) } 
+} | {}; 
+try   { echo("try") } 
+catch { echo("catch")} 
+else  { echo("else")}; 
+       
+try 
+{ 
+  echo("inside"); 
+} 
+finally 
+{ 
+  echo("finally"); 
+}; 
+//[00000001] *** inside 
+//[00000002] *** finally
+       
+at (e?(var start) ~ 1s) 
+  echo("in : %s" % (time - start).round) 
+onleave 
+  echo("out: %s" % (time - start).round); 
+// This emission is too short to trigger the at. 
+e!(time); 
+// This one is long enough. 
+// The body triggers 1s after the emission started. 
+e!(time) ~ 2s; 
+//[00001000] *** in : 1 
+//[00002000] *** out: 2
+       
+
+timeout (2.1s) 
+  every (1s) 
+    echo("Are you still there?"); 
+//[00000000] *** Are you still there? 
+//[00001000] *** Are you still there? 
+//[00002000] *** Are you still there?
+       
+  every| (1s) 
+  { 
+    echo("aba"); 
+  }; 
+
+for, (var i = 3; 0 < i; i -= 1) 
+{ 
+  echo (i); 
+}; 
+for& (var i: [0, 1, 2]) 
+{ 
+  echo (i * i); 
+}; 
+loop,{ 
+}; 
+
+
+waituntil (e?(1, var b)); 
+
+whenever (e?("arg", var arg) if arg % 2) 
+  echo("e (%s) on" % arg) 
+else 
+  echo("e off"); 
+
+
+  while, (i) 
+  { 
+    var j = i -= 1; 
+  }| 
+var y = 0; 
+{ 
+  sleep(0.5s); 
+  y = 100 smooth:3s, 
+},
+
+       
+
diff --git a/tests/examplefiles/example_elixir.ex b/tests/examplefiles/example_elixir.ex
new file mode 100644 (file)
index 0000000..2e92163
--- /dev/null
@@ -0,0 +1,363 @@
+# We cannot use to_char_list because it depends on inspect,
+# which depends on protocol, which depends on this module.
+import Elixir::Builtin, except: [to_char_list: 1]
+
+defmodule Module do
+  require Erlang.ets, as: ETS
+
+  @moduledoc """
+  This module provides many functions to deal with modules during
+  compilation time. It allows a developer to dynamically attach
+  documentation, merge data, register attributes and so forth.
+
+  After the module is compiled, using many of the functions in
+  this module will raise errors, since it is out of their purpose
+  to inspect runtime data. Most of the runtime data can be inspected
+  via the `__info__(attr)` function attached to each compiled module.
+  """
+
+  @doc """
+  Evalutes the quotes contents in the given module context.
+  Raises an error if the module was already compiled.
+
+  ## Examples
+
+      defmodule Foo do
+        contents = quote do: (def sum(a, b), do: a + b)
+        Module.eval_quoted __MODULE__, contents, [], __FILE__, __LINE__
+      end
+
+      Foo.sum(1, 2) #=> 3
+  """
+  def eval_quoted(module, quoted, binding, filename, line) do
+    assert_not_compiled!(:eval_quoted, module)
+    { binding, scope } = Erlang.elixir_module.binding_and_scope_for_eval(line, to_char_list(filename), module, binding)
+    Erlang.elixir_def.reset_last(module)
+    Erlang.elixir.eval_quoted([quoted], binding, line, scope)
+  end
+
+  @doc """
+  Checks if the module is compiled or not.
+
+  ## Examples
+
+      defmodule Foo do
+        Module.compiled?(__MODULE__) #=> false
+      end
+
+      Module.compiled?(Foo) #=> true
+
+  """
+  def compiled?(module) do
+    table = data_table_for(module)
+    table == ETS.info(table, :name)
+  end
+
+  @doc """
+  Reads the data for the given module. This is used
+  to read data of uncompiled modules. If the module
+  was already compiled, you shoul access the data
+  directly by invoking `__info__(:data)` in that module.
+
+  ## Examples
+
+      defmodule Foo do
+        Module.merge_data __MODULE__, value: 1
+        Module.read_data __MODULE__ #=> [value: 1]
+      end
+
+  """
+  def read_data(module) do
+    assert_not_compiled!(:read_data, module)
+    ETS.lookup_element(data_table_for(module), :data, 2)
+  end
+
+  @doc """
+  Reads the data from `module` at the given key `at`.
+
+  ## Examples
+
+      defmodule Foo do
+        Module.merge_data __MODULE__, value: 1
+        Module.read_data __MODULE__, :value #=> 1
+      end
+
+  """
+  def read_data(module, at) do
+    Orddict.get read_data(module), at
+  end
+
+  @doc """
+  Merge the given data into the module, overriding any
+  previous one.
+
+  If any of the given data is a registered attribute, it is
+  automatically added to the attribute set, instead of marking
+  it as data. See register_attribute/2 and add_attribute/3 for
+  more info.
+
+  ## Examples
+
+      defmodule Foo do
+        Module.merge_data __MODULE__, value: 1
+      end
+
+      Foo.__info__(:data) #=> [value: 1]
+
+  """
+  def merge_data(module, data) do
+    assert_not_compiled!(:merge_data, module)
+
+    table      = data_table_for(module)
+    old        = ETS.lookup_element(table, :data, 2)
+    registered = ETS.lookup_element(table, :registered_attributes, 2)
+
+    { attrs, new } = Enum.partition data, fn({k,_}) -> List.member?(registered, k) end
+    Enum.each attrs, fn({k,v}) -> add_attribute(module, k, v) end
+    ETS.insert(table, { :data,  Orddict.merge(old, new) })
+  end
+
+  @doc """
+  Attaches documentation to a given function. It expects
+  the module the function belongs to, the line (a non negative
+  integer), the kind (def or defmacro), a tuple representing
+  the function and its arity and the documentation, which should
+  be either a binary or a boolean.
+
+  ## Examples
+
+      defmodule MyModule do
+        Module.add_doc(__MODULE__, __LINE__ + 1, :def, { :version, 0 }, "Manually added docs")
+        def version, do: 1
+      end
+
+  """
+  def add_doc(module, line, kind, tuple, doc) when
+      is_binary(doc) or is_boolean(doc) do
+    assert_not_compiled!(:add_doc, module)
+    case kind do
+    match: :defp
+      :warn
+    else:
+      table = docs_table_for(module)
+      ETS.insert(table, { tuple, line, kind, doc })
+      :ok
+    end
+  end
+
+  @doc """
+  Checks if a function was defined, regardless if it is
+  a macro or a private function. Use function_defined?/3
+  to assert for an specific type.
+
+  ## Examples
+
+      defmodule Example do
+        Module.function_defined? __MODULE__, { :version, 0 } #=> false
+        def version, do: 1
+        Module.function_defined? __MODULE__, { :version, 0 } #=> true
+      end
+
+  """
+  def function_defined?(module, tuple) when is_tuple(tuple) do
+    assert_not_compiled!(:function_defined?, module)
+    table = function_table_for(module)
+    ETS.lookup(table, tuple) != []
+  end
+
+  @doc """
+  Checks if a function was defined and also for its `kind`.
+  `kind` can be either :def, :defp or :defmacro.
+
+  ## Examples
+
+      defmodule Example do
+        Module.function_defined? __MODULE__, { :version, 0 }, :defp #=> false
+        def version, do: 1
+        Module.function_defined? __MODULE__, { :version, 0 }, :defp #=> false
+      end
+
+  """
+  def function_defined?(module, tuple, kind) do
+    List.member? defined_functions(module, kind), tuple
+  end
+
+  @doc """
+  Return all functions defined in the given module.
+
+  ## Examples
+
+      defmodule Example do
+        def version, do: 1
+        Module.defined_functions __MODULE__ #=> [{:version,1}]
+      end
+
+  """
+  def defined_functions(module) do
+    assert_not_compiled!(:defined_functions, module)
+    table = function_table_for(module)
+    lc { tuple, _, _ } in ETS.tab2list(table), do: tuple
+  end
+
+  @doc """
+  Returns all functions defined in te given module according
+  to its kind.
+
+  ## Examples
+
+      defmodule Example do
+        def version, do: 1
+        Module.defined_functions __MODULE__, :def  #=> [{:version,1}]
+        Module.defined_functions __MODULE__, :defp #=> []
+      end
+
+  """
+  def defined_functions(module, kind) do
+    assert_not_compiled!(:defined_functions, module)
+    table = function_table_for(module)
+    entry = kind_to_entry(kind)
+    ETS.lookup_element(table, entry, 2)
+  end
+
+  @doc """
+  Adds a compilation callback hook that is invoked
+  exactly before the module is compiled.
+
+  This callback is useful when used with `use` as a mechanism
+  to clean up any internal data in the module before it is compiled.
+
+  ## Examples
+
+  Imagine you are creating a module/library that is meant for
+  external usage called `MyLib`. It could be defined as:
+
+      defmodule MyLib do
+        def __using__(target) do
+          Module.merge_data target, some_data: true
+          Module.add_compile_callback(target, __MODULE__, :__callback__)
+        end
+
+        defmacro __callback__(target) do
+          value = Orddict.get(Module.read_data(target), :some_data, [])
+          quote do: (def my_lib_value, do: unquote(value))
+        end
+      end
+
+  And a module could use `MyLib` with:
+
+      defmodule App do
+        use ModuleTest::ToBeUsed
+      end
+
+  In the example above, `MyLib` defines a data to the target. This data
+  can be updated throughout the module definition and therefore, the final
+  value of the data can only be compiled using a compiation callback,
+  which will read the final value of :some_data and compile to a function.
+  """
+  def add_compile_callback(module, target, fun // :__compiling__) do
+    assert_not_compiled!(:add_compile_callback, module)
+    new   = { target, fun }
+    table = data_table_for(module)
+    old   = ETS.lookup_element(table, :compile_callbacks, 2)
+    ETS.insert(table, { :compile_callbacks,  [new|old] })
+  end
+
+  @doc """
+  Adds an Erlang attribute to the given module with the given
+  key and value. The same attribute can be added more than once.
+
+  ## Examples
+
+      defmodule MyModule do
+        Module.add_attribute __MODULE__, :custom_threshold_for_lib, 10
+      end
+
+  """
+  def add_attribute(module, key, value) when is_atom(key) do
+    assert_not_compiled!(:add_attribute, module)
+    table = data_table_for(module)
+    attrs = ETS.lookup_element(table, :attributes, 2)
+    ETS.insert(table, { :attributes, [{key, value}|attrs] })
+  end
+
+  @doc """
+  Deletes all attributes that matches the given key.
+
+  ## Examples
+
+      defmodule MyModule do
+        Module.add_attribute __MODULE__, :custom_threshold_for_lib, 10
+        Module.delete_attribute __MODULE__, :custom_threshold_for_lib
+      end
+
+  """
+  def delete_attribute(module, key) when is_atom(key) do
+    assert_not_compiled!(:delete_attribute, module)
+    table = data_table_for(module)
+    attrs = ETS.lookup_element(table, :attributes, 2)
+    final = lc {k,v} in attrs, k != key, do: {k,v}
+    ETS.insert(table, { :attributes, final })
+  end
+
+  @doc """
+  Registers an attribute. This allows a developer to use the data API
+  but Elixir will register the data as an attribute automatically.
+  By default, `vsn`, `behavior` and other Erlang attributes are
+  automatically registered.
+
+  ## Examples
+
+      defmodule MyModule do
+        Module.register_attribute __MODULE__, :custom_threshold_for_lib
+        @custom_threshold_for_lib 10
+      end
+
+  """
+  def register_attribute(module, new) do
+    assert_not_compiled!(:register_attribute, module)
+    table = data_table_for(module)
+    old = ETS.lookup_element(table, :registered_attributes, 2)
+    ETS.insert(table, { :registered_attributes,  [new|old] })
+  end
+
+  @doc false
+  # Used internally to compile documentation. This function
+  # is private and must be used only internally.
+  def compile_doc(module, line, kind, pair) do
+    case read_data(module, :doc) do
+    match: nil
+      # We simply discard nil
+    match: doc
+      result = add_doc(module, line, kind, pair, doc)
+      merge_data(module, doc: nil)
+      result
+    end
+  end
+
+  ## Helpers
+
+  defp kind_to_entry(:def),      do: :public
+  defp kind_to_entry(:defp),     do: :private
+  defp kind_to_entry(:defmacro), do: :macros
+
+  defp to_char_list(list) when is_list(list),  do: list
+  defp to_char_list(bin)  when is_binary(bin), do: binary_to_list(bin)
+
+  defp data_table_for(module) do
+    list_to_atom Erlang.lists.concat([:d, module])
+  end
+
+  defp function_table_for(module) do
+    list_to_atom Erlang.lists.concat([:f, module])
+  end
+
+  defp docs_table_for(module) do
+    list_to_atom Erlang.lists.concat([:o, module])
+  end
+
+  defp assert_not_compiled!(fun, module) do
+    compiled?(module) ||
+      raise ArgumentError, message:
+        "could not call #{fun} on module #{module} because it was already compiled"
+  end
+end
\ No newline at end of file
diff --git a/tests/examplefiles/example_file.fy b/tests/examplefiles/example_file.fy
new file mode 100644 (file)
index 0000000..43e80c1
--- /dev/null
@@ -0,0 +1,128 @@
+class Person {
+  def initialize: @name age: @age {
+    """
+    This is a docstring for the Person constructor method.
+    Docstrings usually are multi-line, like this one.
+    """
+  }
+
+  def to_s {
+    # return is optional in this case, but we use it nontheless
+    return "Person with name: #{@name inspect} and age: #{@age}"
+  }
+}
+
+class PersonWithCity : Person {
+  def initialize: @name age: @age city: @city {
+  }
+
+  def to_s {
+    super to_s ++ " living in: #{@city inspect}"
+  }
+}
+
+p1 = Person new: "Johnny Jackson" age: 42
+p1 println # prints: Person with name: "Johnny Jackson" and age: 42
+
+p2 = PersonWithCity new: "John Appleseed" age: 55 city: "New York"
+p2 println # prints: Person with name: "John Appleseed" age: 55 living in: "New York"
+
+array = [1,2,3, "foo", 'bar]
+hash = <['foo => "bar", 'bar => 42]>
+tuple = (1,2,"hello","world")
+block = |x, y| {
+  x + y println
+}
+block call: [4,2]
+
+0b010101 & 0b00101 to_s: 2 . println
+0xFF & 0xAB to_s: 16 . println
+0o77 > 0o76 println
+123.123 + 0.222 println
+
+x = 0
+try {
+  10 / x println
+} catch ZeroDivisionError => e {
+  x = 3
+  retry
+} finally {
+  "Finally, done!" println
+}
+
+def a_method: arg1 with_default_arg: arg2 (42) {
+  arg1 * arg2 println
+}
+
+a_method: 42
+a_method: 42 with_default_arg: 85
+
+class ClassWithClassMethod {
+  def self class_method1 {
+    'works
+  }
+
+  def ClassWithClassMethod class_method2 {
+    'this_as_well
+  }
+}
+
+ClassWithClassMethod class_method1 println
+ClassWithClassMethod class_method2 println
+
+def another_method: block {
+  1 upto: 10 . map: block
+}
+
+# local returns
+another_method: |x| { return_local x * 2 } . inspect println
+
+
+# pattern matching:
+class PatternMatching {
+  def match_it: obj {
+    match obj {
+      case String -> "It's a String!" println
+      case Fixnum -> "It's a Number!" println
+      case _ -> "Aything else!" println
+    }
+  }
+
+  def match_with_extract: str {
+    match str {
+      # m holds the MatchData object, m1 & m2 the first and second matches
+      case /^(.*) : (.*)$/ -> |m, m1, m2|
+        "First match: #{m1}" println
+        "Second match: #{m2}" println
+    }
+  }
+}
+
+pm = PatternMatching new
+pm match_it: "foo"
+pm match_it: 42
+pm match_it: 'foo
+
+pm match_with_extract: "Hello : World!"
+
+
+# calling ruby methods:
+[3, 2, 1] reverse() each() |a| { puts(a) }
+"Hello" sub("ll", "y") println
+[3, 2, 1] map() |a| { a * 2 } inject(0) |s i| { s + i } println
+
+# test symbol highlighting
+['foo]
+['foo?!]
+{'foo}
+{'foo!?}
+{'foo:bar?!=&/:}
+('foo)
+
+# future sends
+42 @ to_s class println
+42 @ to_s: 16 . value println
+
+# async sends
+42 @@ println
+42 @@ upto: 100
diff --git a/tests/examplefiles/foo.sce b/tests/examplefiles/foo.sce
new file mode 100644 (file)
index 0000000..0e5d6af
--- /dev/null
@@ -0,0 +1,6 @@
+// Scilab
+//
+disp(%pi);
+
+assert_checkequal(2+2,4);
+
diff --git a/tests/examplefiles/function.mu b/tests/examplefiles/function.mu
new file mode 100644 (file)
index 0000000..46bb259
--- /dev/null
@@ -0,0 +1 @@
+a::b ()
diff --git a/tests/examplefiles/http_request_example b/tests/examplefiles/http_request_example
new file mode 100644 (file)
index 0000000..5d2a1d5
--- /dev/null
@@ -0,0 +1,14 @@
+POST /demo/submit/ HTTP/1.1\r
+Host: pygments.org\r
+Connection: keep-alivk\r
+Cache-Control: max-age=0\r
+Origin: http://pygments.org\r
+User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7\r
+Content-Type: application/x-www-form-urlencoded\r
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r
+Referer: http://pygments.org/\r
+Accept-Encoding: gzip,deflate,sdch\r
+Accept-Language: en-US,en;q=0.8\r
+Accept-Charset: windows-949,utf-8;q=0.7,*;q=0.3\r
+\r
+name=test&lang=text&code=asdf&user=
diff --git a/tests/examplefiles/http_response_example b/tests/examplefiles/http_response_example
new file mode 100644 (file)
index 0000000..bf53d61
--- /dev/null
@@ -0,0 +1,27 @@
+HTTP/1.1 200 OK\r
+Date: Tue, 13 Dec 2011 00:11:44 GMT\r
+Status: 200 OK\r
+X-Transaction: 50b85fff78dab4a3\r
+X-RateLimit-Limit: 150\r
+ETag: "b31143be48ebfe7512b65fe64fe092f3"\r
+X-Frame-Options: SAMEORIGIN\r
+Last-Modified: Tue, 13 Dec 2011 00:11:44 GMT\r
+X-RateLimit-Remaining: 145\r
+X-Runtime: 0.01190\r
+X-Transaction-Mask: a6183ffa5f8ca943ff1b53b5644ef1145f6f285d\r
+Content-Type: application/json; charset=utf-8\r
+Content-Length: 2389\r
+Pragma: no-cache\r
+X-RateLimit-Class: api\r
+X-Revision: DEV\r
+Expires: Tue, 31 Mar 1981 05:00:00 GMT\r
+Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0\r
+X-MID: a55f21733bc52bb11d1fc58f9b51b4974fbb8f83\r
+X-RateLimit-Reset: 1323738416\r
+Set-Cookie: k=10.34.234.116.1323735104238974; path=/; expires=Tue, 20-Dec-11 00:11:44 GMT; domain=.twitter.com\r
+Set-Cookie: guest_id=v1%3A13237351042425496; domain=.twitter.com; path=/; expires=Thu, 12-Dec-2013 12:11:44 GMT\r
+Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCPS6wjQ0AToHaWQiJTFiMTlhY2E1ZjczYThk%250ANDUwMWQxNjMwZGU2YTQ1ODBhIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA--6b502f30a083e8a41a64f10930e142ea362b1561; domain=.twitter.com; path=/; HttpOnly\r
+Vary: Accept-Encoding\r
+Server: tfe\r
+\r
+[{"contributors_enabled":false,"profile_background_tile":true,"followers_count":644,"protected":false,"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/69064242\/gb_normal.jpg","screen_name":"birkenfeld","default_profile_image":false,"following":null,"friends_count":88,"profile_sidebar_fill_color":"7AC3EE","url":"http:\/\/pythonic.pocoo.org\/","name":"Georg Brandl","default_profile":false,"is_translator":false,"utc_offset":3600,"profile_sidebar_border_color":"65B0DA","description":"","profile_background_image_url_https":"https:\/\/si0.twimg.com\/images\/themes\/theme10\/bg.gif","favourites_count":0,"profile_use_background_image":true,"created_at":"Tue Dec 30 22:25:11 +0000 2008","status":{"retweet_count":10,"favorited":false,"geo":null,"possibly_sensitive":false,"coordinates":null,"in_reply_to_screen_name":null,"in_reply_to_status_id_str":null,"retweeted":false,"in_reply_to_status_id":null,"in_reply_to_user_id_str":null,"created_at":"Sat Jul 09 13:42:35 +0000 2011","truncated":false,"id_str":"89690914515206144","contributors":null,"place":null,"source":"web","in_reply_to_user_id":null,"id":89690914515206144,"retweeted_status":{"retweet_count":10,"favorited":false,"geo":null,"possibly_sensitive":false,"coordinates":null,"in_reply_to_screen_name":null,"in_reply_to_status_id_str":null,"retweeted":false,"in_reply_to_status_id":null,"in_reply_to_user_id_str":null,"created_at":"Sat Jul 09 13:07:04 +0000 2011","truncated":false,"id_str":"89681976755372032","contributors":null,"place":null,"source":"web","in_reply_to_user_id":null,"id":89681976755372032,"text":"Excellent Python posts from @mitsuhiko - http:\/\/t.co\/k1wt6e4 and @ncoghlan_dev - http:\/\/t.co\/eTxacgZ (links fixed)"},"text":"RT @jessenoller: Excellent Python posts from @mitsuhiko - http:\/\/t.co\/k1wt6e4 and @ncoghlan_dev - http:\/\/t.co\/eTxacgZ (links fixed)"},"follow_request_sent":null,"statuses_count":553,"geo_enabled":false,"notifications":null,"profile_text_color":"3D1957","id_str":"18490730","lang":"en","profile_background_image_url":"http:\/\/a1.twimg.com\/images\/themes\/theme10\/bg.gif","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/69064242\/gb_normal.jpg","show_all_inline_media":true,"listed_count":65,"profile_link_color":"FF0000","verified":false,"id":18490730,"time_zone":"Berlin","profile_background_color":"642D8B","location":"Bavaria, Germany"}]
diff --git a/tests/examplefiles/intsyn.fun b/tests/examplefiles/intsyn.fun
new file mode 100644 (file)
index 0000000..777b0fd
--- /dev/null
@@ -0,0 +1,675 @@
+(* Internal Syntax *)
+(* Author: Frank Pfenning, Carsten Schuermann *)
+(* Modified: Roberto Virga *)
+
+functor IntSyn (structure Global : GLOBAL) :> INTSYN =
+struct
+
+  type cid = int                       (* Constant identifier        *)
+  type name = string                   (* Variable name              *)
+  type mid = int                        (* Structure identifier       *)
+  type csid = int                       (* CS module identifier       *)
+
+
+  (* Contexts *)
+  datatype 'a Ctx =                    (* Contexts                   *)
+    Null                               (* G ::= .                    *)
+  | Decl of 'a Ctx * 'a                        (*     | G, D                 *)
+
+  (* ctxPop (G) => G'
+     Invariant: G = G',D
+  *)
+  fun ctxPop (Decl (G, D)) = G
+
+  exception Error of string             (* raised if out of space     *) 
+  (* ctxLookup (G, k) = D, kth declaration in G from right to left
+     Invariant: 1 <= k <= |G|, where |G| is length of G
+  *)
+
+  fun ctxLookup (Decl (G', D), 1) = D
+    | ctxLookup (Decl (G', _), k') = ctxLookup (G', k'-1)
+(*    | ctxLookup (Null, k') = (print ("Looking up k' = " ^ Int.toString k' ^ "\n"); raise Error "Out of Bounce\n")*)
+    (* ctxLookup (Null, k')  should not occur by invariant *)
+
+  (* ctxLength G = |G|, the number of declarations in G *)
+  fun ctxLength G =
+      let 
+       fun ctxLength' (Null, n) = n
+         | ctxLength' (Decl(G, _), n)= ctxLength' (G, n+1)
+      in
+       ctxLength' (G, 0)
+      end
+    
+  type FgnExp = exn                     (* foreign expression representation *)
+  exception UnexpectedFgnExp of FgnExp
+                                        (* raised by a constraint solver
+                                          if passed an incorrect arg *)
+
+  type FgnCnstr = exn                   (* foreign unification constraint
+                                           representation *)
+  exception UnexpectedFgnCnstr of FgnCnstr
+                                        (* raised by a constraint solver
+                                           if passed an incorrect arg *)
+
+  datatype Depend =                     (* Dependency information     *)
+    No                                  (* P ::= No                   *)
+  | Maybe                               (*     | Maybe                *)
+  | Meta                               (*     | Meta                 *)
+
+  (* Expressions *)
+
+  datatype Uni =                       (* Universes:                 *)
+    Kind                               (* L ::= Kind                 *)
+  | Type                               (*     | Type                 *)
+
+  datatype Exp =                       (* Expressions:               *)
+    Uni   of Uni                       (* U ::= L                    *)
+  | Pi    of (Dec * Depend) * Exp       (*     | bPi (D, P). V         *)
+  | Root  of Head * Spine              (*     | C @ S                *)
+  | Redex of Exp * Spine               (*     | U @ S                *)
+  | Lam   of Dec * Exp                 (*     | lam D. U             *)
+  | EVar  of Exp option ref * Dec Ctx * Exp * (Cnstr ref) list ref
+                                        (*     | X<I> : G|-V, Cnstr   *)
+
+  | EClo  of Exp * Sub                 (*     | U[s]                 *)
+  | AVar  of Exp option ref             (*     | A<I>                 *)   
+  | NVar  of int                       (*     | n (linear, fully applied) *)
+                                        (* grafting variable *)
+
+  | FgnExp of csid * FgnExp
+                                        (*     | (foreign expression) *)
+    
+  and Head =                           (* Heads:                     *)
+    BVar  of int                       (* H ::= k                    *)
+  | Const of cid                       (*     | c                    *)
+  | Proj  of Block * int               (*     | #k(b)                *)
+  | Skonst of cid                      (*     | c#                   *)
+  | Def   of cid                       (*     | d                    *)
+  | NSDef of cid                       (*     | d (non strict)       *)
+  | FVar  of name * Exp * Sub          (*     | F[s]                 *)
+  | FgnConst of csid * ConDec           (*     | (foreign constant)   *)
+    
+  and Spine =                          (* Spines:                    *)
+    Nil                                        (* S ::= Nil                  *)
+  | App   of Exp * Spine               (*     | U ; S                *)
+  | SClo  of Spine * Sub               (*     | S[s]                 *)
+
+  and Sub =                            (* Explicit substitutions:    *)
+    Shift of int                       (* s ::= ^n                   *)
+  | Dot   of Front * Sub               (*     | Ft.s                 *)
+
+  and Front =                          (* Fronts:                    *)
+    Idx of int                         (* Ft ::= k                   *)
+  | Exp of Exp                         (*     | U                    *)
+  | Axp of Exp                         (*     | U (assignable)       *)
+  | Block of Block                     (*     | _x                   *)
+  | Undef                              (*     | _                    *)
+
+  and Dec =                            (* Declarations:              *)
+    Dec of name option * Exp           (* D ::= x:V                  *)
+  | BDec of name option * (cid * Sub)  (*     | v:l[s]               *)
+  | ADec of name option * int          (*     | v[^-d]               *)
+  | NDec of name option
+
+  and Block =                          (* Blocks:                    *)
+    Bidx of int                        (* b ::= v                    *)
+  | LVar of Block option ref * Sub * (cid * Sub)
+                                        (*     | L(l[^k],t)           *)
+  | Inst of Exp list                   (*     | u1, ..., Un          *)
+
+
+  (* Constraints *)
+
+  and Cnstr =                          (* Constraint:                *)
+    Solved                             (* Cnstr ::= solved           *)
+  | Eqn      of Dec Ctx * Exp * Exp     (*         | G|-(U1 == U2)    *)
+  | FgnCnstr of csid * FgnCnstr         (*         | (foreign)        *)
+
+  and Status =                          (* Status of a constant:      *)
+    Normal                              (*   inert                    *)
+  | Constraint of csid * (Dec Ctx * Spine * int -> Exp option)
+                                        (*   acts as constraint       *)
+  | Foreign of csid * (Spine -> Exp)    (*   is converted to foreign  *)
+
+  and FgnUnify =                        (* Result of foreign unify    *)
+    Succeed of FgnUnifyResidual list
+    (* succeed with a list of residual operations *)
+  | Fail
+
+  and FgnUnifyResidual =                (* Residual of foreign unify  *)
+    Assign of Dec Ctx * Exp * Exp * Sub
+    (* perform the assignment G |- X = U [ss] *)
+  | Delay of Exp * Cnstr ref
+    (* delay cnstr, associating it with all the rigid EVars in U  *)
+
+  (* Global signature *)
+
+  and ConDec =                         (* Constant declaration       *)
+    ConDec of string * mid option * int * Status
+                                        (* a : K : kind  or           *)
+              * Exp * Uni              (* c : A : type               *)
+  | ConDef of string * mid option * int        (* a = A : K : kind  or       *)
+              * Exp * Exp * Uni                (* d = M : A : type           *)
+              * Ancestor                (* Ancestor info for d or a   *)
+  | AbbrevDef of string * mid option * int
+                                        (* a = A : K : kind  or       *)
+              * Exp * Exp * Uni                (* d = M : A : type           *)
+  | BlockDec of string * mid option     (* %block l : SOME G1 PI G2   *)
+              * Dec Ctx * Dec list
+
+  | BlockDef of string * mid option * cid list
+                                        (* %block l = (l1 | ... | ln) *)
+
+  | SkoDec of string * mid option * int        (* sa: K : kind  or           *)
+              * Exp * Uni              (* sc: A : type               *)
+
+  and Ancestor =                       (* Ancestor of d or a         *)
+    Anc of cid option * int * cid option (* head(expand(d)), height, head(expand[height](d)) *)
+                                        (* NONE means expands to {x:A}B *)
+
+  datatype StrDec =                     (* Structure declaration      *)
+      StrDec of string * mid option
+
+  (* Form of constant declaration *)
+  datatype ConDecForm =
+    FromCS                             (* from constraint domain *)
+  | Ordinary                           (* ordinary declaration *)
+  | Clause                             (* %clause declaration *)
+
+  (* Type abbreviations *)
+  type dctx = Dec Ctx                  (* G = . | G,D                *)
+  type eclo = Exp * Sub                (* Us = U[s]                  *)
+  type bclo = Block * Sub              (* Bs = B[s]                  *)
+  type cnstr = Cnstr ref
+
+(*  exception Error of string             (* raised if out of space     *) *)
+
+
+  structure FgnExpStd = struct
+
+    structure ToInternal = FgnOpnTable (type arg = unit
+                                       type result = Exp)
+
+    structure Map = FgnOpnTable (type arg = Exp -> Exp
+                                type result = Exp)
+
+    structure App = FgnOpnTable (type arg = Exp -> unit
+                                type result = unit)
+
+    structure EqualTo = FgnOpnTable (type arg = Exp
+                                    type result = bool)
+
+    structure UnifyWith = FgnOpnTable (type arg = Dec Ctx * Exp
+                                      type result = FgnUnify)
+
+                         
+
+    fun fold csfe f b = let
+       val r = ref b
+       fun g U = r := f (U,!r)
+    in
+       App.apply csfe g ; !r
+    end
+
+  end
+
+  structure FgnCnstrStd = struct
+
+    structure ToInternal = FgnOpnTable (type arg = unit
+                                       type result = (Dec Ctx * Exp) list)
+
+    structure Awake = FgnOpnTable (type arg = unit
+                                  type result = bool)
+
+    structure Simplify = FgnOpnTable (type arg = unit
+                                     type result = bool)
+
+  end
+
+  fun conDecName (ConDec (name, _, _, _, _, _)) = name
+    | conDecName (ConDef (name, _, _, _, _, _, _)) = name
+    | conDecName (AbbrevDef (name, _, _, _, _, _)) = name
+    | conDecName (SkoDec (name, _, _, _, _)) = name
+    | conDecName (BlockDec (name, _, _, _)) = name
+    | conDecName (BlockDef (name, _, _)) = name
+
+  fun conDecParent (ConDec (_, parent, _, _, _, _)) = parent
+    | conDecParent (ConDef (_, parent, _, _, _, _, _)) = parent
+    | conDecParent (AbbrevDef (_, parent, _, _, _, _)) = parent
+    | conDecParent (SkoDec (_, parent, _, _, _)) = parent
+    | conDecParent (BlockDec (_, parent, _, _)) = parent
+    | conDecParent (BlockDef (_, parent, _)) = parent
+   
+
+  (* conDecImp (CD) = k
+
+     Invariant:
+     If   CD is either a declaration, definition, abbreviation, or 
+          a Skolem constant
+     then k stands for the number of implicit elements.
+  *)
+  fun conDecImp (ConDec (_, _, i, _, _, _)) = i
+    | conDecImp (ConDef (_, _, i, _, _, _, _)) = i
+    | conDecImp (AbbrevDef (_, _, i, _, _, _)) = i
+    | conDecImp (SkoDec (_, _, i, _, _)) = i
+    | conDecImp (BlockDec (_, _,  _, _)) = 0   (* watch out -- carsten *)
+
+  fun conDecStatus (ConDec (_, _, _, status, _, _)) = status
+    | conDecStatus _ = Normal
+
+  (* conDecType (CD) =  V
+
+     Invariant:
+     If   CD is either a declaration, definition, abbreviation, or 
+          a Skolem constant
+     then V is the respective type
+  *)
+  fun conDecType (ConDec (_, _, _, _, V, _)) = V
+    | conDecType (ConDef (_, _, _, _, V, _, _)) = V
+    | conDecType (AbbrevDef (_, _, _, _, V, _)) = V
+    | conDecType (SkoDec (_, _, _, V, _)) = V
+
+
+  (* conDecBlock (CD) =  (Gsome, Lpi)
+
+     Invariant:
+     If   CD is block definition
+     then Gsome is the context of some variables
+     and  Lpi is the list of pi variables
+  *)
+  fun conDecBlock (BlockDec (_, _, Gsome, Lpi)) = (Gsome, Lpi)
+
+  (* conDecUni (CD) =  L
+
+     Invariant:
+     If   CD is either a declaration, definition, abbreviation, or 
+          a Skolem constant
+     then L is the respective universe
+  *)
+  fun conDecUni (ConDec (_, _, _, _, _, L)) = L
+    | conDecUni (ConDef (_, _, _, _, _, L, _)) = L
+    | conDecUni (AbbrevDef (_, _, _, _, _, L)) = L
+    | conDecUni (SkoDec (_, _, _, _, L)) = L
+
+
+  fun strDecName (StrDec (name, _)) = name
+
+  fun strDecParent (StrDec (_, parent)) = parent
+
+  local
+    val maxCid = Global.maxCid
+    val dummyEntry = ConDec("", NONE, 0, Normal, Uni (Kind), Kind)
+    val sgnArray = Array.array (maxCid+1, dummyEntry)
+      : ConDec Array.array
+    val nextCid  = ref(0)
+
+    val maxMid = Global.maxMid
+    val sgnStructArray = Array.array (maxMid+1, StrDec("", NONE))
+      : StrDec Array.array
+    val nextMid = ref (0)
+
+  in
+    (* Invariants *)
+    (* Constant declarations are all well-typed *)
+    (* Constant declarations are stored in beta-normal form *)
+    (* All definitions are strict in all their arguments *)
+    (* If Const(cid) is valid, then sgnArray(cid) = ConDec _ *)
+    (* If Def(cid) is valid, then sgnArray(cid) = ConDef _ *)
+
+    fun sgnClean (i) = if i >= !nextCid then ()
+                       else (Array.update (sgnArray, i, dummyEntry);
+                            sgnClean (i+1))
+
+    fun sgnReset () = ((* Fri Dec 20 12:04:24 2002 -fp *)
+                      (* this circumvents a space leak *)
+                      sgnClean (0);
+                      nextCid := 0; nextMid := 0)
+    fun sgnSize () = (!nextCid, !nextMid)
+
+    fun sgnAdd (conDec) = 
+        let
+         val cid = !nextCid
+       in
+         if cid > maxCid
+           then raise Error ("Global signature size " ^ Int.toString (maxCid+1) ^ " exceeded")
+         else (Array.update (sgnArray, cid, conDec) ;
+               nextCid := cid + 1;
+               cid)
+       end
+
+    (* 0 <= cid < !nextCid *)
+    fun sgnLookup (cid) = Array.sub (sgnArray, cid)
+
+    fun sgnApp (f) =
+        let
+         fun sgnApp' (cid) = 
+             if cid = !nextCid then () else (f cid; sgnApp' (cid+1)) 
+       in
+         sgnApp' (0)
+       end
+
+    fun sgnStructAdd (strDec) = 
+        let
+         val mid = !nextMid
+       in
+         if mid > maxMid
+           then raise Error ("Global signature size " ^ Int.toString (maxMid+1) ^ " exceeded")
+         else (Array.update (sgnStructArray, mid, strDec) ;
+               nextMid := mid + 1;
+               mid)
+       end
+
+    (* 0 <= mid < !nextMid *)
+    fun sgnStructLookup (mid) = Array.sub (sgnStructArray, mid)
+
+    (* A hack used in Flit - jcreed 6/05 *)
+    fun rename (cid, new) =
+       let
+           val newConDec = case sgnLookup cid of 
+               ConDec (n,m,i,s,e,u) => ConDec(new,m,i,s,e,u)
+             | ConDef (n,m,i,e,e',u,a) => ConDef(new,m,i,e,e',u,a)
+             | AbbrevDef (n,m,i,e,e',u) => AbbrevDef (new,m,i,e,e',u)
+             | BlockDec (n,m,d,d') => BlockDec (new,m,d,d')
+             | SkoDec (n,m,i,e,u) => SkoDec (new,m,i,e,u)
+       in
+           Array.update (sgnArray, cid, newConDec)
+       end
+
+  end
+
+  fun constDef (d) =
+      (case sgnLookup (d)
+        of ConDef(_, _, _, U,_, _, _) => U
+         | AbbrevDef (_, _, _, U,_, _) => U)
+
+  fun constType (c) = conDecType (sgnLookup c)
+  fun constImp (c) = conDecImp (sgnLookup c)
+  fun constUni (c) = conDecUni (sgnLookup c)
+  fun constBlock (c) = conDecBlock (sgnLookup c)
+
+  fun constStatus (c) =
+      (case sgnLookup (c)
+        of ConDec (_, _, _, status, _, _) => status
+          | _ => Normal)
+
+
+  (* Explicit Substitutions *)
+
+  (* id = ^0 
+  
+     Invariant:
+     G |- id : G        id is patsub
+  *)
+  val id = Shift(0)
+
+  (* shift = ^1
+  
+     Invariant:
+     G, V |- ^ : G       ^ is patsub
+  *)
+  val shift = Shift(1)
+
+  (* invShift = ^-1 = _.^0
+     Invariant:
+     G |- ^-1 : G, V     ^-1 is patsub
+  *)
+  val invShift = Dot(Undef, id)
+
+
+  (* comp (s1, s2) = s'
+
+     Invariant:
+     If   G'  |- s1 : G 
+     and  G'' |- s2 : G'
+     then s'  = s1 o s2
+     and  G'' |- s1 o s2 : G
+
+     If  s1, s2 patsub
+     then s' patsub
+   *)
+  fun comp (Shift (0), s) = s
+    (* next line is an optimization *)
+    (* roughly 15% on standard suite for Twelf 1.1 *)
+    (* Sat Feb 14 10:15:16 1998 -fp *)
+    | comp (s, Shift (0)) = s
+    | comp (Shift (n), Dot (Ft, s)) = comp (Shift (n-1), s)
+    | comp (Shift (n), Shift (m)) = Shift (n+m)
+    | comp (Dot (Ft, s), s') = Dot (frontSub (Ft, s'), comp (s, s'))
+
+  (* bvarSub (n, s) = Ft'
+   
+      Invariant: 
+     If    G |- s : G'    G' |- n : V
+     then  Ft' = Ftn         if  s = Ft1 .. Ftn .. ^k
+       or  Ft' = ^(n+k)     if  s = Ft1 .. Ftm ^k   and m<n
+     and   G |- Ft' : V [s]
+  *)
+  and bvarSub (1, Dot(Ft, s)) = Ft
+    | bvarSub (n, Dot(Ft, s)) = bvarSub (n-1, s)
+    | bvarSub (n, Shift(k))  = Idx (n+k)
+
+  (* blockSub (B, s) = B' 
+    
+     Invariant:
+     If   G |- s : G'   
+     and  G' |- B block
+     then G |- B' block
+     and  B [s] == B' 
+  *)
+  (* in front of substitutions, first case is irrelevant *)
+  (* Sun Dec  2 11:56:41 2001 -fp *)
+  and blockSub (Bidx k, s) =
+      (case bvarSub (k, s)
+        of Idx k' => Bidx k'
+          | Block B => B)
+    | blockSub (LVar (ref (SOME B), sk, _), s) =
+        blockSub (B, comp (sk, s))
+    (* -fp Sun Dec  1 21:18:30 2002 *)
+    (* --cs Sun Dec  1 11:25:41 2002 *)
+    (* Since always . |- t : Gsome, discard s *)
+    (* where is this needed? *)
+    (* Thu Dec  6 20:30:26 2001 -fp !!! *)
+    | blockSub (LVar (r as ref NONE, sk, (l, t)), s) = 
+        LVar(r, comp(sk, s), (l, t))
+      (* was:
+       LVar (r, comp(sk, s), (l, comp (t, s)))
+       July 22, 2010 -fp -cs
+       *)
+       (* comp(^k, s) = ^k' for some k' by invariant *)
+    | blockSub (L as Inst ULs, s') = Inst (map (fn U => EClo (U, s')) ULs)
+    (* this should be right but somebody should verify *) 
+
+  (* frontSub (Ft, s) = Ft'
+
+     Invariant:
+     If   G |- s : G'     G' |- Ft : V
+     then Ft' = Ft [s]
+     and  G |- Ft' : V [s]
+
+     NOTE: EClo (U, s) might be undefined, so if this is ever
+     computed eagerly, we must introduce an "Undefined" exception,
+     raise it in whnf and handle it here so Exp (EClo (U, s)) => Undef
+  *)
+  and frontSub (Idx (n), s) = bvarSub (n, s)
+    | frontSub (Exp (U), s) = Exp (EClo (U, s))
+    | frontSub (Undef, s) = Undef
+    | frontSub (Block (B), s) = Block (blockSub (B, s))
+
+  (* decSub (x:V, s) = D'
+
+     Invariant:
+     If   G  |- s : G'    G' |- V : L
+     then D' = x:V[s]
+     and  G  |- V[s] : L
+  *)
+  (* First line is an optimization suggested by cs *)
+  (* D[id] = D *)
+  (* Sat Feb 14 18:37:44 1998 -fp *)
+  (* seems to have no statistically significant effect *)
+  (* undo for now Sat Feb 14 20:22:29 1998 -fp *)
+  (*
+  fun decSub (D, Shift(0)) = D
+    | decSub (Dec (x, V), s) = Dec (x, EClo (V, s))
+  *)
+  fun decSub (Dec (x, V), s) = Dec (x, EClo (V, s))
+    | decSub (NDec x, s) = NDec x
+    | decSub (BDec (n, (l, t)), s) = BDec (n, (l, comp (t, s)))
+
+  (* dot1 (s) = s'
+
+     Invariant:
+     If   G |- s : G'
+     then s' = 1. (s o ^)
+     and  for all V s.t.  G' |- V : L
+          G, V[s] |- s' : G', V 
+
+     If s patsub then s' patsub
+  *)
+  (* first line is an optimization *)
+  (* roughly 15% on standard suite for Twelf 1.1 *)
+  (* Sat Feb 14 10:16:16 1998 -fp *)
+  fun dot1 (s as Shift (0)) = s
+    | dot1 s = Dot (Idx(1), comp(s, shift))
+
+  (* invDot1 (s) = s'
+     invDot1 (1. s' o ^) = s'
+
+     Invariant:
+     s = 1 . s' o ^
+     If G' |- s' : G
+     (so G',V[s] |- s : G,V)
+  *)
+  fun invDot1 (s) = comp (comp(shift, s), invShift)
+
+
+  (* Declaration Contexts *)
+
+  (* ctxDec (G, k) = x:V
+     Invariant: 
+     If      |G| >= k, where |G| is size of G,
+     then    G |- k : V  and  G |- V : L
+  *)
+  fun ctxDec (G, k) =
+      let (* ctxDec' (G'', k') = x:V
+            where G |- ^(k-k') : G'', 1 <= k' <= k
+           *)
+       fun ctxDec' (Decl (G', Dec (x, V')), 1) = Dec (x, EClo (V', Shift (k)))
+         | ctxDec' (Decl (G', BDec (n, (l, s))), 1) = BDec (n, (l, comp (s, Shift (k))))
+         | ctxDec' (Decl (G', _), k') = ctxDec' (G', k'-1)
+        (* ctxDec' (Null, k')  should not occur by invariant *)
+      in
+       ctxDec' (G, k)
+      end
+
+  (* blockDec (G, v, i) = V
+     
+     Invariant:
+     If   G (v) = l[s]
+     and  Sigma (l) = SOME Gsome BLOCK Lblock
+     and  G |- s : Gsome
+     then G |- pi (v, i) : V
+  *)
+
+  fun blockDec (G, v as (Bidx k), i) =
+    let 
+      val BDec (_, (l, s)) = ctxDec (G, k)  
+      (* G |- s : Gsome *)
+      val (Gsome, Lblock) = conDecBlock (sgnLookup l)
+      fun blockDec' (t, D :: L, 1, j) = decSub (D, t)
+       | blockDec' (t, _ :: L, n, j) =
+           blockDec' (Dot (Exp (Root (Proj (v, j), Nil)), t),
+                         L, n-1, j+1)
+    in
+      blockDec' (s, Lblock, i, 1)
+    end
+
+
+  (* EVar related functions *)
+
+  (* newEVar (G, V) = newEVarCnstr (G, V, nil) *)
+  fun newEVar (G, V) = EVar(ref NONE, G, V, ref nil)
+
+  (* newAVar G = new AVar (assignable variable) *)
+  (* AVars carry no type, ctx, or cnstr *)
+  fun newAVar () = AVar(ref NONE)
+
+  (* newTypeVar (G) = X, X new
+     where G |- X : type
+  *)
+  fun newTypeVar (G) = EVar(ref NONE, G, Uni(Type), ref nil)
+
+  (* newLVar (l, s) = (l[s]) *)
+  fun newLVar (sk, (cid, t)) = LVar (ref NONE, sk, (cid, t))
+
+  (* Definition related functions *)
+  (* headOpt (U) = SOME(H) or NONE, U should be strict, normal *)
+  fun headOpt (Root (H, _)) = SOME(H)
+    | headOpt (Lam (_, U)) = headOpt U
+    | headOpt _ = NONE
+
+  fun ancestor' (NONE) = Anc(NONE, 0, NONE)
+    | ancestor' (SOME(Const(c))) = Anc(SOME(c), 1, SOME(c))
+    | ancestor' (SOME(Def(d))) =
+      (case sgnLookup(d)
+        of ConDef(_, _, _, _, _, _, Anc(_, height, cOpt))
+            => Anc(SOME(d), height+1, cOpt))
+    | ancestor' (SOME _) = (* FgnConst possible, BVar impossible by strictness *)
+      Anc(NONE, 0, NONE)
+  (* ancestor(U) = ancestor info for d = U *)
+  fun ancestor (U) = ancestor' (headOpt U)
+
+  (* defAncestor(d) = ancestor of d, d must be defined *)
+  fun defAncestor (d) =
+      (case sgnLookup(d)
+        of ConDef(_, _, _, _, _, _, anc) => anc)
+
+  (* Type related functions *)
+
+  (* targetHeadOpt (V) = SOME(H) or NONE
+     where H is the head of the atomic target type of V,
+     NONE if V is a kind or object or have variable type.
+     Does not expand type definitions.
+  *)
+  (* should there possibly be a FgnConst case? also targetFamOpt -kw *)
+  fun targetHeadOpt (Root (H, _)) = SOME(H)
+    | targetHeadOpt (Pi(_, V)) = targetHeadOpt V
+    | targetHeadOpt (Redex (V, S)) = targetHeadOpt V
+    | targetHeadOpt (Lam (_, V)) = targetHeadOpt V
+    | targetHeadOpt (EVar (ref (SOME(V)),_,_,_)) = targetHeadOpt V
+    | targetHeadOpt (EClo (V, s)) = targetHeadOpt V
+    | targetHeadOpt _ = NONE
+      (* Root(Bvar _, _), Root(FVar _, _), Root(FgnConst _, _),
+         EVar(ref NONE,..), Uni, FgnExp _
+      *)
+      (* Root(Skonst _, _) can't occur *)
+  (* targetHead (A) = a
+     as in targetHeadOpt, except V must be a valid type
+  *)
+  fun targetHead (A) = valOf (targetHeadOpt A)
+                      
+  (* targetFamOpt (V) = SOME(cid) or NONE
+     where cid is the type family of the atomic target type of V,
+     NONE if V is a kind or object or have variable type.
+     Does expand type definitions.
+  *)
+  fun targetFamOpt (Root (Const(cid), _)) = SOME(cid)
+    | targetFamOpt (Pi(_, V)) = targetFamOpt V
+    | targetFamOpt (Root (Def(cid), _)) = targetFamOpt (constDef cid)
+    | targetFamOpt (Redex (V, S)) = targetFamOpt V
+    | targetFamOpt (Lam (_, V)) = targetFamOpt V
+    | targetFamOpt (EVar (ref (SOME(V)),_,_,_)) = targetFamOpt V
+    | targetFamOpt (EClo (V, s)) = targetFamOpt V
+    | targetFamOpt _ = NONE
+      (* Root(Bvar _, _), Root(FVar _, _), Root(FgnConst _, _),
+         EVar(ref NONE,..), Uni, FgnExp _
+      *)
+      (* Root(Skonst _, _) can't occur *)
+  (* targetFam (A) = a
+     as in targetFamOpt, except V must be a valid type
+  *)
+  fun targetFam (A) = valOf (targetFamOpt A)
+                      
+end;  (* functor IntSyn *)
+
+structure IntSyn :> INTSYN =
+  IntSyn (structure Global = Global);
diff --git a/tests/examplefiles/intsyn.sig b/tests/examplefiles/intsyn.sig
new file mode 100644 (file)
index 0000000..ea50536
--- /dev/null
@@ -0,0 +1,286 @@
+(* Internal Syntax *)  
+(* Author: Frank Pfenning, Carsten Schuermann *)
+(* Modified: Roberto Virga *)
+
+signature INTSYN =
+sig
+
+  type cid = int                       (* Constant identifier        *)
+  type mid = int                        (* Structure identifier       *)
+  type csid = int                       (* CS module identifier       *)
+
+
+  type FgnExp = exn                     (* foreign expression representation *)
+  exception UnexpectedFgnExp of FgnExp
+                                        (* raised by a constraint solver
+                                          if passed an incorrect arg *)
+  type FgnCnstr = exn                   (* foreign constraint representation *)
+  exception UnexpectedFgnCnstr of FgnCnstr
+                                        (* raised by a constraint solver
+                                           if passed an incorrect arg *)
+
+  (* Contexts *)
+
+  datatype 'a Ctx =                    (* Contexts                   *)
+    Null                               (* G ::= .                    *)
+  | Decl of 'a Ctx * 'a                        (*     | G, D                 *)
+    
+  val ctxPop : 'a Ctx -> 'a Ctx
+  val ctxLookup: 'a Ctx * int -> 'a
+  val ctxLength: 'a Ctx -> int
+
+  datatype Depend =                     (* Dependency information     *)
+    No                                  (* P ::= No                   *)
+  | Maybe                               (*     | Maybe                *)
+  | Meta                               (*     | Meta                 *)
+
+  (* expressions *)
+
+  datatype Uni =                       (* Universes:                 *)
+    Kind                               (* L ::= Kind                 *)
+  | Type                               (*     | Type                 *)
+
+  datatype Exp =                       (* Expressions:               *)
+    Uni   of Uni                       (* U ::= L                    *)
+  | Pi    of (Dec * Depend) * Exp      (*     | Pi (D, P). V         *)
+  | Root  of Head * Spine              (*     | H @ S                *)
+  | Redex of Exp * Spine               (*     | U @ S                *)
+  | Lam   of Dec * Exp                 (*     | lam D. U             *)
+  | EVar  of Exp option ref * Dec Ctx * Exp * (Cnstr ref) list ref
+                                        (*     | X<I> : G|-V, Cnstr   *)
+  | EClo  of Exp * Sub                 (*     | U[s]                 *)
+  | AVar  of Exp option ref             (*     | A<I>                 *)
+
+  | FgnExp of csid * FgnExp             (*     | (foreign expression) *)
+
+  | NVar  of int                       (*     | n (linear, 
+                                               fully applied variable
+                                               used in indexing       *)
+
+  and Head =                           (* Head:                      *)
+    BVar  of int                       (* H ::= k                    *)
+  | Const of cid                       (*     | c                    *)
+  | Proj  of Block * int               (*     | #k(b)                *)
+  | Skonst of cid                      (*     | c#                   *)
+  | Def   of cid                       (*     | d (strict)           *)
+  | NSDef of cid                       (*     | d (non strict)       *)
+  | FVar  of string * Exp * Sub                (*     | F[s]                 *)
+  | FgnConst of csid * ConDec           (*     | (foreign constant)   *)
+
+  and Spine =                          (* Spines:                    *)
+    Nil                                        (* S ::= Nil                  *)
+  | App   of Exp * Spine               (*     | U ; S                *)
+  | SClo  of Spine * Sub               (*     | S[s]                 *)
+
+  and Sub =                            (* Explicit substitutions:    *)
+    Shift of int                       (* s ::= ^n                   *)
+  | Dot   of Front * Sub               (*     | Ft.s                 *)
+
+  and Front =                          (* Fronts:                    *)
+    Idx of int                         (* Ft ::= k                   *)
+  | Exp of Exp                         (*     | U                    *)
+  | Axp of Exp                         (*     | U                    *)
+  | Block of Block                     (*     | _x                   *)
+  | Undef                              (*     | _                    *)
+
+  and Dec =                            (* Declarations:              *)
+    Dec of string option * Exp         (* D ::= x:V                  *)
+  | BDec of string option * (cid * Sub)        (*     | v:l[s]               *)
+  | ADec of string option * int                (*     | v[^-d]               *)
+  | NDec of string option 
+
+  and Block =                          (* Blocks:                    *)
+    Bidx of int                                (* b ::= v                    *)
+  | LVar of Block option ref * Sub * (cid * Sub)
+                                        (*     | L(l[^k],t)           *)
+  | Inst of Exp list                    (*     | U1, ..., Un          *)
+  (* It would be better to consider having projections count
+     like substitutions, then we could have Inst of Sub here, 
+     which would simplify a lot of things.  
+
+     I suggest however to wait until the next big overhaul 
+     of the system -- cs *)
+
+
+(*  | BClo of Block * Sub                 (*     | b[s]                 *) *)
+
+  (* constraints *)
+
+  and Cnstr =                          (* Constraint:                *)
+    Solved                             (* Cnstr ::= solved           *)
+  | Eqn      of Dec Ctx * Exp * Exp     (*         | G|-(U1 == U2)    *)
+  | FgnCnstr of csid * FgnCnstr         (*         | (foreign)        *)
+
+  and Status =                          (* Status of a constant:      *)
+    Normal                              (*   inert                    *)
+  | Constraint of csid * (Dec Ctx * Spine * int -> Exp option)
+                                        (*   acts as constraint       *)
+  | Foreign of csid * (Spine -> Exp)    (*   is converted to foreign  *)
+
+  and FgnUnify =                        (* Result of foreign unify    *)
+    Succeed of FgnUnifyResidual list
+    (* succeed with a list of residual operations *)
+  | Fail
+
+  and FgnUnifyResidual =
+    Assign of Dec Ctx * Exp * Exp * Sub
+    (* perform the assignment G |- X = U [ss] *)
+  | Delay of Exp * Cnstr ref
+    (* delay cnstr, associating it with all the rigid EVars in U  *)
+
+  (* Global signature *)
+
+  and ConDec =                         (* Constant declaration       *)
+    ConDec of string * mid option * int * Status
+                                        (* a : K : kind  or           *)
+              * Exp * Uni              (* c : A : type               *)
+  | ConDef of string * mid option * int        (* a = A : K : kind  or       *)
+              * Exp * Exp * Uni                (* d = M : A : type           *)
+              * Ancestor                (* Ancestor info for d or a   *)
+  | AbbrevDef of string * mid option * int
+                                        (* a = A : K : kind  or       *)
+              * Exp * Exp * Uni                (* d = M : A : type           *)
+  | BlockDec of string * mid option     (* %block l : SOME G1 PI G2   *)
+              * Dec Ctx * Dec list
+  | BlockDef of string * mid option * cid list
+                                        (* %block l = (l1 | ... | ln) *)
+  | SkoDec of string * mid option * int        (* sa: K : kind  or           *)
+              * Exp * Uni              (* sc: A : type               *)
+
+  and Ancestor =                       (* Ancestor of d or a         *)
+    Anc of cid option * int * cid option (* head(expand(d)), height, head(expand[height](d)) *)
+                                        (* NONE means expands to {x:A}B *)
+
+  datatype StrDec =                     (* Structure declaration      *)
+      StrDec of string * mid option
+
+  (* Form of constant declaration *)
+  datatype ConDecForm =
+    FromCS                             (* from constraint domain *)
+  | Ordinary                           (* ordinary declaration *)
+  | Clause                             (* %clause declaration *)
+
+  (* Type abbreviations *)
+  type dctx = Dec Ctx                  (* G = . | G,D                *)
+  type eclo = Exp * Sub                (* Us = U[s]                  *)
+  type bclo = Block * Sub              (* Bs = B[s]                  *)
+  type cnstr = Cnstr ref
+
+  exception Error of string            (* raised if out of space     *)
+
+  (* standard operations on foreign expressions *)
+  structure FgnExpStd : sig
+    (* convert to internal syntax *)
+    structure ToInternal : FGN_OPN where type arg = unit
+                                   where type result = Exp
+
+    (* apply function to subterms *)
+    structure Map : FGN_OPN where type arg = Exp -> Exp
+                           where type result = Exp
+
+    (* apply function to subterms, for effect *)
+    structure App : FGN_OPN where type arg = Exp -> unit
+                           where type result = unit
+
+    (* test for equality *)
+    structure EqualTo : FGN_OPN where type arg = Exp
+                                where type result = bool
+
+    (* unify with another term *)
+    structure UnifyWith : FGN_OPN where type arg = Dec Ctx * Exp
+                                  where type result = FgnUnify
+
+    (* fold a function over the subterms *)
+    val fold : (csid * FgnExp) -> (Exp * 'a -> 'a) -> 'a -> 'a
+  end
+
+  (* standard operations on foreign constraints *)
+  structure FgnCnstrStd : sig
+    (* convert to internal syntax *)
+    structure ToInternal : FGN_OPN where type arg = unit
+                                   where type result = (Dec Ctx * Exp) list
+
+    (* awake *)
+    structure Awake : FGN_OPN where type arg = unit
+                              where type result = bool
+
+    (* simplify *)
+    structure Simplify : FGN_OPN where type arg = unit
+                                 where type result = bool
+  end
+  
+  val conDecName   : ConDec -> string
+  val conDecParent : ConDec -> mid option
+  val conDecImp    : ConDec -> int
+  val conDecStatus : ConDec -> Status
+  val conDecType   : ConDec -> Exp
+  val conDecBlock  : ConDec -> dctx * Dec list
+  val conDecUni    : ConDec -> Uni
+
+  val strDecName   : StrDec -> string
+  val strDecParent : StrDec -> mid option
+
+  val sgnReset     : unit -> unit
+  val sgnSize      : unit -> cid * mid
+
+  val sgnAdd   : ConDec -> cid
+  val sgnLookup: cid -> ConDec
+  val sgnApp   : (cid -> unit) -> unit
+
+  val sgnStructAdd    : StrDec -> mid
+  val sgnStructLookup : mid -> StrDec
+
+  val constType   : cid -> Exp         (* type of c or d             *)
+  val constDef    : cid -> Exp         (* definition of d            *)
+  val constImp    : cid -> int
+  val constStatus : cid -> Status
+  val constUni    : cid -> Uni
+  val constBlock  : cid -> dctx * Dec list
+
+  (* Declaration Contexts *)
+
+  val ctxDec    : dctx * int -> Dec    (* get variable declaration   *)
+  val blockDec  : dctx * Block * int -> Dec 
+
+  (* Explicit substitutions *)
+
+  val id        : Sub                  (* id                         *)
+  val shift     : Sub                  (* ^                          *)
+  val invShift  : Sub                   (* ^-1                        *)
+
+  val bvarSub   : int * Sub -> Front    (* k[s]                       *)
+  val frontSub  : Front * Sub -> Front (* H[s]                       *)
+  val decSub    : Dec * Sub -> Dec     (* x:V[s]                     *)
+  val blockSub  : Block * Sub -> Block  (* B[s]                       *)
+
+  val comp      : Sub * Sub -> Sub     (* s o s'                     *)
+  val dot1      : Sub -> Sub           (* 1 . (s o ^)                *)
+  val invDot1   : Sub -> Sub           (* (^ o s) o ^-1)             *)
+
+  (* EVar related functions *)
+
+  val newEVar    : dctx * Exp -> Exp   (* creates X:G|-V, []         *) 
+  val newAVar    : unit ->  Exp                (* creates A (bare)           *) 
+  val newTypeVar : dctx -> Exp         (* creates X:G|-type, []      *)
+  val newLVar    : Sub * (cid * Sub) -> Block  
+                                       (* creates B:(l[^k],t)        *) 
+
+  (* Definition related functions *)
+  val headOpt : Exp -> Head option
+  val ancestor : Exp -> Ancestor
+  val defAncestor : cid -> Ancestor
+
+  (* Type related functions *)
+
+  (* Not expanding type definitions *)
+  val targetHeadOpt : Exp -> Head option (* target type family or NONE *)
+  val targetHead : Exp -> Head           (* target type family         *)
+
+  (* Expanding type definitions *)
+  val targetFamOpt : Exp -> cid option  (* target type family or NONE *)
+  val targetFam : Exp -> cid            (* target type family         *)
+
+  (* Used in Flit *)
+  val rename : cid * string -> unit
+
+end;  (* signature INTSYN *)
diff --git a/tests/examplefiles/irc.lsp b/tests/examplefiles/irc.lsp
new file mode 100755 (executable)
index 0000000..6f45976
--- /dev/null
@@ -0,0 +1,214 @@
+#!/usr/bin/env newlisp
+
+;; @module IRC
+;; @description a basic irc library
+;; @version early alpha! 0.1 2011-10-31 14:21:26
+;; @author cormullion
+;; Usage:
+;; (IRC:init "newlithper") ; a username/nick (not that one obviously :-)
+;; (IRC:connect "irc.freenode.net" 6667) ; irc/server
+;; (IRC:join-channel {#newlisp}) ; join a room
+;; either (IRC:read-irc-loop) ; loop - monitor only, no input
+;; or     (IRC:session)       ; a command-line session, end with /QUIT
+
+(context 'IRC)
+    (define Inickname)
+    (define Ichannels)
+    (define Iserver)
+    (define Iconnected)
+    (define Icallbacks '())
+    (define Idle-time 400) ; seconds
+    (define Itime-stamp)   ; time since last message was processed
+
+(define (register-callback callback-name callback-function)
+    (println {registering callback for } callback-name { : } (sym (term callback-function) (prefix callback-function)))
+    (push (list callback-name (sym (term callback-function) (prefix callback-function))) Icallbacks)) 
+
+(define (do-callback callback-name data)
+   (when (set 'func (lookup callback-name Icallbacks)) ; find first callback
+         (if-not (catch (apply func (list data)) 'error)
+                 (println {error in callback } callback-name {: } error))))
+
+(define (do-callbacks callback-name data)
+   (dolist (rf (ref-all callback-name Icallbacks))
+        (set 'callback-entry (Icallbacks (first rf)))
+        (when   (set 'func (last callback-entry))
+                (if-not (catch (apply func (list data)) 'error)
+                (println {error in callback } callback-name {: } error)))))
+
+(define (init str)
+   (set 'Inickname str)
+   (set 'Iconnected nil)
+   (set 'Ichannels '())
+   (set 'Itime-stamp (time-of-day)))
+
+(define (connect server port)
+    (set 'Iserver     (net-connect server port))
+    (net-send Iserver (format "USER %s %s %s :%s\r\n" Inickname Inickname Inickname Inickname))
+    (net-send Iserver (format "NICK %s \r\n" Inickname))
+    (set 'Iconnected true)
+    (do-callbacks "connect" (list (list "server" server) (list "port" port))))
+
+(define (identify password)
+    (net-send Iserver (format "PRIVMSG nickserv :identify %s\r\n" password)))
+
+(define (join-channel channel)
+    (when (net-send Iserver (format "JOIN %s \r\n" channel))
+          (push channel Ichannels)
+          (do-callbacks "join-channel" (list (list "channel" channel) (list "nickname" Inickname)))))
+
+(define (part chan)
+    (if-not (empty? chan)
+        ; leave specified
+        (begin
+            (net-send Iserver (format "PART %s\r\n" chan))
+            (replace channel Ichannels)
+            (do-callbacks "part" (list (list "channel" channel))))
+        ; leave all
+        (begin
+            (dolist (channel Ichannels)
+                (net-send Iserver (format "PART %s\r\n" channel))
+                (replace channel Ichannels)
+                (do-callbacks "part" (list (list "channel" channel)))))))
+
+(define (do-quit message)
+    (do-callbacks "quit" '()) ; chance to do stuff before quit...
+    (net-send Iserver (format "QUIT :%s\r\n" message))
+    (sleep 1000)
+    (set 'Ichannels '())
+    (close Iserver)
+    (set 'Iconnected nil))
+
+(define (privmsg user message)
+    (net-send Iserver (format "PRIVMSG %s :%s\r\n" user message)))
+
+(define (notice user message)
+    (net-send Iserver (format "NOTICE %s :%s\r\n" user message)))
+
+(define (send-to-server message (channel nil))
+    (cond
+        ((starts-with message {/}) ; default command character
+            (set 'the-message (replace "^/" (copy message) {} 0)) ; keep original
+            (net-send Iserver (format "%s \r\n" the-message)) ; send it
+            ; do a quit
+            (if (starts-with (lower-case the-message) "quit")
+                (do-quit { enough})))
+        (true 
+            (if (nil? channel)
+                ; say to all channels
+                (dolist (c Ichannels)
+                        (net-send Iserver (format "PRIVMSG %s :%s\r\n" c message)))
+                ; say to specified channel
+                (if (find channel Ichannels)
+                    (net-send Iserver (format "PRIVMSG %s :%s\r\n" channel message))))))
+    (do-callbacks "send-to-server" (list (list "channel" channel) (list "message" message))))
+
+(define (process-command sender command text)
+    (cond
+        ((= sender "PING")
+            (net-send Iserver (format "PONG %s\r\n" command)))
+        ((or (= command "NOTICE") (= command "PRIVMSG"))
+            (process-message sender command text))
+        ((= command "JOIN")
+            (set 'username (first (clean empty? (parse sender {!|:} 0))))
+            (set 'channel  (last  (clean empty? (parse sender {!|:} 0))))
+            (println {username } username { joined } channel)
+            (do-callbacks "join" (list (list "channel" channel) (list "username" username))))
+        (true
+            nil)))
+
+(define (process-message sender command text)
+    (let ((username {} target {} message {}))
+        (set 'username (first (clean empty? (parse sender {!|:} 0))))
+        (set 'target   (trim  (first (clean empty? (parse text {!|:} 0)))))
+        (set 'message  (slice text (+ (find {:} text) 1)))
+        (cond 
+            ((starts-with message "\001")
+                (process-ctcp username target message))
+            ((find target Ichannels)
+                (cond 
+                    ((= command {PRIVMSG})
+                        (do-callbacks "channel-message" (list (list "channel" target) (list "username" username) (list "message" message))))
+                    ((= command {NOTICE})
+                        (do-callbacks "channel-notice"  (list (list "channel" target) (list "username" username) (list "message" message))))))
+            ((= target Inickname)
+                (cond 
+                    ((= command {PRIVMSG})
+                        (do-callbacks "private-message" (list (list "username" username) (list "message" message))))
+                    ((= command {NOTICE})
+                        (do-callbacks "private-notice"  (list (list "username" username) (list "message" message))))))
+            (true                
+                nil))))
+  
+(define (process-ctcp username target message)
+    (cond
+        ((starts-with message "\001VERSION\001")
+            (net-send Iserver (format "NOTICE %s :\001VERSION %s\001\r\n" username version)))
+        ((starts-with message "\001PING")
+            (set 'data (first (rest (clean empty? (parse message { } 0)))))
+            (set 'data (trim data "\001" "\001"))
+            (net-send Iserver  (format "NOTICE %s :\001PING %s\001\r\n" username data)))
+        ((starts-with message "\001ACTION")
+            (set 'data (first (rest (clean empty? (parse message { } 0)))))
+            (set 'data (join data { }))
+            (set 'data (trim data "\001" "\001"))
+            (if (find target Ichannels)
+                (do-callbacks "channel-action" (list (list "username" username) (list "message" message))))
+            (if (= target Inickname)
+                (do-callbacks "private-action" (list (list "username" username) (list "message" message)))))
+        ((starts-with message "\001TIME\001")
+            (net-send Iserver (format "NOTICE %s:\001TIME :%s\001\r\n" username (date))))))
+
+(define (parse-buffer raw-buffer)
+    (let ((messages (clean empty? (parse raw-buffer "\r\n" 0)))
+          (sender {} command {} text {}))
+        ; check for elapsed time since last activity    
+        (when (> (sub (time-of-day) Itime-stamp) (mul Idle-time 1000))
+              (do-callbacks "idle-event")
+              (set 'Itime-stamp (time-of-day)))
+        (dolist (message messages)
+            (set 'message-parts (parse message { }))           
+            (unless (empty? message-parts)
+                (set 'sender (first message-parts))
+                (catch (set 'command (first (rest message-parts))) 'error)
+                (catch (set 'text (join (rest (rest message-parts)) { })) 'error))
+            (process-command sender command text))))
+
+(define (read-irc)
+    (let ((buffer {}))
+        (when (!= (net-peek Iserver) 0) 
+              (net-receive Iserver buffer 8192 "\n")
+              (unless (empty? buffer)
+                (parse-buffer buffer)))))
+
+(define (read-irc-loop) ; monitoring
+    (let ((buffer {}))       
+        (while Iconnected    
+            (read-irc)
+            (sleep 1000))))
+
+(define (print-raw-message data) ; example of using a callback
+    (set 'raw-data (lookup "message" data))
+    (set 'channel  (lookup "channel" data))
+    (set 'message-text raw-data)
+    (println (date (date-value) 0 {%H:%M:%S }) username {> } message-text))
+
+(define (print-outgoing-message data)
+    (set 'raw-data (lookup "message" data))
+    (set 'channel  (lookup "channel" data))
+    (set 'message-text raw-data)
+    (println (date (date-value) 0 {%H:%M:%S }) Inickname {> } message-text))
+
+(define (session); interactive terminal
+    ; must add callbacks to display messages
+    (register-callback "channel-message" 'print-raw-message)
+    (register-callback "send-to-server"  'print-outgoing-message)
+    (while Iconnected
+        (while (zero? (peek 0))
+            (read-irc))
+        (send-to-server (string (read-line 0))))
+    (println {finished session } (date))
+    (exit))
+
+; end of IRC code
+
diff --git a/tests/examplefiles/markdown.lsp b/tests/examplefiles/markdown.lsp
new file mode 100755 (executable)
index 0000000..8159082
--- /dev/null
@@ -0,0 +1,679 @@
+#!/usr/bin/env newlisp
+
+;; @module markdown
+;; @author cormullion
+;; @description a port of John Gruber's Markdown to newLISP
+;; @location http://unbalanced-parentheses.nfshost.com/
+;; @version of date 2011-10-02 22:36:02
+;; version history: at the end
+;; a port of John Gruber's Markdown.pl (http://daringfireball.net/markdown) script to newLISP...
+;; see his original Perl script for explanations of the fearsome regexen and
+;; byzantine logic, etc...
+;; TODO:
+;;   the following Markdown tests fail:
+;;   Inline HTML (Advanced) ... FAILED
+;;   Links, reference style ... FAILED -- nested brackets 
+;;   Links, shortcut references ... FAILED
+;;   Markdown Documentation - Syntax ... FAILED
+;;   Ordered and unordered lists ... FAILED -- a nested ordered list error
+;;   parens in url : ![this is a stupid URL](http://example.com/(parens).jpg) see (Images.text)
+;;   Add: email address scrambling
+
+(context 'Hash)
+(define HashTable:HashTable)
+
+(define (build-escape-table)
+   (set '*escape-chars* [text]\`*_{}[]()>#+-.![/text])   
+   (dolist (c (explode *escape-chars*))
+        (HashTable c (hash c))))
+
+(define (init-hash txt)
+    ; finds a hash identifier that doesn't occur anywhere in the text
+    (set 'counter 0)
+    (set 'hash-prefix "HASH")
+    (set 'hash-id (string hash-prefix counter))
+    (do-while (find hash-id txt)
+           (set 'hash-id (string hash-prefix (inc counter))))
+    (Hash:build-escape-table))
+
+(define (hash s)
+   (HashTable s (string hash-id (inc counter))))
+
+(context 'markdown)
+
+(define (markdown:markdown txt)
+  (initialize)
+  (Hash:init-hash txt)
+  (unescape-special-chars 
+    (block-transforms 
+      (strip-link-definitions 
+         (protect 
+            (cleanup txt))))))
+
+(define (initialize)
+  (set '*escape-pairs*   '(
+       ({\\\\} {\})
+       ({\\`}  {`})
+       ({\\\*} {*}) 
+       ({\\_}  {_})
+       ([text]\\\{[/text] [text]{[/text])
+       ([text]\\\}[/text] [text]}[/text])
+       ({\\\[} {[})
+       ({\\\]} {]})
+       ({\\\(} {(})
+       ({\\\)} {)})
+       ({\\>}  {>})
+       ({\\\#} {#})
+       ({\\\+} {+})
+       ({\\\-} {-})
+       ({\\\.} {.})
+       ({\\!}  {!})))
+  (set '*hashed-html-blocks* '())
+  (set '*list-level* 0))
+
+(define (block-transforms txt)
+   (form-paragraphs 
+    (protect 
+     (block-quotes 
+      (code-blocks 
+       (lists 
+        (horizontal-rules 
+         (headers txt))))))))
+
+(define (span-transforms txt)
+  (line-breaks 
+   (emphasis 
+    (amps-and-angles 
+     (auto-links 
+      (anchors 
+       (images 
+        (escape-special-chars 
+         (escape-special-chars (code-spans txt) 'inside-attributes)))))))))
+
+(define (tokenize-html xhtml)
+; return list of tag/text portions of xhtml text
+  (letn (
+       (tag-match [text]((?s:<!(-- .*? -- \s*)+>)|
+(?s:<\?.*?\?>)|
+(?:<[a-z/!$](?:[^<>]|
+(?:<[a-z/!$](?:[^<>]|
+(?:<[a-z/!$](?:[^<>]|
+(?:<[a-z/!$](?:[^<>]|
+(?:<[a-z/!$](?:[^<>]|
+(?:<[a-z/!$](?:[^<>])*>))*>))*>))*>))*>))*>))[/text]) ; yeah, well...
+      (str xhtml)
+      (len (length str))
+      (pos 0)
+      (tokens '()))
+ (while (set 'tag-start (find tag-match str 8))
+    (if (< pos tag-start)
+        (push (list 'text (slice str pos (- tag-start pos))) tokens -1))
+    (push (list 'tag $0) tokens -1)
+    (set 'str (slice str (+ tag-start (length $0))))
+    (set 'pos 0))
+ ; leftovers
+  (if (< pos len)
+      (push (list 'text (slice str pos (- len pos))) tokens -1))
+  tokens))
+
+(define (escape-special-chars txt (within-tag-attributes nil))
+  (let ((temp (tokenize-html txt))
+        (new-text {}))    
+    (dolist (pair temp)
+        (if (= (first pair) 'tag)
+             ; 'tag
+             (begin              
+              (set 'new-text (replace {\\} (last pair) (HashTable {\\}) 0))
+              (replace [text](?<=.)</?code>(?=.)[/text] new-text (HashTable {`}) 0)
+              (replace {\*} new-text (HashTable {*}) 0)
+              (replace {_} new-text (HashTable {_} ) 0))
+             ; 'text
+             (if  within-tag-attributes
+                  (set 'new-text (last pair))
+                  (set 'new-text (encode-backslash-escapes (last pair)))))
+        (setf (temp $idx) (list (first pair) new-text)))
+  ; return as text
+  (join (map last temp))))
+
+(define (encode-backslash-escapes t)
+   (dolist (pair *escape-pairs*)
+      (replace (first pair) t (HashTable (last pair)) 14)))
+
+(define (encode-code s)
+ ; encode/escape certain characters inside Markdown code runs
+  (replace {&}  s   "&amp;" 0)
+  (replace {<}  s   "&lt;" 0)
+  (replace {>}  s   "&gt;" 0)
+  (replace {\*} s   (HashTable {\\}) 0)
+  (replace {_}  s   (HashTable {_}) 0)
+  (replace "{"  s   (HashTable "{") 0)
+  (replace {\[} s   (HashTable {[}) 0)
+  (replace {\]} s   (HashTable {]}) 0)
+  (replace {\\} s   (HashTable "\\") 0))
+
+(define (code-spans s)
+  (replace  
+    {(?<!\\)(`+)(.+?)(?<!`)\1(?!`)} 
+    s 
+    (string {<code>} (encode-code (trim $2)) {</code>}) 
+    2))
+
+(define (encode-alt s)
+  (replace {&} s "&amp;" 0)
+  (replace {"} s "&quot;" 0))
+
+(define (images txt)
+ (let ((alt-text {})
+       (url {})
+       (title {})
+       (ref-regex    {(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])})
+       (inline-regex {(!\[(.*?)\]\([ \t]*<?(\S+?)>?[ \t]*((['"])(.*?)\5[ \t]*)?\))})
+       (whole-match  {})
+       (result {})
+       (id-ref {})
+       (url    {}))
+  ;  reference links ![alt text][id]
+  (replace 
+    ref-regex 
+    txt 
+    (begin
+       (set 'whole-match $1 'alt-text $2 'id-ref $3)       
+       (if alt-text
+             (replace {"} alt-text {&quot;} 0))
+       (if (empty? id-ref)
+            (set 'id-ref (lower-case alt-text)))     
+       (if (lookup id-ref *link-database*)
+           (set 'url (first (lookup id-ref *link-database*)))
+           (set 'url nil))
+       (if url
+           (begin 
+              (replace {\*} url (HashTable {*}) 0)
+              (replace {_}  url (HashTable {_}) 0) 
+            ))             
+       (if (last (lookup id-ref *link-database*))
+            ; title
+           (begin
+             (set 'title (last (lookup id-ref *link-database*)))
+             (replace {"}  title {&quot;} 0)
+             (replace {\*} title (HashTable {*}) 0)
+             (replace {_}  title (HashTable {_}) 0))
+           ; no title
+           (set 'title {})
+           )       
+       (if url
+        (set 'result (string 
+          {<img src="} 
+          (trim url) 
+          {" alt="} 
+          alt-text {" }
+          (if (not (empty? title))
+               (string { title="} title {"}) {})
+          { />}))
+        (set 'result whole-match))
+     )
+     0
+   )
+   ; inline image refs:  ![alt text](url "optional title")
+    (replace 
+      inline-regex 
+      txt 
+      (begin
+        (set 'whole-match $1)
+        (set 'alt-text $2)
+        (set 'url $3)
+        (set 'title $6)
+        (if alt-text
+             (replace {"} alt-text {&quot;} 0)
+             (set 'alt-text {}))          
+        (if  title 
+             (begin 
+               (replace {"}  title {&quot;} 0)
+               (replace {\*} title (HashTable {*}) 0)
+               (replace {_}  title (HashTable {_}) 0))
+             (set 'title {}))           
+        (replace {\*} url (HashTable {*}) 0)
+        (replace {_} url (HashTable {_}) 0)
+        (string 
+           {<img src="} 
+           (trim url) 
+           {" alt="} 
+           alt-text {" }
+           (if title (string {title="} title {"}) {}) { />})
+        )
+        0
+     )
+    ; empty ones are possible
+    (set '$1 {})
+    (replace {!\[(.*?)\]\([ \t]*\)} 
+     txt 
+     (string {<img src="" alt="} $1 {" title="" />})
+     0)))
+
+(define (make-anchor link-text id-ref )
+; Link defs are in the form: ^[id]: url "optional title"
+; stored in link db list  as (id (url title))
+; params are text to be linked and the id of the link in the db
+; eg bar 1 for [bar][1]
+
+   (let ((title {})
+           (id id-ref)
+           (url nil))
+      (if link-text
+          (begin
+             (replace {"} link-text {&quot;} 0)
+             (replace {\n} link-text { } 0)
+             (replace {[ ]?\n} link-text { } 0)))   
+      (if (null? id ) (set 'id  (lower-case link-text)))
+      (if (not (nil? (lookup id *link-database*)))
+          (begin
+             (set 'url (first (lookup id  *link-database*)))
+             (replace {\*} url (HashTable {*}) 0)
+             (replace {_}  url (HashTable {_}) 0)
+             (if (set 'title (last (lookup id  *link-database*)))
+                 (begin 
+                      (replace {"}  title {&quot;} 0)
+                      (replace {\*} title (HashTable {*}) 0)
+                      (replace {_}  title (HashTable {_}) 0))
+                (set 'title {})))
+           (set 'url nil))
+      (if url
+          (string {<a href="} (trim url) 
+               {"}
+               (if (not (= title {})) (string { title="} (trim title) {"}) {})
+               {>} link-text {</a>})
+          (string {[} link-text {][} id-ref {]}))))
+
+(define (anchors txt)
+  (letn ((nested-brackets {(?>[^\[\]]+)*})
+         (ref-link-regex (string {(\[(} nested-brackets {)\][ ]?(?:\n[ ]*)?\[(.*?)\])}))
+         (inline-regex {(\[(.*?)\]\([ ]*<?(.*?\)?)>?[ ]*((['"])(.*?)\5[ \t]*)?\))})
+         (link-text {})
+         (url {})
+         (title {}))         
+  ; reference-style links: [link text] [id]
+  (set '$1 {} '$2 {} '$3 {} '$4 {} '$5 {} '$6 {})    ; i still don't think I should have to do this...
+  
+  ; what about this regex instead?
+  (set 'ref-link-regex {(\[(.*?)\][ ]?\[(.*?)\])})
+   
+  (replace ref-link-regex txt (make-anchor $2 $3) 8) ; $2 is link text, $3 is id
+  ; inline links: [link text](url "optional title")
+  (set '$1 {} '$2 {} '$3 {} '$4 {} '$5 {} '$6 {})
+  (replace 
+     inline-regex 
+     txt 
+    (begin
+      (set 'link-text $2)
+      (set 'url $3)
+      (set 'title $6)
+      (if link-text (replace {"} link-text {&quot;} 0))          
+      (if title 
+           (begin 
+             (replace {"}  title {&quot;} 0)
+             (replace {\*} title  (HashTable {*}) 0)
+             (replace {_}  title  (HashTable {_}) 0))
+           (set 'title {}))           
+      (replace {\*} url (HashTable {*}) 0)
+      (replace {_}  url (HashTable {_}) 0)
+      (replace {^<(.*)>$} url $1 0)
+      (string 
+         {<a href="} 
+         (trim url)
+         {"}
+         (if (not (= title {}))
+                 (string { title="} (trim title) {"}) 
+                 {})
+         {>} link-text {</a>}
+         ))
+     8
+   ) ; replace
+ ) txt)
+
+(define (auto-links txt)
+ (replace 
+    [text]<((https?|ftp):[^'">\s]+)>[/text] 
+    txt 
+    (string {<a href="} $1 {">} $1 {</a>})  
+    0
+ )
+  ; to-do: email ...
+)
+
+(define (amps-and-angles txt)
+; Smart processing for ampersands and angle brackets
+  (replace 
+    [text]&(?!\#?[xX]?(?:[0-9a-fA-F]+|\w+);)[/text]
+    txt
+    {&amp;}
+    10
+  )
+  (replace 
+    [text]<(?![a-z/?\$!])[/text]
+    txt
+    {&lt;}
+    10))
+
+(define (emphasis txt)
+  ; italics/bold: strong first
+  (replace 
+    [text] (\*\*|__) (?=\S) (.+?[*_]*) (?<=\S) \1 [/text]
+    txt
+    (string {<strong>} $2 {</strong>})
+    8   
+  )
+  (replace 
+    [text] (\*|_) (?=\S) (.+?) (?<=\S) \1 [/text]
+    txt
+    (string {<em>} $2 {</em>})
+    8  
+  ))
+
+(define (line-breaks txt)
+  ; handles line break markers
+  (replace " {2,}\n" txt " <br/>\n" 0))
+
+(define (hex-str-to-unicode-char strng)
+   ; given a five character string, assume it's "U" + 4 hex chars and convert
+   ; return the character...
+   (char (int (string "0x" (1 strng)) 0 16)))
+
+(define (ustring s)
+  ; any four digit string preceded by U 
+  (replace "U[0-9a-f]{4,}" s (hex-str-to-unicode-char $0) 0))
+
+(define (cleanup txt)
+  ; cleanup the text by normalizing some possible variations
+  (replace "\r\n|\r" txt "\n" 0)      ; standardize line ends
+  (push "\n\n" txt -1)                ; end with two returns
+  (set 'txt (detab txt))              ; convert tabs to spaces
+  
+  ; convert inline Unicode:
+  (set 'txt (ustring txt))
+  (replace "\n[ \t]+\n" txt "\n\n" 0) ; lines with only spaces and tabs
+  )
+
+(define (protect txt)
+ ; protect or "hash html blocks" 
+ (letn ((nested-block-regex  [text](^<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b(.*\n)*?</\2>[ \t]*(?=\n+|\Z))[/text])
+       (liberal-tag-regex [text](^<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b(.*\n)*?.*</\2>[ \t]*(?=\n+|\Z))[/text])
+       (hr-regex  [text](?:(?<=\n\n)|\A\n?)([ ]{0,3}<(hr)\b([^<>])*?/?>[ \t]*(?=\n{2,}|\Z))[/text])
+       (html-comment-regex [text](?:(?<=\n\n)|\A\n?)([ ]{0,3}(?s:<!(--.*?--\s*)+>)[ \t]*(?=\n{2,}|\Z))[/text])
+       (results '())
+       (chunk-count (length (set 'chunks (parse txt "\n\n"))))
+       (chunk-size 500))
+   
+   ; due to a limitation in PCRE, long sections have to be divided up otherwise we'll crash
+   ; so divide up long texts into chunks, then do the regex on each chunk
+   ; not an ideal solution, but it works ok :( 
+  
+   (for (i 0 chunk-count chunk-size)
+       ; do a chunk
+       (set 'text-chunk (join (i (- (min chunk-count (- (+ i chunk-size) 1)) i) chunks) "\n\n"))
+       (dolist (rgx (list nested-block-regex liberal-tag-regex hr-regex html-comment-regex))
+         (replace 
+            rgx 
+            text-chunk
+            (begin
+              (set 'key (Hash:hash $1))
+              (push (list key $1 ) *hashed-html-blocks* -1)
+              (string "\n\n" key "\n\n"))
+            2))
+        ; save this partial result
+        (push text-chunk results -1)
+    ) ; for
+  ; return string result
+  (join results "\n\n")))
+
+(define (unescape-special-chars t)
+ ; Swap back in all the special characters we've hidden. 
+  (dolist (pair (HashTable))
+    (replace (last pair) t (first pair) 10)) t)
+
+(define (strip-link-definitions txt)
+ ; strip link definitions from the text and store them
+ ; Link defs are in the form: ^[id]: url "optional title"
+ ; stored in link db list  as (id (url title))
+  (let ((link-db '())
+        (url {})
+        (id {})
+        (title {}))
+     (replace 
+       [text]^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(?<=\s)["(](.+?)[")][ \t]*)?(?:\n+|\Z)[/text]
+       txt 
+       (begin 
+         (set 'id (lower-case $1) 'url (amps-and-angles $2) 'title $3)
+         (if title (replace {"} title {&quot;} 0))
+         (push (list id (list url title)) link-db)
+         (set '$3 {}) ; necessary?
+         (string {}) ; remove from text
+         ) 
+       10)
+     (set '*link-database* link-db)
+     txt))
+
+(define (horizontal-rules txt)
+   (replace 
+   [text]^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$[/text]
+    txt
+    "\n<hr />"
+    14)  
+   (replace 
+   [text]^[ ]{0,2}([ ]? -[ ]?){3,}[ \t]*$[/text]
+   txt
+   "\n<hr />"
+   14)  
+   (replace 
+    [text]^[ ]{0,2}([ ]? _[ ]?){3,}[ \t]*$[/text]
+    txt
+    "\n<hr />"
+    14))
+
+(define (headers txt)
+  ; setext headers
+ (let ((level 1))
+    (replace 
+      [text]^(.+)[ \t]*\n=+[ \t]*\n+[/text]
+      txt 
+      (string "<h1>" (span-transforms $1) "</h1>\n\n")
+      2)  
+  
+    (replace 
+      [text]^(.+)[ \t]*\n-+[ \t]*\n+[/text]
+      txt 
+      (string "<h2>" (span-transforms $1) "</h2>\n\n")
+      2) 
+   ; atx headers
+    (replace 
+      [text]^(\#{1,6})\s*(.+?)[ ]*\#*(\n+)[/text]
+      txt 
+      (begin
+       (set 'level (length $1))
+       (string "<h" level ">" (span-transforms $2) "</h" level ">\n\n")
+       )
+      2)))
+
+(define (lists txt)
+ (letn ((marker-ul {[*+-]})
+        (marker-ol {\d+[.]})
+        (marker-any (string {(?:} marker-ul {|} marker-ol {)}))
+        (whole-list-regex (string [text](([ ]{0,3}([/text] marker-any [text])[ \t]+)(?s:.+?)(\z|\n{2,}(?=\S)(?![ \t]*[/text] marker-any [text][ \t]+)))[/text]))
+        (my-list {})
+        (list-type {})
+        (my-result {}))
+   (replace 
+      (if (> *list-level* 0)
+          (string {^} whole-list-regex) 
+          (string {(?:(?<=\n\n)|\A\n?)} whole-list-regex))
+      txt
+      (begin
+         (set 'my-list $1)
+         (if (find $3 marker-ul) 
+            (set 'list-type "ul" 'marker-type marker-ul) 
+            (set 'list-type "ol" 'marker-type marker-ol))
+         (replace [text]\n{2,}[/text] my-list "\n\n\n" 0)
+         (set 'my-result (process-list-items my-list marker-any))
+         (replace {\s+$} my-result {} 0)
+         (string {<} list-type {>} "\n" my-result "\n" {</} list-type {>} "\n"))
+      10 ; must be multiline
+      )))
+
+(define (process-list-items list-text marker-any)    
+  (let ((list-regex (string [text](\n)?(^[ \t]*)([/text] marker-any [text])[ \t]+((?s:.+?)(\n{1,2}))(?=\n*(\z|\2([/text] marker-any [text])[ \t]+))[/text]))
+        (item {})
+        (leading-line {})
+        (leading-space {})
+        (result {}))
+     (inc *list-level*)
+     (replace [text]\n{2,}\z[/text] list-text "\n" 0)
+     (set '$1 {} '$2 {} '$3 {} '$4 {} '$5 {})
+     (replace 
+       list-regex
+       list-text
+       (begin
+         (set 'item $4)
+         (set 'leading-line $1)
+         (set 'leading-space $2)
+         (if (or (not (empty? leading-line)) (ends-with item "\n{2,}" 0))
+             (set 'item (block-transforms (outdent item)))
+           ; recurse for sub lists
+           (begin 
+              (set 'item (lists (outdent item))) 
+              (set 'item (span-transforms (trim item "\n")))
+              ))
+       (string {<li>} item {</li>} "\n"))
+     10)
+    (dec *list-level*)
+   list-text))
+
+(define (code-blocks txt)
+ (let ((code-block {})
+       (token-list '()))
+  (replace 
+    [text](?:\n\n|\A)((?:(?:[ ]{4}|\t).*\n+)+)((?=^[ ]{0,3}\S)|\Z)[/text]
+    txt 
+    (begin 
+      (set 'code-block $1)
+      ; format if Nestor module is loaded and it's not marked as plain
+      (if (and (not (starts-with code-block "    ;plain\n")) (context? Nestor))
+          ; format newlisp
+          (begin 
+             ; remove flag if present
+            (replace "[ ]{4};newlisp\n" code-block {} 0)       
+            (set 'code-block (protect (Nestor:nlx-to-html (Nestor:my-read (trim (detab (outdent code-block)) "\n")))))
+            code-block)
+          ; don't format 
+          (begin
+            ; trim leading and trailing newlines
+            (replace "[ ]{4};plain\n" code-block {} 0)
+            (set 'code-block (trim (detab (encode-code (outdent code-block))) "\n"))
+            (set '$1 {})
+            (set 'code-block (string "\n\n<pre><code>" code-block "\n</code></pre>\n\n")))))
+    10)))
+
+(define (block-quotes txt)
+  (let ((block-quote {}))
+     (replace 
+       [text]((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)[/text]
+       txt 
+       (begin 
+         (set 'block-quote $1)
+         (replace {^[ ]*>[ ]?} block-quote {} 2)
+         (replace {^[ ]+$} block-quote {} 2)
+         (set 'block-quote (block-transforms block-quote)) ; recurse     
+         ; remove leading spaces
+         (replace 
+             {(\s*<pre>.+?</pre>)} 
+             block-quote 
+             (trim $1)
+             2)
+         (string "<blockquote>\n" block-quote "\n</blockquote>\n\n"))
+       2)))
+
+(define (outdent s)
+  (replace [text]^(\t|[ ]{1,4})[/text] s {} 2))
+
+(define (detab s)
+  (replace [text](.*?)\t[/text] 
+    s   
+    (string $1 (dup { } (- 4 (% (length $1) 4))))
+    2))
+
+(define (form-paragraphs txt)
+  (let ((grafs '())
+        (original nil))
+    (set 'txt   (trim txt "\n"))            ; strip blank lines before and after
+    (set 'grafs (parse txt "\n{2,}" 0))     ; split    
+    (dolist (p grafs)
+      (if (set 'original (lookup p *hashed-html-blocks*))
+        ; html blocks
+        (setf (grafs $idx) original)
+        ; wrap <p> tags round everything else
+        (setf (grafs $idx) (string {<p>} (replace {^[ ]*} (span-transforms p) {} (+ 4 8 16)) {</p>}))))
+    (join grafs "\n\n")))
+
+[text]
+; three command line arguments: let's hope last one is a file
+(when (= 3 (length (main-args)))
+      (println (markdown (read-file (main-args 2))))
+      (exit))
+
+; hack for command-line and module loading
+(set 'level (sys-info 3))
+
+; if level is 2, then we're probably invoking markdown.lsp directly
+; if level is > 3, then we're probably loading it into another script...
+    
+(when (= level 2)
+   ; running on command line, read STDIN and execute:
+   (while (read-line)
+          (push (current-line) *stdin* -1))
+   (println (markdown (join *stdin* "\n")))
+   (exit))
+[/text]
+
+;; version 2011-09-16 16:31:29
+;;   Changed to different hash routine. Profiling shows that hashing takes 40% of the execution time.
+;;   Unfortunately this new version is only very slightly faster.
+;;   Command-line arguments hack in previous version doesn't work.
+;;
+;; version 2011-08-18 15:04:40
+;;   various fixes, and added hack for running this from the command-line:
+;;     echo "hi there"     | newlisp markdown.lsp 
+;;     echo "hello world"  | markdown.lsp 
+;;     cat file.text       | newlisp markdown.lsp
+;;
+;; version 2010-11-14 17:34:52
+;;    some problems in ustring. Probably remove it one day, as it's non standard...
+;;
+;; version 2010-10-14 18:41:38
+;;    added code to work round PCRE crash in (protect ...
+;;
+;; version date 2010-07-10 22:20:25
+;;    modified call to 'read' since lutz has changed it
+;;
+;; version date 2009-11-16 22:10:10
+;;    fixed bug in tokenize.html
+;;
+;; version date 2008-10-08 18:44:46
+;;    changed nth-set to setf to be version-10 ready. 
+;;    This means that now this script will NOT work with
+;;    earlier versions of newLISP!!!!!!!!!!!
+;;    requires Nestor if you want source code colouring...
+;;
+;; version date 2008-08-08 16:54:56
+;;    changed (unless to (if (not ... :(
+;;
+;; version date 2008-07-20 14:!2:29
+;;    added hex-str-to-unicode-char ustring
+;;
+;; version date 2008-03-07 15:36:09
+;;    fixed load error
+;;
+;; version date 2007-11-17 16:20:57
+;;    added syntax colouring module
+;; 
+;; version date  2007-11-14 09:19:42
+;;    removed reliance on dostring for compatibility with 9.1
+
+
+; eof
\ No newline at end of file
diff --git a/tests/examplefiles/nemerle_sample.n b/tests/examplefiles/nemerle_sample.n
new file mode 100644 (file)
index 0000000..5236857
--- /dev/null
@@ -0,0 +1,87 @@
+using System;
+
+namespace Demo.Ns
+{
+  /// sample class
+  public class ClassSample : Base
+  {
+    /* sample multiline comment */
+#region region sample
+    fieldSample : int;
+#endregion
+
+    public virtual someMethod(str : string) : list[double]
+    {
+      def x = "simple string";
+      def x = $"simple $splice string $(spliceMethod() + 1)";
+      def x = <#
+        recursive <# string #> sample
+      #>;
+      def x = $<#
+        recursive $splice <# string #> sample
+        ..$(lst; "; "; x => $"x * 2 = $(x * 2)") str
+      #>;
+      def x = @"somestring \";
+
+      def localFunc(arg)
+      {
+         arg + 1;
+      }
+
+      match (localFunc(2))
+      {
+        | 3 => "ok";
+        | _ => "fail";
+      }
+
+      using (x = SomeObject())
+      {
+        foreach (item in someCollection)
+        {
+          def i = try
+          {
+            int.Parse(item)
+          }
+          catch
+          {
+            | _ is FormatException => 0;
+          }
+          when (i > 0xff)
+            unless (i < 555L)
+              WriteLine(i);
+          
+        }
+      }
+      protected override overrideSample() : void
+      {}
+
+      private privateSample() : void
+      {}
+
+      public abstract abstractSample() : void
+      {}
+    }
+
+  }
+
+  module ModuleSample
+  {
+  }
+
+  variant RgbColor {
+   | Red
+   | Yellow
+   | Green
+   | Different {
+       red : float;
+       green : float;
+       blue : float;
+     }
+  }
+
+  macro sampleMacro(expr)
+  syntax ("write", expr)
+  {
+    <[ WriteLine($(expr : dyn)) ]>
+  }
+}
index c2a1c414e663c1be8c16872fe2b0aecf10180a70..cb5c0975488567e922fc56cc83fdb94715ab4488 100644 (file)
@@ -1,5 +1,19 @@
 #import "Somefile.h"
 
+@implementation ABC
+
+- (id)a:(B)b {
+    return 1;
+}
+
+@end
+
+@implementation ABC
+
+- (void)xyz;
+
+@end
+
 NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
     @"quattuor", @"four", @"quinque", @"five", @"sex", @"six", nil];
 
diff --git a/tests/examplefiles/postgresql_test.txt b/tests/examplefiles/postgresql_test.txt
new file mode 100644 (file)
index 0000000..190d184
--- /dev/null
@@ -0,0 +1,47 @@
+CREATE OR REPLACE FUNCTION something() RETURNS int4 AS
+$x$
+BEGIN
+    RETURN 42;
+END
+$x$
+LANGUAGE 'plpgsql';
+
+CREATE FUNCTION pymax (a integer, b integer)
+  RETURNS integer
+AS $$
+  if a > b:
+    return a
+  return b
+$$ language plpythonu;
+
+CREATE FUNCTION nested_lexers (a integer, b integer)
+$function$
+BEGIN
+    SELECT ($1 ~ $q$[\t\r\n\v\\]$q$);
+END;
+$function$
+LANGUAGE sql;
+
+CREATE OR REPLACE FUNCTION measurement_insert_trigger()
+RETURNS TRIGGER AS $$
+BEGIN
+    <<test>>
+    INSERT INTO measurement_y2008m01 VALUES (NEW.*);
+    RETURN NULL;
+END;
+$$
+LANGUAGE plpgsql;
+
+-- As returned by pg_dump
+CREATE FUNCTION test_function() RETURNS integer
+    LANGUAGE plpgsql STABLE STRICT
+    AS $$
+begin
+    return 42;
+end
+$$;
+
+-- Unicode names and strings
+SELECT U&'\0441\043B\043E\043D'
+FROM U&"\0441\043B\043E\043D";
+
diff --git a/tests/examplefiles/psql_session.txt b/tests/examplefiles/psql_session.txt
new file mode 100644 (file)
index 0000000..7096072
--- /dev/null
@@ -0,0 +1,122 @@
+regression=# select foo;
+ERROR:  column "foo" does not exist
+CONTEXT:  PL/pgSQL function "test1" while casting return value to function's return type
+LINE 1: select foo;
+               ^
+regression=# \q
+
+peter@localhost testdb=> \a \t \x
+Output format is aligned.
+Tuples only is off.
+Expanded display is on.
+
+regression=# select '\x';
+WARNING:  nonstandard use of escape in a string literal
+LINE 1: select '\x';
+               ^
+HINT:  Use the escape string syntax for escapes, e.g., E'\r\n'.
+ ?column? 
+----------
+ x
+(1 row)
+
+regression=# select E'\x';
+
+piro=> \set foo 30;
+piro=> select * from test where foo <= :foo;
+ foo | bar 
+-----+-----
+  10 | 
+  20 | 
+(2 rows)
+
+testdb=> \set foo 'my_table'
+testdb=> SELECT * FROM :"foo";
+
+testdb=> \set content `cat my_file.txt`
+testdb=> INSERT INTO my_table VALUES (:'content');
+
+regression=# select (
+regression(# 1);
+ ?column? 
+----------
+        1
+(1 row)
+
+piro=> select (
+piro(> '
+piro'> ' || $$
+piro$> $$)
+piro-> from "
+piro"> foo";
+ERROR:  relation "
+foo" does not exist
+LINE 5: from "
+             ^
+
+testdb=> CREATE TABLE my_table (
+first integer not null default 0,
+second text) ; -- end of command
+CREATE TABLE
+
+-- Table output
+=# SELECT '0x10'::mpz AS "hex", '10'::mpz AS "dec",
+-#        '010'::mpz AS oct, '0b10'::mpz AS bin;
+ hex | dec | oct | bin
+-----+-----+-----+-----
+ 16  | 10  | 8   | 2
+(1 row)
+
+-- One field output
+regression=# select schemaname from  pg_tables limit 3;
+ schemaname 
+------------
+ pg_catalog
+ pg_catalog
+ pg_catalog
+(3 rows)
+
+-- TODO: prompt in multiline comments still not handled correctly
+test=> select 1 /* multiline
+test*> and 2 /* and 3 */
+test*> end comment */, 2;
+ ?column? | ?column? 
+----------+----------
+        1 |        2
+
+=# select 10.0, 1e-6, 1E+6;
+ ?column? | ?column? | ?column? 
+----------+----------+----------
+     10.0 | 0.000001 |  1000000
+(1 row)
+
+regression=# begin;
+BEGIN
+regression=# create table asdf (foo serial primary key);
+NOTICE:  CREATE TABLE will create implicit sequence "asdf_foo_seq" for serial column "asdf.foo"
+NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "asdf_pkey" for table "asdf"
+CREATE TABLE
+regression=# insert into asdf values (10) returning foo;
+ foo 
+-----
+  10
+(1 row)
+
+INSERT 0 1
+regression=# ROLLBACK ;
+ROLLBACK
+
+=> EXPLAIN SELECT * FROM tenk1
+-> WHERE unique1 < 100;   -- Don't take -> in the plan as a prompt
+
+                                  QUERY PLAN
+------------------------------------------------------------------------------
+ Bitmap Heap Scan on tenk1  (cost=2.37..232.35 rows=106 width=244)
+   Recheck Cond: (unique1 < 100)
+   ->  Bitmap Index Scan on tenk1_unique1  (cost=0.00..2.37 rows=106 width=0)
+         Index Cond: (unique1 < 100)
+
+
+-- don't swallow the end of a malformed line
+test=> select 1,
+'this line must be emitted'
diff --git a/tests/examplefiles/reversi.lsp b/tests/examplefiles/reversi.lsp
new file mode 100644 (file)
index 0000000..fa9a333
--- /dev/null
@@ -0,0 +1,427 @@
+#!/usr/bin/env newlisp
+;; @module reversi.lsp
+;; @description a simple version of Reversi: you as white against newLISP as black
+;; @version 0.1 alpha August 2007
+;; @author cormullion
+;;
+;; 2008-10-08 21:46:54
+;; updated for newLISP version 10. (changed nth-set to setf)
+;; this now does not work with newLISP version 9!
+;;
+;; This is my first attempt at writing a simple application using newLISP-GS.
+;; The game algorithms are basically by 
+;; Peter Norvig http://norvig.com/paip/othello.lisp
+;; and all I've done is translate to newLISP and add the interface...
+;;
+;; To-Do: work out how to handle the end of the game properly...
+;; To-Do: complete newlispdoc for the functions
+
+(constant 'empty 0) 
+(constant 'black 1) 
+(constant 'white 2)
+(constant 'outer 3) ; squares outside the 8x8 board
+
+(set '*board* '()) ; the master board is a 100 element list
+(set '*moves* '()) ; list of moves made
+
+; these are the 8 different directions from a square on the board
+
+(set 'all-directions '(-11 -10 -9 -1 1 9 10 11))
+
+; return a list of all the playable squares (the 8 by 8 grid inside the 10by10
+
+(define (all-squares)
+  (local (result)
+     (for (square 11 88)
+        (if (<= 1 (mod square 10) 8)
+           (push square result -1)))
+result))
+
+; make a board
+
+(define (make-board)
+  (set '*board* (dup outer 100))
+  (dolist (s (all-squares))
+     (setf (*board* s) empty)))
+
+; for testing and working at a terminal
+
+(define (print-board)
+  (print { })
+  (for (c 1 8)
+     (print c))
+  (set 'c 0)
+  (for (i 0 99)
+     (cond
+        ((= (*board* i) 0) (print {.}))
+        ((= (*board* i) 1) (print {b}))
+        ((= (*board* i) 2) (print {w})))
+     (if (and (<= i 88) (= (mod (+ i 1) 10) 0)) ; newline
+        (print "\n" (inc c))))
+  (println "\n"))
+
+; the initial starting pattern
+
+(define (initial-board)
+  (make-board)
+  (setf (*board* 44) white)
+  (setf (*board* 55) white)
+  (setf (*board* 45) black)
+  (setf (*board* 54) black))
+
+(define (opponent player)
+  (if (= player black) white black))
+
+(define (player-name player)
+  (if (= player white) "white" "black"))
+  
+(define (valid-move? move)
+  (and 
+     (integer? move)
+     (<= 11 move 88)
+     (<= 1 (mod move 10) 8)))
+
+(define (empty-square? square)
+  (and
+     (valid-move? square)
+     (= (*board* square) empty)))
+     
+; test whether a move is legal. The square must be empty
+; and it must flip at least one of the opponent's piece
+
+(define (legal-move? move player)
+  (and 
+     (empty-square? move)
+     (exists (fn (dir) (would-flip? move player dir)) all-directions)))
+
+; would this move by player result in any flips in the given direction?
+; if so, return the number of the 'opposite' (bracketing) piece's square
+
+(define (would-flip? move player dir) 
+  (let 
+     ((c (+ move dir)))
+     (and 
+        (= (*board* c) (opponent player))
+        (find-bracketing-piece (+ c dir) player dir))))
+  
+(define (find-bracketing-piece square player dir)
+  ; return the square of the bracketing piece, if any
+  (cond
+     ((= (*board* square) player) square)
+     ((= (*board* square) (opponent player))
+        (find-bracketing-piece (+ square dir) player dir))
+     (true nil)))
+
+(define (make-flips move player dir)
+  (let 
+     ((bracketer (would-flip? move player dir))
+      (c (+ move dir)))
+  (if bracketer
+     (do-until (= c bracketer)
+        (setf (*board* c) player)
+        (push c *flips* -1)
+        (inc c dir)))))
+
+; make the move on the master game board, not yet visually
+
+(define (make-move move player)
+  (setf (*board* move) player)
+  (push move *moves* -1)
+  (set '*flips* '()) ; we're going to keep a record of the flips made
+  (dolist (dir all-directions)
+     (make-flips move player dir)))
+
+(define (next-to-play previous-player)
+  (let ((opp (opponent previous-player)))
+     (cond
+        ((any-legal-move? opp) opp)
+        ((any-legal-move? previous-player)
+           (println (player-name opp) " has no moves")
+           previous-player)
+        (true nil))))
+        
+; are there any legal moves (returns first) for this player?
+(define (any-legal-move? player)
+  (exists (fn (move) (legal-move? move player)) 
+     (all-squares)))
+
+; a list of all legal moves might be useful
+(define (legal-moves player)
+  (let ((result '()))
+     (dolist (move (all-squares))
+        (if (legal-move? move player)
+           (push move result)))
+  (unique result)))
+
+; define any number of strategies that can be called on to calculate
+; the next computer move. This is the only one I've done... - make 
+; any legal move at random!
+
+(define (random-strategy player)
+  (seed (date-value))
+  (apply amb (legal-moves player)))
+
+; get the next move using a particular strategy
+
+(define (get-move strategy player)
+ (let ((move (apply strategy (list player))))
+  (cond
+     ((and
+        (valid-move? move)
+        (legal-move? move player))
+            (make-move move player))
+     (true  
+        (println "no valid or legal move for " (player-name player) )
+        nil))
+  move))
+
+; that's about all the game algorithms for now
+; now for the interface
+
+(if (= ostype "Win32")
+   (load (string (env "PROGRAMFILES") "/newlisp/guiserver.lsp"))
+   (load "/usr/share/newlisp/guiserver.lsp")
+)
+
+(gs:init)
+(map set '(screen-width screen-height) (gs:get-screen))
+(set 'board-width 540)
+; center on screen
+(gs:frame 'Reversi (- (/ screen-width 2) (/ board-width 2)) 60 board-width 660 "Reversi")
+(gs:set-border-layout 'Reversi)
+
+(gs:canvas 'MyCanvas 'Reversi)
+  (gs:set-background 'MyCanvas '(.8 .9 .7 .8))
+  (gs:mouse-released 'MyCanvas 'mouse-released-action true)
+
+(gs:panel 'Controls)
+  (gs:button 'Start 'start-game "Start")
+
+(gs:panel 'Lower)
+  (gs:label 'WhiteScore "")
+  (gs:label 'BlackScore "")
+
+(gs:add-to 'Controls 'Start )
+(gs:add-to 'Lower 'WhiteScore 'BlackScore)
+(gs:add-to 'Reversi 'MyCanvas "center" 'Controls "north" 'Lower "south")
+
+(gs:set-anti-aliasing true)
+(gs:set-visible 'Reversi true)
+
+; size of board square, and radius/width of counter
+(set 'size 60 'width 30)
+
+; initialize the master board
+
+(define (initial-board)
+  (make-board)
+  (setf (*board* 44) white)
+  (setf (*board* 55) white)
+  (setf (*board* 45) black)
+  (setf (*board* 54) black)  
+)
+
+; draw a graphical repesentation of the board
+
+(define (draw-board)
+  (local (x y)
+     (dolist (i (all-squares))
+        (map set '(x y) (square-to-xy i))
+        (gs:draw-rect 
+           (string x y) 
+           (- (* y size) width ) ; !!!!!!
+           (- (* x size) width )
+           (* width 2)
+           (* width 2)
+           gs:white))))
+
+(define (draw-first-four-pieces)
+  (draw-piece 44 "white")
+  (draw-piece 55 "white")
+  (draw-piece 45 "black")
+  (draw-piece 54 "black"))
+
+; this next function can mark the legal moves available to a player
+
+(define (show-legal-moves player)
+  (local (legal-move-list x y)
+     (set 'legal-move-list (legal-moves player))
+     (dolist (m (all-squares))
+        (map set '(x y) (square-to-xy m))
+        (gs:draw-rect 
+           (string x y) 
+           (- (* y size) width ) ; !!!!!!
+           (- (* x size) width )
+           (* width 2)
+           (* width 2)
+           (if (find m legal-move-list) gs:blue gs:white)
+        )
+     )
+  )
+)
+
+; convert the number of a square on the master board to coordinates
+
+(define (square-to-xy square) 
+  (list (/ square 10) (mod square 10)))
+
+; draw one of the pieces
+
+(define (draw-piece square colour)
+  (local (x y)
+  (map set '(x y) (square-to-xy square))
+  (cond 
+     ((= colour "white") 
+        (gs:fill-circle 
+           (string x y) 
+           (* y size)  ; !!!!!!! y first, cos y is x ;-)
+           (* x size) 
+           width
+           gs:white))
+     
+     ((= colour "black") 
+        (gs:fill-circle 
+           (string x y) 
+           (* y size) 
+           (* x size) 
+           width
+           gs:black))
+     
+     ((= colour "empty") 
+        (gs:draw-rect 
+           (string x y) 
+           (- (* y size) width ) 
+           (- (* x size) width )
+           (* width 2)
+           (* width 2)
+           gs:white))
+  )))
+
+; animate the pieces flipping
+
+(define (flip-piece square player)
+; flip by drawing thinner and fatter ellipses 
+; go from full disk in opposite colour to invisible
+; then from invisible to full disk in true colour
+  (local (x y colour)
+     (map set '(x y) (square-to-xy square))
+     ; delete original piece
+     (gs:delete-tag (string x y))
+     (set 'colour (if (= player 2) gs:black gs:white )) 
+     (for (i width  1 -3)
+        (gs:fill-ellipse 
+           (string x y {flip} i) 
+           (* y size) ; y first :-) !!! 
+           (* x size) 
+           i 
+           width
+           colour)
+        (sleep 20)  ; this might need adjusting...
+        (gs:delete-tag (string x y {flip} i))
+     )
+     (set 'colour (if (= player 2) gs:white gs:black))
+     (for (i 1 width 3)
+        (gs:fill-ellipse 
+           (string x y {flip} i) 
+           (* y size) ; :-) !!! 
+           (* x size) 
+           i 
+           width
+           colour)
+        (sleep 20)  
+        (gs:delete-tag (string x y {flip} i))
+     )
+     ; draw the piece again
+     (gs:fill-circle 
+           (string x y) 
+           (* y size)
+           (* x size) 
+           width
+           colour)
+  )
+)
+
+(define (do-move move player)
+  (cond 
+     ; check if the move is good ...
+     ((and (!= player nil)
+           (valid-move? move)
+           (legal-move? move player))
+           
+           ; ... play it
+              ; make move on board
+              (make-move move player)
+              ; and on screen
+              (draw-piece move (player-name player))
+              (gs:update)
+              ; do flipping stuff
+              
+              ; wait for a while
+              (sleep 1000)
+  
+              ; then do flipping
+              (dolist (f *flips*)
+                 (flip-piece f player))
+              
+              (inc *move-number*)
+              (draw-piece move (player-name player))
+              (gs:update)
+
+              ; update scores
+              (gs:set-text 'WhiteScore 
+                 (string "White: " (first (count (list white) *board*))))
+              (gs:set-text 'BlackScore
+                 (string "Black: " (first (count (list black) *board*))))
+              )
+     ; or return nil
+     (true 
+           nil)))
+
+; the game is driven by the mouse clicks of the user
+; in reply, the computer plays a black piece
+; premature clicking is possible and possibly a bad thing...
+
+(define (mouse-released-action x y button modifiers tags)
+  ; extract the tag of the clicked square
+  (set 'move (int (string (first tags)) 0 10))
+  (if (do-move move player)
+     (begin
+        (set 'player (next-to-play player))
+        ; there is a training mode - legal squares are highlighted
+        ; you can uncomment the next line...
+        ; (show-legal-moves player)
+        (gs:update)
+        
+        ; wait for black's reply
+        (gs:set-cursor 'Reversi "wait")
+        (gs:set-text 'Start "black's move - thinking...")
+        ; give the illusion of Deep Thought...
+        (sleep 2000)
+        ; black's reply
+        ; currently only the random strategy has been defined...
+        (set 'strategy random-strategy)
+        (set 'move (apply strategy (list player)))
+        (do-move move player)
+        (set 'player (next-to-play player))
+        ; (show-legal-moves player) ; to see black's moves
+        (gs:set-text 'Start "your move")
+        (gs:set-cursor 'Reversi "default")
+        (gs:update))))
+
+(define (start-game)
+  (gs:set-text 'Start "Click a square to place a piece!")
+  (gs:disable 'Start)
+  (set 'player white))
+
+(define (start)
+  (gs:set-text 'Start "Start")
+  (gs:enable 'Start)
+  (set  '*move-number* 1
+        '*flips* '())
+  (initial-board)
+  (draw-board)
+  (draw-first-four-pieces))
+
+(start)
+
+(gs:listen)
\ No newline at end of file
diff --git a/tests/examplefiles/scilab.sci b/tests/examplefiles/scilab.sci
new file mode 100644 (file)
index 0000000..8dea7b9
--- /dev/null
@@ -0,0 +1,30 @@
+// Scilab ( http://www.scilab.org/ )
+// Copyright (C) INRIA - Serge STEER
+// 
+
+function I=sub2ind(dims,varargin)
+//sub2ind is used to determine the equivalent single index
+//corresponding to a given set of subscript values.
+//I = sub2ind(dims,i1,i2,..) returns the linear index equivalent to the
+//row,  column, ... subscripts in the arrays i1,i2,..  for an matrix of
+//size dims.
+//I = sub2ind(dims,Mi) returns the linear index
+//equivalent to the n subscripts in the columns of the matrix Mi for a matrix
+//of size dims.
+  d=[1;cumprod(matrix(dims(1:$-1),-1,1))]
+  for i=1:size(varargin)
+    if varargin(i)==[] then I=[],return,end
+  end
+
+  if size(varargin)==1 then //subindices are the columns of the argument
+    I=(varargin(1)-1)*d+1
+  else //subindices are given as separated arguments
+    I=1
+    for i=1:size(varargin)
+      I=I+(varargin(i)-1)*d(i)
+    end
+  end
+endfunction
index 31e611d69c50aa51b2eb69a7b4f6e42584b23456..833d4fca131013cf8316bc88fd5dc4b9036b9288 100644 (file)
@@ -1,27 +1,30 @@
-# First, a comment block for the deafult conf:
+# Some multiline comments
 
-#  TAG: buffered_logs   on|off
-#       cache.log log file is written with stdio functions, and as such
-#       it can be buffered or unbuffered. By default it will be unbuffered.
-#       Buffering it can speed up the writing slightly (though you are
-#       unlikely to need to worry unless you run with tons of debugging
-#       enabled in which case performance will suffer badly anyway..).
-#
-#Default:
-# buffered_logs off
-
-# Now, a slightly useful (but in no way complete) set of options:
-
-cache_peer upstream1.example.com parent 8080 0 no-query proxy-only round-robin
-cache_peer upstream2.example.com parent 3128 0 no-query proxy-only round-robin
-never_direct allow all
-never_direct allow CONNECT
-
-acl myclients src 127.0.0.1
-http_access allow myclients
-
-acl mynet src 192.168.0.0/255.255.0.0
-no_cache deny mynet
-
-acl mynetlocal dst 192.168.0.0/255.255.0.0
-always_direct allow mynetlocal
+acl manager proto cache_object
+acl localhost src 127.0.0.1/32 ::1
+acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
+acl SSL_ports port 443
+acl Safe_ports port 80         # http
+acl Safe_ports port 21         # ftp
+acl Safe_ports port 443                # https
+acl Safe_ports port 70         # gopher
+acl Safe_ports port 210                # wais
+acl Safe_ports port 1025-65535 # unregistered ports
+acl Safe_ports port 280                # http-mgmt
+acl Safe_ports port 488                # gss-http
+acl Safe_ports port 591                # filemaker
+acl Safe_ports port 777                # multiling http
+acl CONNECT method CONNECT
+http_access allow manager localhost
+http_access deny manager
+http_access deny !Safe_ports
+http_access deny CONNECT !SSL_ports
+http_access allow localhost
+http_access deny all
+http_port 3128
+hierarchy_stoplist cgi-bin ?
+coredump_dir /var/spool/squid3
+refresh_pattern ^ftp:          1440    20%     10080
+refresh_pattern ^gopher:       1440    0%      1440
+refresh_pattern -i (/cgi-bin/|\?) 0    0%      0
+refresh_pattern .              0       20%     4320
diff --git a/tests/examplefiles/test.awk b/tests/examplefiles/test.awk
new file mode 100644 (file)
index 0000000..9f0e3ec
--- /dev/null
@@ -0,0 +1,121 @@
+#!/bin/awk -f
+
+BEGIN {
+  # It is not possible to define output file names here because
+  # FILENAME is not define in the BEGIN section
+  n = "";
+  printf "Generating data files ...";
+  network_max_bandwidth_in_byte = 10000000;
+  network_max_packet_per_second = 1000000;
+  last3 = 0;
+  last4 = 0;
+  last5 = 0;
+  last6 = 0;
+}
+{
+  if ($1 ~ /Average/)
+    { # Skip the Average values
+      n = "";
+      next;
+    }
+
+  if ($2 ~ /all/)
+    { # This is the cpu info
+      print $3 > FILENAME".cpu.user.dat";
+#        print $4 > FILENAME".cpu.nice.dat";
+      print $5 > FILENAME".cpu.system.dat";
+#     print $6 > FILENAME".cpu.iowait.dat";
+      print $7 > FILENAME".cpu.idle.dat";
+      print 100-$7 > FILENAME".cpu.busy.dat";
+    }
+  if ($2 ~ /eth0/)
+    { # This is the eth0 network info
+      if ($3 > network_max_packet_per_second)
+       print last3 > FILENAME".net.rxpck.dat"; # Total number of packets received per second.
+      else
+       {
+         last3 = $3;
+         print $3 > FILENAME".net.rxpck.dat"; # Total number of packets received per second.
+       }
+      if ($4 > network_max_packet_per_second)
+       print last4 > FILENAME".net.txpck.dat"; # Total number of packets transmitted per second.
+      else
+       {
+         last4 = $4;
+         print $4 > FILENAME".net.txpck.dat"; # Total number of packets transmitted per second.
+       }
+      if ($5 > network_max_bandwidth_in_byte)
+       print last5 > FILENAME".net.rxbyt.dat"; # Total number of bytes received per second.
+      else
+       {
+         last5 = $5;
+         print $5 > FILENAME".net.rxbyt.dat"; # Total number of bytes received per second.
+       }
+      if ($6 > network_max_bandwidth_in_byte)
+       print last6 > FILENAME".net.txbyt.dat"; # Total number of bytes transmitted per second.
+      else
+       {
+         last6 = $6;
+         print $6 > FILENAME".net.txbyt.dat"; # Total number of bytes transmitted per second.
+       }
+#     print $7 > FILENAME".net.rxcmp.dat"; # Number of compressed packets received per second (for cslip etc.).
+#     print $8 > FILENAME".net.txcmp.dat"; # Number of compressed packets transmitted per second.
+#     print $9 > FILENAME".net.rxmcst.dat"; # Number of multicast packets received per second.
+    }
+
+  # Detect which is the next info to be parsed
+  if ($2 ~ /proc|cswch|tps|kbmemfree|totsck/)
+    {
+      n = $2;
+    }
+
+  # Only get lines with numbers (real data !)
+  if ($2 ~ /[0-9]/)
+    {
+      if (n == "proc/s")
+       { # This is the proc/s info
+         print $2 > FILENAME".proc.dat";
+#        n = "";
+       }
+      if (n == "cswch/s")
+       { # This is the context switches per second info
+         print $2 > FILENAME".ctxsw.dat";
+#        n = "";
+       }
+      if (n == "tps")
+       { # This is the disk info
+         print $2 > FILENAME".disk.tps.dat"; # total transfers per second
+         print $3 > FILENAME".disk.rtps.dat"; # read requests per second
+         print $4 > FILENAME".disk.wtps.dat"; # write requests per second
+         print $5 > FILENAME".disk.brdps.dat"; # block reads per second
+         print $6 > FILENAME".disk.bwrps.dat"; # block writes per second
+#        n = "";
+       }
+      if (n == "kbmemfree")
+       { # This is the mem info
+         print $2 > FILENAME".mem.kbmemfree.dat"; # Amount of free memory available in kilobytes.
+         print $3 > FILENAME".mem.kbmemused.dat"; # Amount of used memory in kilobytes. This does not take into account memory used by the kernel itself.
+         print $4 > FILENAME".mem.memused.dat"; # Percentage of used memory.
+#         It appears the kbmemshrd has been removed from the sysstat output - ntolia
+#        print $X > FILENAME".mem.kbmemshrd.dat"; # Amount of memory shared by the system in kilobytes.  Always zero with 2.4 kernels.
+#        print $5 > FILENAME".mem.kbbuffers.dat"; # Amount of memory used as buffers by the kernel in kilobytes.
+         print $6 > FILENAME".mem.kbcached.dat"; # Amount of memory used to cache data by the kernel in kilobytes.
+#        print $7 > FILENAME".mem.kbswpfree.dat"; # Amount of free swap space in kilobytes.
+#        print $8 > FILENAME".mem.kbswpused.dat"; # Amount of used swap space in kilobytes.
+         print $9 > FILENAME".mem.swpused.dat"; # Percentage of used swap space.
+#        n = "";
+       }
+      if (n == "totsck")
+       { # This is the socket info
+         print $2 > FILENAME".sock.totsck.dat"; # Total number of used sockets.
+         print $3 > FILENAME".sock.tcpsck.dat"; # Number of TCP sockets currently in use.
+#        print $4 > FILENAME".sock.udpsck.dat"; # Number of UDP sockets currently in use.
+#        print $5 > FILENAME".sock.rawsck.dat"; # Number of RAW sockets currently in use.
+#        print $6 > FILENAME".sock.ip-frag.dat"; # Number of IP fragments currently in use.
+#        n = "";
+       }
+    }
+}
+END {
+  print " '" FILENAME "' done.";
+}
diff --git a/tests/examplefiles/test.bro b/tests/examplefiles/test.bro
new file mode 100644 (file)
index 0000000..9a1b42d
--- /dev/null
@@ -0,0 +1,250 @@
+@load notice
+@load utils/thresholds
+
+module SSH;
+
+export {
+       redef enum Log::ID += { SSH };
+
+       redef enum Notice::Type += {
+               Login,
+               Password_Guessing,
+               Login_By_Password_Guesser,
+               Login_From_Interesting_Hostname,
+               Bytecount_Inconsistency,
+       };
+
+       type Info: record {
+               ts:              time         &log;
+               uid:             string       &log;
+               id:              conn_id      &log;
+               status:          string       &log &optional;
+               direction:       string       &log &optional;
+               remote_location: geo_location &log &optional;
+               client:          string       &log &optional;
+               server:          string       &log &optional;
+               resp_size:       count        &log &default=0;
+               
+               ## Indicate if the SSH session is done being watched.
+               done:            bool         &default=F;
+       };
+
+       const password_guesses_limit = 30 &redef;
+       
+       # The size in bytes at which the SSH connection is presumed to be
+       # successful.
+       const authentication_data_size = 5500 &redef;
+       
+       # The amount of time to remember presumed non-successful logins to build
+       # model of a password guesser.
+       const guessing_timeout = 30 mins &redef;
+
+       # The set of countries for which you'd like to throw notices upon successful login
+       #   requires Bro compiled with libGeoIP support
+       const watched_countries: set[string] = {"RO"} &redef;
+
+       # Strange/bad host names to originate successful SSH logins
+       const interesting_hostnames =
+                       /^d?ns[0-9]*\./ |
+                       /^smtp[0-9]*\./ |
+                       /^mail[0-9]*\./ |
+                       /^pop[0-9]*\./  |
+                       /^imap[0-9]*\./ |
+                       /^www[0-9]*\./  |
+                       /^ftp[0-9]*\./  &redef;
+
+       # This is a table with orig subnet as the key, and subnet as the value.
+       const ignore_guessers: table[subnet] of subnet &redef;
+       
+       # If true, we tell the event engine to not look at further data
+       # packets after the initial SSH handshake. Helps with performance
+       # (especially with large file transfers) but precludes some
+       # kinds of analyses (e.g., tracking connection size).
+       const skip_processing_after_detection = F &redef;
+       
+       # Keeps count of how many rejections a host has had
+       global password_rejections: table[addr] of TrackCount 
+               &write_expire=guessing_timeout
+               &synchronized;
+
+       # Keeps track of hosts identified as guessing passwords
+       # TODO: guessing_timeout doesn't work correctly here.  If a user redefs
+       #       the variable, it won't take effect.
+       global password_guessers: set[addr] &read_expire=guessing_timeout+1hr &synchronized;
+       
+       global log_ssh: event(rec: Info);
+}
+
+# Configure DPD and the packet filter
+redef capture_filters += { ["ssh"] = "tcp port 22" };
+redef dpd_config += { [ANALYZER_SSH] = [$ports = set(22/tcp)] };
+
+redef record connection += {
+       ssh: Info &optional;
+};
+
+event bro_init()
+{
+       Log::create_stream(SSH, [$columns=Info, $ev=log_ssh]);
+}
+
+function set_session(c: connection)
+       {
+       if ( ! c?$ssh )
+               {
+               local info: Info;
+               info$ts=network_time();
+               info$uid=c$uid;
+               info$id=c$id;
+               c$ssh = info;
+               }
+       }
+
+function check_ssh_connection(c: connection, done: bool)
+       {
+       # If done watching this connection, just return.
+       if ( c$ssh$done )
+               return;
+       
+       # If this is still a live connection and the byte count has not
+       # crossed the threshold, just return and let the resheduled check happen later.
+       if ( !done && c$resp$size < authentication_data_size )
+               return;
+
+       # Make sure the server has sent back more than 50 bytes to filter out
+       # hosts that are just port scanning.  Nothing is ever logged if the server
+       # doesn't send back at least 50 bytes.
+       if ( c$resp$size < 50 )
+               return;
+
+       local status = "failure";
+       local direction = Site::is_local_addr(c$id$orig_h) ? "to" : "from";
+       local location: geo_location;
+       location = (direction == "to") ? lookup_location(c$id$resp_h) : lookup_location(c$id$orig_h);
+       
+       if ( done && c$resp$size < authentication_data_size )
+               {
+               # presumed failure
+               if ( c$id$orig_h !in password_rejections )
+                       password_rejections[c$id$orig_h] = new_track_count();
+                       
+               # Track the number of rejections
+               if ( !(c$id$orig_h in ignore_guessers &&
+                      c$id$resp_h in ignore_guessers[c$id$orig_h]) )
+                       ++password_rejections[c$id$orig_h]$n;
+                       
+               if ( default_check_threshold(password_rejections[c$id$orig_h]) )
+                       {
+                       add password_guessers[c$id$orig_h];
+                       NOTICE([$note=Password_Guessing,
+                               $conn=c,
+                               $msg=fmt("SSH password guessing by %s", c$id$orig_h),
+                               $sub=fmt("%d failed logins", password_rejections[c$id$orig_h]$n),
+                               $n=password_rejections[c$id$orig_h]$n]);
+                       }
+               } 
+       # TODO: This is to work around a quasi-bug in Bro which occasionally 
+       #       causes the byte count to be oversized.
+       #   Watch for Gregors work that adds an actual counter of bytes transferred.
+       else if ( c$resp$size < 20000000 ) 
+               { 
+               # presumed successful login
+               status = "success";
+               c$ssh$done = T;
+
+               if ( c$id$orig_h in password_rejections &&
+                    password_rejections[c$id$orig_h]$n > password_guesses_limit &&
+                    c$id$orig_h !in password_guessers )
+                       {
+                       add password_guessers[c$id$orig_h];
+                       NOTICE([$note=Login_By_Password_Guesser,
+                               $conn=c,
+                               $n=password_rejections[c$id$orig_h]$n,
+                               $msg=fmt("Successful SSH login by password guesser %s", c$id$orig_h),
+                               $sub=fmt("%d failed logins", password_rejections[c$id$orig_h]$n)]);
+                       }
+               
+               local message = fmt("SSH login %s %s \"%s\" \"%s\" %f %f %s (triggered with %d bytes)",
+                             direction, location$country_code, location$region, location$city,
+                             location$latitude, location$longitude,
+                             id_string(c$id), c$resp$size);
+               NOTICE([$note=Login,
+                       $conn=c,
+                       $msg=message,
+                       $sub=location$country_code]);
+               
+               # Check to see if this login came from an interesting hostname
+               when ( local hostname = lookup_addr(c$id$orig_h) )
+                       {
+                       if ( interesting_hostnames in hostname )
+                               {
+                               NOTICE([$note=Login_From_Interesting_Hostname,
+                                       $conn=c,
+                                       $msg=fmt("Strange login from %s", hostname),
+                                       $sub=hostname]);
+                               }
+                       }
+                       
+               if ( location$country_code in watched_countries )
+                       {
+                       
+                       }
+                       
+               }
+       else if ( c$resp$size >= 200000000 ) 
+               {
+               NOTICE([$note=Bytecount_Inconsistency,
+                       $conn=c,
+                       $msg="During byte counting in SSH analysis, an overly large value was seen.",
+                       $sub=fmt("%d",c$resp$size)]);
+               }
+
+       c$ssh$remote_location = location;
+       c$ssh$status = status;
+       c$ssh$direction = direction;
+       c$ssh$resp_size = c$resp$size;
+       
+       Log::write(SSH, c$ssh);
+       
+       # Set the "done" flag to prevent the watching event from rescheduling
+       # after detection is done.
+       c$ssh$done;
+       
+       # Stop watching this connection, we don't care about it anymore.
+       if ( skip_processing_after_detection )
+               {
+               skip_further_processing(c$id);
+               set_record_packets(c$id, F);
+               }
+       }
+
+event connection_state_remove(c: connection) &priority=-5
+       {
+       if ( c?$ssh )
+               check_ssh_connection(c, T);
+       }
+
+event ssh_watcher(c: connection)
+       {
+       local id = c$id;
+       # don't go any further if this connection is gone already!
+       if ( !connection_exists(id) )
+               return;
+
+       check_ssh_connection(c, F);
+       if ( ! c$ssh$done )
+               schedule +15secs { ssh_watcher(c) };
+       }
+
+event ssh_server_version(c: connection, version: string) &priority=5
+       {
+       set_session(c);
+       c$ssh$server = version;
+       }
+       
+event ssh_client_version(c: connection, version: string) &priority=5
+       {
+       set_session(c);
+       c$ssh$client = version;
+       schedule +15secs { ssh_watcher(c) };
+       }
index ffa9bfea4b3bd4a76fd45661e4fc3c7eb1c9d162..faab7e4295f5cd95ad856a3c46bd598fd15ca760 100644 (file)
@@ -153,6 +153,29 @@ namespace Diva.Core {
                 public OpenerTask (string fileName)
                 {
                         this.fileName = fileName;
+                        var verbatimString = @"c:\test\";
+
+                        var verbatimStringWithNewline = @"test \\ \n \t \r
+a
+b
+c";
+                        var verbatimStringWithEscapedQuotes = @"He said
+""she says \"" is not an escaped character in verbatimstrings""
+";
+
+                        int[] numbers = { 5,6,4,2,4,6,8,9,7,0 };
+                        var linqExample = from n in numbers
+                                          where n > 5
+                                          select n;
+
+                        var anotherlinqExample = from n in numbers
+                                                 orderby n descending
+                                                 select n;
+
+                        int[] someMoreNumbers = { 8,2,17,34,8,9,9,5,3,4,2,1,5 };
+                        var moreLinq = from n in numbers
+                                       join mn in moreNumbers on n equals mn + 2
+                                       select new {n, mn};
                 }
                 
                 public override void Reset ()
diff --git a/tests/examplefiles/test.dart b/tests/examplefiles/test.dart
new file mode 100644 (file)
index 0000000..aa1fb0e
--- /dev/null
@@ -0,0 +1,23 @@
+// Greeter example from
+// <http://www.dartlang.org/docs/getting-started/interface.html>
+class Greeter implements Comparable {
+  String prefix = 'Hello,';
+  Greeter() {}
+  Greeter.withPrefix(this.prefix);
+  greet(String name) => print('$prefix $name');
+
+  int compareTo(Greeter other) => prefix.compareTo(other.prefix);
+}
+
+void main() {
+  Greeter greeter = new Greeter();
+  Greeter greeter2 = new Greeter.withPrefix('Hi,');
+
+  num result = greeter2.compareTo(greeter);
+  if (result == 0) {
+    greeter2.greet('you are the same.');
+  } else {
+    greeter2.greet('you are different.');
+  }
+}
+
diff --git a/tests/examplefiles/test.dtd b/tests/examplefiles/test.dtd
new file mode 100644 (file)
index 0000000..639b411
--- /dev/null
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
+  <!-- an internal subset can be embedded here -->
+]>
+
+<!DOCTYPE greeting SYSTEM "hello.dtd">
+
+<!DOCTYPE greeting [
+  <!ELEMENT greeting (#PCDATA)>
+
+<!-- examples from XML spec -->
+
+<!ELEMENT br EMPTY>
+<!ELEMENT p (#PCDATA|emph)* >
+<!ELEMENT %name.para; %content.para; >
+<!ELEMENT container ANY>
+
+<!ELEMENT spec (front, body, back?)>
+<!ELEMENT div1 (head, (p | list | note)*, div2*)>
+<!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*>
+
+<!ELEMENT p (#PCDATA|a|ul|b|i|em)*>
+<!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >
+<!ELEMENT b (#PCDATA)>
+
+<!ATTLIST termdef
+          id      ID      #REQUIRED
+          name    CDATA   #IMPLIED>
+<!ATTLIST list
+          type    (bullets|ordered|glossary)  "ordered">
+<!ATTLIST form
+          method  CDATA   #FIXED "POST">
+
+<!ENTITY d "&#xD;">
+<!ENTITY a "&#xA;">
+<!ENTITY da "&#xD;&#xA;">
+
+<!ENTITY % ISOLat2
+         SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" >
+
+<!ENTITY Pub-Status "This is a pre-release of the
+ specification.">
+ <!ENTITY open-hatch
+         SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
+<!ENTITY open-hatch
+         PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN"
+         "http://www.textuality.com/boilerplate/OpenHatch.xml">
+<!ENTITY hatch-pic
+         SYSTEM "../grafix/OpenHatch.gif"
+         NDATA gif >
+         
+<!NOTATION gif PUBLIC "gif viewer">
+
+<!ENTITY % YN '"Yes"' >
+<!ENTITY WhatHeSaid "He said %YN;" >
+
+<!ENTITY EndAttr "27'" >
+
+<!ENTITY % pub    "&#xc9;ditions Gallimard" >
+<!ENTITY   rights "All rights reserved" >
+<!ENTITY   book   "La Peste: Albert Camus,
+&#xA9; 1947 %pub;. &rights;" >
+
+<!ENTITY lt     "&#38;#60;">
+<!ENTITY gt     "&#62;">
+<!ENTITY amp    "&#38;#38;">
+<!ENTITY apos   "&#39;">
+<!ENTITY quot   "&#34;">
+
+<!ENTITY % draft 'INCLUDE' >
+<!ENTITY % final 'IGNORE' >
+
+<![%draft;[
+<!ELEMENT book (comments*, title, body, supplements?)>
+]]>
+<![%final;[
+<!ELEMENT book (title, body, supplements?)>
+]]>
+
+]>
+
+
diff --git a/tests/examplefiles/test.ec b/tests/examplefiles/test.ec
new file mode 100644 (file)
index 0000000..37868b5
--- /dev/null
@@ -0,0 +1,605 @@
+namespace gui;
+
+import "Window"
+
+public struct AnchorValue
+{
+   AnchorValueType type;
+
+   union
+   {
+      int distance;
+      float percent;      
+   };
+   property int
+   {
+      set { distance = value; type = offset; }
+      get { return distance; }
+   }
+   property double
+   {
+      set { percent = (float) value; type = relative; }
+      get { return (double) percent; }
+   }
+
+   char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
+   {
+      if(type == offset)
+      {
+         sprintf(stringOutput, "%d", distance);
+      }
+      else if(type == relative)
+      {
+         int c;
+         int last = 0;
+         sprintf(stringOutput, "%f", percent);
+         c = strlen(stringOutput)-1;
+         for( ; c >= 0; c--)
+         {
+            if(stringOutput[c] != '0') 
+               last = Max(last, c);
+            if(stringOutput[c] == '.')
+            {
+               if(last == c)
+               {
+                  stringOutput[c+1] = '0';
+                  stringOutput[c+2] = 0;
+               }
+               else
+                  stringOutput[last+1] = 0;
+               break;
+            }
+         }
+      }
+      if(needClass) *needClass = false;
+      return stringOutput;
+   }
+
+   bool OnGetDataFromString(char * stringOutput)
+   {
+      char * end;
+      if(strchr(stringOutput, '.'))
+      {
+         float percent = (float)strtod(stringOutput, &end);
+         
+         if(end != stringOutput)
+         {
+            this.percent = percent;
+            type = relative;
+            return true;
+         }
+      }
+      else if(stringOutput[0])
+      {
+         int distance = strtol(stringOutput, &end, 0);
+         if(end != stringOutput)
+         {
+            this.distance = distance;
+            type = offset;
+            return true;
+         }
+      }
+      else
+      {
+         distance = 0;
+         type = 0;
+      }
+      return false;
+   }
+};
+
+public struct MiddleAnchorValue
+{
+   AnchorValueType type;
+
+   union
+   {
+      int distance;
+      float percent;      
+   };
+   property int
+   {
+      set { distance = value; type = none; }
+      get { return distance; }
+   }
+   property double
+   {
+      set { percent = (float) value; type = middleRelative; }
+      get { return (double) percent; }
+   }
+
+   char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
+   {
+      if(type == middleRelative)
+      {
+         int c;
+         int last = 0;
+         sprintf(stringOutput, "%f", percent);
+         c = strlen(stringOutput)-1;
+         for( ; c >= 0; c--)
+         {
+            if(stringOutput[c] != '0') 
+               last = Max(last, c);
+            if(stringOutput[c] == '.')
+            {
+               if(last == c)
+               {
+                  stringOutput[c+1] = '0';
+                  stringOutput[c+2] = 0;
+               }
+               else
+                  stringOutput[last+1] = 0;
+               break;
+            }
+         }
+      }
+      else if(type == none && distance)
+      {
+         sprintf(stringOutput, "%d", distance);
+      }
+      if(needClass) *needClass = false;
+      return stringOutput;
+   }
+
+   bool OnGetDataFromString(char * stringOutput)
+   {
+      if(strchr(stringOutput, '.'))
+      {
+         percent = (float)strtod(stringOutput, null);
+         type = middleRelative;
+      }
+      else
+      {
+         distance = strtol(stringOutput, null, 0);
+         type = none;
+      }
+      return true;
+   }
+};
+
+public enum AnchorValueType { none, offset, relative, middleRelative, cascade, vTiled, hTiled };
+
+public struct Anchor
+{
+   union { AnchorValue left; MiddleAnchorValue horz; };
+   union { AnchorValue top; MiddleAnchorValue vert; };
+   AnchorValue right, bottom;      
+
+   char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
+   {
+      char tempString[256];
+      char * anchorValue;
+      bool subNeedClass;
+
+      tempString[0] = '\0';
+      anchorValue = left.OnGetString(tempString, null, &subNeedClass);
+      if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "left = "); strcat(stringOutput, anchorValue); }
+      
+      //if(((!left.type && !right.type) && horz.distance) || horz.type == middleRelative)
+      if(!right.type && ((!left.type && horz.distance) || horz.type == middleRelative))
+      {
+         tempString[0] = '\0';
+         anchorValue = horz.OnGetString(tempString, null, &subNeedClass);
+         if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "horz = "); strcat(stringOutput, anchorValue); }
+      }
+      
+      tempString[0] = '\0';
+      anchorValue = top.OnGetString(tempString, null, &subNeedClass);
+      if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "top = "); strcat(stringOutput, anchorValue); }
+      
+      tempString[0] = '\0';
+      anchorValue = right.OnGetString(tempString, null, &subNeedClass);
+      if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "right = "); strcat(stringOutput, anchorValue); }
+
+      // if(((!top.type && !bottom.type) && vert.distance) || vert.type == middleRelative)
+      if(!bottom.type && ((!top.type && vert.distance) || vert.type == middleRelative))
+      {
+         tempString[0] = '\0';
+         anchorValue = vert.OnGetString(tempString, null, &subNeedClass);
+         if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "vert = "); strcat(stringOutput, anchorValue); }
+      }
+      
+      tempString[0] = '\0';
+      anchorValue = bottom.OnGetString(tempString, null, &subNeedClass);
+      if(anchorValue[0]) { if(stringOutput[0]) strcat(stringOutput, ", "); strcat(stringOutput, "bottom = "); strcat(stringOutput, anchorValue); }
+      
+      return stringOutput;
+   }
+
+   bool OnGetDataFromString(char * string)
+   {
+      this = Anchor {};
+      return class::OnGetDataFromString(string);
+   }
+
+   bool OnSaveEdit(DropBox dropBox, void * object)
+   {
+      return dropBox.Save();
+   }
+
+   Window OnEdit(Window listBox, Window master, int x, int y, int w, int h, Window control)
+   {
+      char * string = "";
+      AnchorDropBox comboBox
+      {
+         editText = true;
+         parent = listBox;
+         master = master;
+         position = Point { x, y };
+         //clientSize = Size { h = h };
+         //size.w = w;
+         size = { w, h };
+         anchorValue = this;
+         control = control;
+         borderStyle = 0;
+      };
+      
+      comboBox.Create();
+
+      {
+         char tempString[MAX_F_STRING] = "";
+         bool needClass = false;
+         char * result = OnGetString(tempString, null, &needClass);
+         if(result) string = result;
+      }
+      comboBox.contents = string;
+      return comboBox;
+   }
+};
+
+private class AnchorButton : Button
+{
+   toggle = true, bevel = false;
+
+   void OnRedraw(Surface surface)
+   {
+      int cw = clientSize.w;
+      int ch = clientSize.h;
+
+      surface.SetForeground(black);
+      if(checked)
+      {
+         surface.SetBackground(Color { 85,85,85 });
+         surface.Area(0,0, cw-1, ch-1);
+      }
+      else
+         surface.LineStipple(0xAAAA);
+
+      surface.Rectangle(0,0,cw-1,ch-1);
+
+      if(active)
+      {
+         surface.LineStipple(0xAAAA);
+         surface.Rectangle(2,2,cw-3,ch-3);
+      }
+   }
+
+   bool AnchorEditor::NotifyClicked(Button button, int x, int y, Modifiers mods)
+   {
+      AnchorDropBox anchorDropBox = (AnchorDropBox)master;
+      Anchor anchor = anchorDropBox.anchorValue;
+      Window control = anchorDropBox.control;
+      DataBox dropMaster = (DataBox)anchorDropBox.master;
+      int id = button.id;
+
+      switch(id)
+      {
+         case 0: anchor.left.type   = button.checked ? offset : none; break;
+         case 1: anchor.top.type    = button.checked ? offset : none; break;
+         case 2: anchor.right.type  = button.checked ? offset : none; break;
+         case 3: anchor.bottom.type = button.checked ? offset : none; break;
+      }
+
+      if(anchor.horz.type == middleRelative && (id == 0 || id == 2))
+      {
+         anchorDropBox.relButtons[0].checked = false;
+         anchorDropBox.relButtons[2].checked = false;
+      }
+      if(anchor.vert.type == middleRelative && (id == 1 || id == 3))
+      {
+         anchorDropBox.relButtons[1].checked = false;
+         anchorDropBox.relButtons[3].checked = false;
+      }
+      anchorDropBox.relButtons[id].checked = false;
+
+      //anchor.horz.type = none;
+      //anchor.vert.type = none;
+
+      {
+         int vpw, vph;
+         int x,y,w,h;
+         Window parent = control.parent;
+
+         // Fix Anchor
+         x = control.position.x;
+         y = control.position.y;
+         w = control.size.w;
+         h = control.size.h;
+
+         vpw = parent.clientSize.w;
+         vph = parent.clientSize.h;
+         if(control.nonClient)
+         {
+            vpw = parent.size.w;
+            vph = parent.size.h;
+         }
+         else if(((BorderBits)control.borderStyle).fixed)
+         {
+            if(!control.dontScrollHorz && parent.scrollArea.w) vpw = parent.scrollArea.w;
+            if(!control.dontScrollVert && parent.scrollArea.h) vph = parent.scrollArea.h;
+         }
+
+         if(anchor.left.type == offset) anchor.left.distance = x;
+         else if(anchor.left.type == relative) anchor.left.percent = (float)x / vpw;
+         if(anchor.top.type == offset) anchor.top.distance = y;
+         else if(anchor.top.type == relative) anchor.top.percent = (float)y / vph;
+         if(anchor.right.type == offset) anchor.right.distance = vpw - (x + w);
+         //else if(anchor.right.type == relative) anchor.right.percent = (float) (x + w) / vpw;
+         else if(anchor.right.type == relative) anchor.right.percent = (float) (vpw - (x + w)) / vpw;
+         if(anchor.bottom.type == offset) anchor.bottom.distance = vph - (y + h);
+         //else if(anchor.bottom.type == relative) anchor.bottom.percent = (float) (y + h) / vph;
+         else if(anchor.bottom.type == relative) anchor.bottom.percent = (float) (vph - (y + h)) / vph;
+
+         if(!anchor.left.type && !anchor.right.type)
+         {
+            anchor.horz.distance = (x + w / 2) - (vpw / 2);
+            //anchor.horz.type = anchor.horz.distance ? offset : 0;
+         }
+         else if(anchor.horz.type == middleRelative) anchor.horz.percent = (float) ((x + w / 2) - (vpw / 2)) / vpw;
+         if(!anchor.top.type && !anchor.bottom.type)
+         {
+            anchor.vert.distance = (y + h / 2) - (vph / 2);
+            //anchor.vert.type = anchor.vert.distance ? offset : 0;
+         }
+         else if(anchor.vert.type == middleRelative) anchor.vert.percent = (float)((y + h / 2) - (vph / 2)) / vph;
+      }
+
+      {
+         char tempString[1024] = "";
+         bool needClass = false;
+         char * string = anchor.OnGetString(tempString, null, &needClass);
+         anchorDropBox.contents = string;
+      }
+
+      dropMaster.SetData(&anchor, false);
+      anchorDropBox.anchorValue = anchor;
+      return true;
+   }
+}
+
+private class AnchorRelButton : Button
+{
+   toggle = true;
+   bevel = false;
+   text = "%";
+   //bevelOver = true;
+
+   void OnRedraw(Surface surface)
+   {
+      int cw = clientSize.w;
+      int ch = clientSize.h;
+      
+      if(checked)
+      {
+         surface.SetForeground(black);
+      }
+      else
+      {
+         surface.SetForeground(Color{170,170,170});
+      }
+      surface.WriteText(5,2, "%", 1);
+
+      if(active)
+      {
+         surface.LineStipple(0xAAAA);
+         surface.Rectangle(3,3,cw-4,ch-4);
+      }
+   }
+
+   bool AnchorEditor::NotifyClicked(Button button, int x, int y, Modifiers mods)
+   {
+      AnchorDropBox anchorDropBox = (AnchorDropBox)master;
+      Anchor anchor = anchorDropBox.anchorValue;
+      Window control = anchorDropBox.control;
+      DataBox dropMaster = (DataBox)anchorDropBox.master;
+      int id = button.id;
+
+      if((id == 0 || id == 2) && ((!anchor.left.type && !anchor.right.type) || anchor.left.type == middleRelative))
+      {
+         if(button.checked) anchor.horz.type = middleRelative; else anchor.horz.type = none;
+         anchorDropBox.relButtons[(id + 2)%4].checked = button.checked;
+      }
+      else if((id == 1 || id == 3) && ((!anchor.top.type && !anchor.bottom.type) || anchor.top.type == middleRelative))
+      {
+         if(button.checked) anchor.vert.type = middleRelative; else anchor.vert.type = none;
+         anchorDropBox.relButtons[(id + 2)%4].checked = button.checked;
+      }
+      else
+      {
+         switch(id)
+         {
+            case 0: anchor.left.type   = button.checked ? relative : (anchor.left.type   ? offset : none); break;
+            case 1: anchor.top.type    = button.checked ? relative : (anchor.top.type    ? offset : none); break;
+            case 2: anchor.right.type  = button.checked ? relative : (anchor.right.type  ? offset : none); break;
+            case 3: anchor.bottom.type = button.checked ? relative : (anchor.bottom.type ? offset : none); break;
+         }
+         anchorDropBox.buttons[id].checked = true;
+         if(anchor.horz.type == middleRelative) anchor.horz.type = none;
+         if(anchor.vert.type == middleRelative) anchor.vert.type = none;
+      }
+
+      {
+         int vpw, vph;
+         int x,y,w,h;
+         Window parent = control.parent;
+
+         // Fix Anchor
+         x = control.position.x;
+         y = control.position.y;
+         w = control.size.w;
+         h = control.size.h;
+
+         vpw = parent.clientSize.w;
+         vph = parent.clientSize.h;
+         if(control.nonClient)
+         {
+            vpw = parent.size.w;
+            vph = parent.size.h;
+         }
+         else if(((BorderBits)control.borderStyle).fixed)
+         {
+            if(!control.dontScrollHorz && parent.scrollArea.w)  vpw = parent.scrollArea.w;
+            if(!control.dontScrollVert && parent.scrollArea.h) vph = parent.scrollArea.h;
+         }
+
+         if(anchor.left.type == offset) anchor.left.distance = x;
+         else if(anchor.left.type == relative) anchor.left.percent = (float)x / vpw;
+         if(anchor.top.type == offset) anchor.top.distance = y;
+         else if(anchor.top.type == relative) anchor.top.percent = (float)y / vph;
+         if(anchor.right.type == offset) anchor.right.distance = vpw - (x + w);
+         //else if(anchor.right.type == relative) anchor.right.percent = (float) (x + w) / vpw;
+         else if(anchor.right.type == relative) anchor.right.percent = (float) (vpw - (x + w)) / vpw;
+         if(anchor.bottom.type == offset) anchor.bottom.distance = vph - (y + h);
+         //else if(anchor.bottom.type == relative) anchor.bottom.percent = (float) (y + h) / vph;
+         else if(anchor.bottom.type == relative) anchor.bottom.percent = (float) (vph - (y + h)) / vph;
+
+         if(!anchor.left.type && !anchor.right.type)
+         {
+            anchor.horz.distance = (x + w / 2) - (vpw / 2);
+            //anchor.horz.type = anchor.horz.distance ? offset : none;
+         }
+         else if(anchor.horz.type == middleRelative) anchor.horz.percent = (float) ((x + w / 2) - (vpw / 2)) / vpw;
+         if(!anchor.top.type && !anchor.bottom.type) 
+         {
+            anchor.vert.distance = (y + h / 2) - (vph / 2);
+            //anchor.vert.type = anchor.vert.distance ? offset : none;
+         }
+         else if(anchor.vert.type == middleRelative) anchor.vert.percent = (float)((y + h / 2) - (vph / 2)) / vph;
+      }
+
+      {
+         char tempString[1024] = "";
+         bool needClass = false;
+         char * string = anchor.OnGetString(tempString, null, &needClass);
+         anchorDropBox.contents = string;
+      }
+
+      dropMaster.SetData(&anchor, false);
+      anchorDropBox.anchorValue = anchor;
+      return true;
+   }
+}
+
+private class AnchorEditor : Window
+{
+   interim = true;
+   borderStyle = deepContour;
+   size.h = 92;
+
+   bool OnKeyDown(Key key, unichar ch)
+   {
+      if(key == escape)
+         return master.OnKeyDown(key, ch);
+      return true;
+   }
+}
+
+private class AnchorDropBox : DropBox
+{
+   Anchor anchorValue;
+   Window control;
+   Button relButtons[4], buttons[4];
+
+   AnchorEditor anchorEditor
+   {
+      master = this;
+      autoCreate = false;
+   };
+
+   Window OnDropDown()
+   {
+      int c;
+      Button
+      {
+         anchorEditor,
+         anchor = Anchor { left = 28, top = 28, right = 28, bottom = 28 },
+         inactive = true, disabled = true
+      };
+      for(c = 0; c<4; c++)
+      {
+         Button button = buttons[c] = AnchorButton 
+         { 
+            anchorEditor, id = c,
+            size = Size { (c%2)?10:28, (c%2)?28:10 }
+         };
+         Button relButton = relButtons[c] = AnchorRelButton
+         {
+            anchorEditor, id = c;
+         };
+
+         switch(c)
+         {
+            case 0:
+               if(anchorValue.left.type && anchorValue.left.type != middleRelative) button.checked = true;
+               if(anchorValue.left.type == relative || anchorValue.horz.type == middleRelative) relButton.checked = true;
+               
+               button.anchor = Anchor { left = 0 };
+               relButton.anchor = Anchor { left = 5, vert = 16 };
+               break;
+            case 1:
+               if(anchorValue.top.type && anchorValue.top.type != middleRelative) button.checked = true;
+               if(anchorValue.top.type == relative || anchorValue.vert.type == middleRelative) relButton.checked = true;
+
+               button.anchor = Anchor { top = 0 };
+               relButton.anchor = Anchor { top = 5, horz = 16 };
+               break;
+            case 2: 
+               if(anchorValue.right.type && anchorValue.right.type != middleRelative) button.checked = true;
+               if(anchorValue.right.type == relative || anchorValue.horz.type == middleRelative) relButton.checked = true;
+               
+               button.anchor = Anchor { right = 0 };
+               relButton.anchor = Anchor { right = 5, vert = 16 };
+               break;
+            case 3: 
+               if(anchorValue.bottom.type && anchorValue.bottom.type != middleRelative) button.checked = true;
+               if(anchorValue.bottom.type == relative || anchorValue.vert.type == middleRelative) relButton.checked = true;
+
+               button.anchor = Anchor { bottom = 0 };
+               relButton.anchor = Anchor { bottom = 5, horz = 16 };
+               break;
+         }
+      }
+      anchorEditor.Create();
+      return anchorEditor;
+   }
+      
+   void OnCloseDropDown(Window anchorEditor)
+   {
+      // TOFIX: Patch for update bug
+      master.Update(null);
+      anchorEditor.Destroy(0);
+   }
+
+   bool DataBox::NotifyTextEntry(AnchorDropBox dropBox, char * string, bool save)
+   {
+      Anchor anchor = dropBox.anchorValue;
+      Window control = dropBox.control;
+
+      if(save)
+      {
+         if(anchor.OnGetDataFromString(string))
+         {
+            SetData(&anchor, false);
+            dropBox.anchorValue = anchor;
+         }
+      }
+      else
+      {
+         char tempString[1024] = "";
+         bool needClass = false;
+         char * string = anchor.OnGetString(tempString, null, &needClass);
+         dropBox.contents = string;
+      }
+      return true;
+   }
+}
diff --git a/tests/examplefiles/test.ecl b/tests/examplefiles/test.ecl
new file mode 100644 (file)
index 0000000..b686492
--- /dev/null
@@ -0,0 +1,58 @@
+/*##############################################################################
+
+    Copyright (C) 2011 HPCC Systems.
+
+    All rights reserved. This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as
+    published by the Free Software Foundation, either version 3 of the
+    License, or (at your option) any later version.
+
+    This program 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 Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+############################################################################## */
+
+#option ('slidingJoins', true);
+
+namesRecord :=
+            RECORD
+string20        surname;
+string10        forename;
+integer2        age;
+integer2        dadAge;
+integer2        mumAge;
+            END;
+
+namesRecord2 :=
+            record
+string10        extra;
+namesRecord;
+            end;
+
+namesTable := dataset('x',namesRecord,FLAT);
+namesTable2 := dataset('y',namesRecord2,FLAT);
+
+integer2 aveAgeL(namesRecord l) := (l.dadAge+l.mumAge)/2;
+integer2 aveAgeR(namesRecord2 r) := (r.dadAge+r.mumAge)/2;
+
+// Standard join on a function of left and right
+output(join(namesTable, namesTable2, aveAgeL(left) = aveAgeR(right)));
+
+//Several simple examples of sliding join syntax
+output(join(namesTable, namesTable2, left.age >= right.age - 10 and left.age <= right.age +10));
+output(join(namesTable, namesTable2, left.age between right.age - 10 and right.age +10));
+output(join(namesTable, namesTable2, left.age between right.age + 10 and right.age +30));
+output(join(namesTable, namesTable2, left.age between (right.age + 20) - 10 and (right.age +20) + 10));
+output(join(namesTable, namesTable2, aveAgeL(left) between aveAgeR(right)+10 and aveAgeR(right)+40));
+
+//Same, but on strings.  Also includes age to ensure sort is done by non-sliding before sliding.
+output(join(namesTable, namesTable2, left.surname between right.surname[1..10]+'AAAAAAAAAA' and right.surname[1..10]+'ZZZZZZZZZZ' and left.age=right.age));
+output(join(namesTable, namesTable2, left.surname between right.surname[1..10]+'AAAAAAAAAA' and right.surname[1..10]+'ZZZZZZZZZZ' and left.age=right.age,all));
+
+//This should not generate a self join
+output(join(namesTable, namesTable, left.age between right.age - 10 and right.age +10));
+
diff --git a/tests/examplefiles/test.eh b/tests/examplefiles/test.eh
new file mode 100644 (file)
index 0000000..1ed173f
--- /dev/null
@@ -0,0 +1,315 @@
+/* A Bison parser, made by GNU Bison 2.0.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     IDENTIFIER = 258,
+     CONSTANT = 259,
+     STRING_LITERAL = 260,
+     SIZEOF = 261,
+     PTR_OP = 262,
+     INC_OP = 263,
+     DEC_OP = 264,
+     LEFT_OP = 265,
+     RIGHT_OP = 266,
+     LE_OP = 267,
+     GE_OP = 268,
+     EQ_OP = 269,
+     NE_OP = 270,
+     AND_OP = 271,
+     OR_OP = 272,
+     MUL_ASSIGN = 273,
+     DIV_ASSIGN = 274,
+     MOD_ASSIGN = 275,
+     ADD_ASSIGN = 276,
+     SUB_ASSIGN = 277,
+     LEFT_ASSIGN = 278,
+     RIGHT_ASSIGN = 279,
+     AND_ASSIGN = 280,
+     XOR_ASSIGN = 281,
+     OR_ASSIGN = 282,
+     TYPE_NAME = 283,
+     TYPEDEF = 284,
+     EXTERN = 285,
+     STATIC = 286,
+     AUTO = 287,
+     REGISTER = 288,
+     CHAR = 289,
+     SHORT = 290,
+     INT = 291,
+     UINT = 292,
+     INT64 = 293,
+     LONG = 294,
+     SIGNED = 295,
+     UNSIGNED = 296,
+     FLOAT = 297,
+     DOUBLE = 298,
+     CONST = 299,
+     VOLATILE = 300,
+     VOID = 301,
+     VALIST = 302,
+     STRUCT = 303,
+     UNION = 304,
+     ENUM = 305,
+     ELLIPSIS = 306,
+     CASE = 307,
+     DEFAULT = 308,
+     IF = 309,
+     SWITCH = 310,
+     WHILE = 311,
+     DO = 312,
+     FOR = 313,
+     GOTO = 314,
+     CONTINUE = 315,
+     BREAK = 316,
+     RETURN = 317,
+     IFX = 318,
+     ELSE = 319,
+     CLASS = 320,
+     THISCLASS = 321,
+     CLASS_NAME = 322,
+     PROPERTY = 323,
+     SETPROP = 324,
+     GETPROP = 325,
+     NEWOP = 326,
+     RENEW = 327,
+     DELETE = 328,
+     EXT_DECL = 329,
+     EXT_STORAGE = 330,
+     IMPORT = 331,
+     DEFINE = 332,
+     VIRTUAL = 333,
+     EXT_ATTRIB = 334,
+     PUBLIC = 335,
+     PRIVATE = 336,
+     TYPED_OBJECT = 337,
+     ANY_OBJECT = 338,
+     _INCREF = 339,
+     EXTENSION = 340,
+     ASM = 341,
+     TYPEOF = 342,
+     WATCH = 343,
+     STOPWATCHING = 344,
+     FIREWATCHERS = 345,
+     WATCHABLE = 346,
+     CLASS_DESIGNER = 347,
+     CLASS_NO_EXPANSION = 348,
+     CLASS_FIXED = 349,
+     ISPROPSET = 350,
+     CLASS_DEFAULT_PROPERTY = 351,
+     PROPERTY_CATEGORY = 352,
+     CLASS_DATA = 353,
+     CLASS_PROPERTY = 354,
+     SUBCLASS = 355,
+     NAMESPACE = 356,
+     NEW0OP = 357,
+     RENEW0 = 358,
+     VAARG = 359,
+     DBTABLE = 360,
+     DBFIELD = 361,
+     DBINDEX = 362,
+     DATABASE_OPEN = 363
+   };
+#endif
+#define IDENTIFIER 258
+#define CONSTANT 259
+#define STRING_LITERAL 260
+#define SIZEOF 261
+#define PTR_OP 262
+#define INC_OP 263
+#define DEC_OP 264
+#define LEFT_OP 265
+#define RIGHT_OP 266
+#define LE_OP 267
+#define GE_OP 268
+#define EQ_OP 269
+#define NE_OP 270
+#define AND_OP 271
+#define OR_OP 272
+#define MUL_ASSIGN 273
+#define DIV_ASSIGN 274
+#define MOD_ASSIGN 275
+#define ADD_ASSIGN 276
+#define SUB_ASSIGN 277
+#define LEFT_ASSIGN 278
+#define RIGHT_ASSIGN 279
+#define AND_ASSIGN 280
+#define XOR_ASSIGN 281
+#define OR_ASSIGN 282
+#define TYPE_NAME 283
+#define TYPEDEF 284
+#define EXTERN 285
+#define STATIC 286
+#define AUTO 287
+#define REGISTER 288
+#define CHAR 289
+#define SHORT 290
+#define INT 291
+#define UINT 292
+#define INT64 293
+#define LONG 294
+#define SIGNED 295
+#define UNSIGNED 296
+#define FLOAT 297
+#define DOUBLE 298
+#define CONST 299
+#define VOLATILE 300
+#define VOID 301
+#define VALIST 302
+#define STRUCT 303
+#define UNION 304
+#define ENUM 305
+#define ELLIPSIS 306
+#define CASE 307
+#define DEFAULT 308
+#define IF 309
+#define SWITCH 310
+#define WHILE 311
+#define DO 312
+#define FOR 313
+#define GOTO 314
+#define CONTINUE 315
+#define BREAK 316
+#define RETURN 317
+#define IFX 318
+#define ELSE 319
+#define CLASS 320
+#define THISCLASS 321
+#define CLASS_NAME 322
+#define PROPERTY 323
+#define SETPROP 324
+#define GETPROP 325
+#define NEWOP 326
+#define RENEW 327
+#define DELETE 328
+#define EXT_DECL 329
+#define EXT_STORAGE 330
+#define IMPORT 331
+#define DEFINE 332
+#define VIRTUAL 333
+#define EXT_ATTRIB 334
+#define PUBLIC 335
+#define PRIVATE 336
+#define TYPED_OBJECT 337
+#define ANY_OBJECT 338
+#define _INCREF 339
+#define EXTENSION 340
+#define ASM 341
+#define TYPEOF 342
+#define WATCH 343
+#define STOPWATCHING 344
+#define FIREWATCHERS 345
+#define WATCHABLE 346
+#define CLASS_DESIGNER 347
+#define CLASS_NO_EXPANSION 348
+#define CLASS_FIXED 349
+#define ISPROPSET 350
+#define CLASS_DEFAULT_PROPERTY 351
+#define PROPERTY_CATEGORY 352
+#define CLASS_DATA 353
+#define CLASS_PROPERTY 354
+#define SUBCLASS 355
+#define NAMESPACE 356
+#define NEW0OP 357
+#define RENEW0 358
+#define VAARG 359
+#define DBTABLE 360
+#define DBFIELD 361
+#define DBINDEX 362
+#define DATABASE_OPEN 363
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 42 "grammar.y"
+typedef union YYSTYPE {
+   SpecifierType specifierType;
+   int i;
+   AccessMode declMode;
+   Identifier id;
+   Expression exp;
+   Specifier specifier;
+   OldList * list;
+   Enumerator enumerator;
+   Declarator declarator;
+   Pointer pointer;
+   Initializer initializer;
+   InitDeclarator initDeclarator;
+   TypeName typeName;
+   Declaration declaration;
+   Statement stmt;
+   FunctionDefinition function;
+   External external;
+   Context context;
+   AsmField asmField;
+
+   Instantiation instance;
+   MembersInit membersInit;
+   MemberInit memberInit;
+   ClassFunction classFunction;
+   ClassDefinition _class;
+   ClassDef classDef;
+   PropertyDef prop;
+   char * string;
+   Symbol symbol;
+   PropertyWatch propertyWatch;
+   TemplateParameter templateParameter;
+   TemplateArgument templateArgument;
+   TemplateDatatype templateDatatype;
+   
+   DBTableEntry dbtableEntry;
+   DBIndexItem dbindexItem;
+   DBTableDef dbtableDef;
+} YYSTYPE;
+/* Line 1318 of yacc.c.  */
+#line 293 "grammar.eh"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE yylval;
+
+#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
+typedef struct YYLTYPE
+{
+  int first_line;
+  int first_column;
+  int last_line;
+  int last_column;
+} YYLTYPE;
+# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+# define YYLTYPE_IS_DECLARED 1
+# define YYLTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYLTYPE yylloc;
+
+
diff --git a/tests/examplefiles/test.fan b/tests/examplefiles/test.fan
new file mode 100755 (executable)
index 0000000..00e80b6
--- /dev/null
@@ -0,0 +1,818 @@
+//
+// Copyright (c) 2008, Brian Frank and Andy Frank
+// Licensed under the Academic Free License version 3.0
+//
+// History:
+//   17 Nov 08  Brian Frank  Creation
+//
+
+using compiler
+
+**
+** JavaBridge is the compiler plugin for bringing Java
+** classes into the Fantom type system.
+**
+class JavaBridge : CBridge
+{
+
+//////////////////////////////////////////////////////////////////////////
+// Constructor
+//////////////////////////////////////////////////////////////////////////
+
+  **
+  ** Construct a JavaBridge for current environment
+  **
+  new make(Compiler c, ClassPath cp := ClassPath.makeForCurrent)
+    : super(c)
+  {
+    this.cp = cp
+  }
+
+//////////////////////////////////////////////////////////////////////////
+// Namespace
+//////////////////////////////////////////////////////////////////////////
+
+  **
+  ** Map a FFI "podName" to a Java package.
+  **
+  override CPod resolvePod(Str name, Loc? loc)
+  {
+    // the empty package is used to represent primitives
+    if (name == "") return primitives
+
+    // look for package name in classpatch
+    classes := cp.classes[name]
+    if (classes == null)
+      throw CompilerErr("Java package '$name' not found", loc)
+
+    // map package to JavaPod
+    return JavaPod(this, name, classes)
+  }
+
+  **
+  ** Map class meta-data and Java members to Fantom slots
+  ** for the specified JavaType.
+  **
+  virtual Void loadType(JavaType type, Str:CSlot slots)
+  {
+    JavaReflect.loadType(type, slots)
+  }
+
+//////////////////////////////////////////////////////////////////////////
+// Call Resolution
+//////////////////////////////////////////////////////////////////////////
+
+  **
+  ** Resolve a construction call to a Java constructor.
+  **
+  override Expr resolveConstruction(CallExpr call)
+  {
+    // if the last argument is an it-block, then we know
+    // right away that we will not be passing it thru to Java,
+    // so strip it off to be appended as call to Obj.with
+    itBlock := call.args.last as ClosureExpr
+    if (itBlock != null && itBlock.isItBlock)
+      call.args.removeAt(-1)
+    else
+      itBlock = null
+
+    // if this is an interop array like IntArray/int[] use make
+    // factory otherwise look for Java constructor called <init>
+    JavaType base := call.target.ctype
+    if (base.isInteropArray)
+      call.method = base.method("make")
+    else
+      call.method = base.method("<init>")
+
+    // call resolution to deal with overloading
+    call = resolveCall(call)
+
+    // we need to create an implicit target for the Java runtime
+    // to perform the new opcode to ensure it is on the stack
+    // before the args (we don't do this for interop Array classes)
+    if (!base.isInteropArray)
+    {
+      loc := call.loc
+      call.target = CallExpr.makeWithMethod(loc, null, base.newMethod) { synthetic=true }
+    }
+
+    // if we stripped an it-block argument,
+    // add it as trailing call to Obj.with
+    if (itBlock != null) return itBlock.toWith(call)
+    return call
+  }
+
+  **
+  ** Resolve a construction chain call where a Fantom constructor
+  ** calls the super-class constructor.  Type check the arguments
+  ** and insert any conversions needed.
+  **
+  override Expr resolveConstructorChain(CallExpr call)
+  {
+    // we don't allow chaining to a this ctor for Java FFI
+    if (call.target.id !== ExprId.superExpr)
+      throw err("Must use super constructor call in Java FFI", call.loc)
+
+    // route to a superclass constructor
+    JavaType base := call.target.ctype.deref
+    call.method = base.method("<init>")
+
+    // call resolution to deal with overloading
+    return resolveCall(call)
+  }
+
+  **
+  ** Given a dot operator slot access on the given foreign
+  ** base type, determine the appopriate slot to use based on
+  ** whether parens were used
+  **   base.name    =>  noParens = true
+  **   base.name()  =>  noParens = false
+  **
+  ** In Java a given name could be bound to both a field and
+  ** a method.  In this case we only resolve the field if
+  ** no parens are used.  We also handle the special case of
+  ** Java annotations here because their element methods are
+  ** also mapped as Fantom fields (instance based mixin field).
+  **
+  override CSlot? resolveSlotAccess(CType base, Str name, Bool noParens)
+  {
+    // first try to resolve as a field
+    field := base.field(name)
+    if (field != null)
+    {
+      // if no () we used and this isn't an annotation field
+      if (noParens && (field.isStatic || !base.isMixin))
+        return field
+
+      // if we did find a field, then make sure we use that
+      // field's parent type to resolve a method (becuase the
+      // base type might be a sub-class of a Java type in which
+      // case it is unware of field/method overloads)
+      return field.parent.method(name)
+    }
+
+    // lookup method
+    return base.method(name)
+  }
+
+  **
+  ** Resolve a method call: try to find the best match
+  ** and apply any coercions needed.
+  **
+  override CallExpr resolveCall(CallExpr call)
+  {
+    // try to match against all the overloaded methods
+    matches := CallMatch[,]
+    CMethod? m := call.method
+    while (m != null)
+    {
+      match := matchCall(call, m)
+      if (match != null) matches.add(match)
+      m = m is JavaMethod ? ((JavaMethod)m).next : null
+    }
+
+    // if we have exactly one match use then use that one
+    if (matches.size == 1) return matches[0].apply(call)
+
+    // if we have multiple matches; resolve to
+    // most specific match according to JLS rules
+    // TODO: this does not correct resolve when using Fantom implicit casting
+    if (matches.size > 1)
+    {
+      best := resolveMostSpecific(matches)
+      if (best != null) return best.apply(call)
+    }
+
+    // zero or multiple ambiguous matches is a compiler error
+    s := StrBuf()
+    s.add(matches.isEmpty ? "Invalid args " : "Ambiguous call ")
+    s.add(call.name).add("(")
+    s.add(call.args.join(", ") |Expr arg->Str| { return arg.toTypeStr })
+    s.add(")")
+    throw err(s.toStr, call.loc)
+  }
+
+  **
+  ** Check if the call matches the specified overload method.
+  ** If so return method and coerced args otherwise return null.
+  **
+  internal CallMatch? matchCall(CallExpr call, CMethod m)
+  {
+    // first check if have matching numbers of args and params
+    args := call.args
+    if (m.params.size < args.size) return null
+
+    // check if each argument is ok or can be coerced
+    isErr := false
+    newArgs := args.dup
+    m.params.each |CParam p, Int i|
+    {
+      if (i >= args.size)
+      {
+        // param has a default value, then that is ok
+        if (!p.hasDefault) isErr = true
+      }
+      else
+      {
+        // ensure arg fits parameter type (or auto-cast)
+        newArgs[i] = coerce(args[i], p.paramType) |->| { isErr = true }
+      }
+    }
+    if (isErr) return null
+    return CallMatch { it.method = m; it.args = newArgs }
+  }
+
+  **
+  ** Given a list of overloaed methods find the most specific method
+  ** according to Java Language Specification 15.11.2.2.  The "informal
+  ** intuition" rule is that a method is more specific than another
+  ** if the first could be could be passed onto the second one.
+  **
+  internal static CallMatch? resolveMostSpecific(CallMatch[] matches)
+  {
+    CallMatch? best := matches[0]
+    for (i:=1; i<matches.size; ++i)
+    {
+      x := matches[i]
+      if (isMoreSpecific(best, x)) { continue }
+      if (isMoreSpecific(x, best)) { best = x; continue }
+      return null
+    }
+    return best
+  }
+
+  **
+  ** Is 'a' more specific than 'b' such that 'a' could be used
+  ** passed to 'b' without a compile time error.
+  **
+  internal static Bool isMoreSpecific(CallMatch a, CallMatch b)
+  {
+    return a.method.params.all |CParam ap, Int i->Bool|
+    {
+      bp := b.method.params[i]
+      return ap.paramType.fits(bp.paramType)
+    }
+  }
+
+//////////////////////////////////////////////////////////////////////////
+// Overrides
+//////////////////////////////////////////////////////////////////////////
+
+  **
+  ** Called during Inherit step when a Fantom slot overrides a FFI slot.
+  ** Log and throw compiler error if there is a problem.
+  **
+  override Void checkOverride(TypeDef t, CSlot base, SlotDef def)
+  {
+    // we don't allow Fantom to override Java methods with multiple
+    // overloaded versions since the Fantom type system can't actually
+    // override all the overloaded versions
+    jslot := base as JavaSlot
+    if (jslot?.next != null)
+      throw err("Cannot override Java overloaded method: '$jslot.name'", def.loc)
+
+    // route to method override checking
+    if (base is JavaMethod && def is MethodDef)
+      checkMethodOverride(t, base, def)
+  }
+
+  **
+  ** Called on method/method overrides in the checkOverride callback.
+  **
+  private Void checkMethodOverride(TypeDef t, JavaMethod base, MethodDef def)
+  {
+    // bail early if we know things aren't going to work out
+    if (base.params.size != def.params.size) return
+
+    // if the return type is primitive or Java array and the
+    // Fantom declaration matches how it is inferred into the Fan
+    // type system, then just change the return type - the compiler
+    // will impliclty do all the return coercions
+    if (isOverrideInferredType(base.returnType, def.returnType))
+    {
+      def.ret = def.inheritedRet = base.returnType
+    }
+
+    // if any of the parameters is a primitive or Java array
+    // and the Fantom declaration matches how it is inferred into
+    // the Fantom type type, then change the parameter type to
+    // the Java override type and make the Fantom type a local
+    // variable:
+    //   Java:   void foo(int a) { ... }
+    //   Fantom: Void foo(Int a) { ... }
+    //   Result: Void foo(int a_$J) { Int a := a_$J; ... }
+    //
+    base.params.eachr |CParam bp, Int i|
+    {
+      dp := def.paramDefs[i]
+      if (!isOverrideInferredType(bp.paramType, dp.paramType)) return
+
+      // add local variable: Int bar := bar_$J
+      local := LocalDefStmt(def.loc)
+      local.ctype = dp.paramType
+      local.name  = dp.name
+      local.init  = UnknownVarExpr(def.loc, null, dp.name + "_\$J")
+      def.code.stmts.insert(0, local)
+
+      // rename parameter Int bar -> int bar_$J
+      dp.name = dp.name + "_\$J"
+      dp.paramType = bp.paramType
+    }
+  }
+
+  **
+  ** When overriding a Java method check if the base type is
+  ** is a Java primitive or array and the override definition is
+  ** matches how the Java type is inferred in the Fantom type system.
+  ** If we have a match return true and we'll swizzle things in
+  ** checkMethodOverride.
+  **
+  static private Bool isOverrideInferredType(CType base, CType def)
+  {
+    // check if base class slot is a JavaType
+    java := base.toNonNullable as JavaType
+    if (java != null)
+    {
+      // allow primitives is it matches the inferred type
+      if (java.isPrimitive) return java.inferredAs == def
+
+      // allow arrays if mapped as Foo[] -> Foo?[]?
+      if (java.isArray) return java.inferredAs == def.toNonNullable && def.isNullable
+    }
+    return false
+  }
+
+//////////////////////////////////////////////////////////////////////////
+// CheckErrors
+//////////////////////////////////////////////////////////////////////////
+
+  **
+  ** Called during CheckErrors step for a type which extends
+  ** a FFI class or implements any FFI mixins.
+  **
+  override Void checkType(TypeDef def)
+  {
+    // can't subclass a primitive array like ByteArray/byte[]
+    if (def.base.deref is JavaType && def.base.deref->isInteropArray)
+    {
+      err("Cannot subclass from Java interop array: $def.base", def.loc)
+      return
+    }
+
+    // we don't allow deep inheritance of Java classes because
+    // the Fantom constructor and Java constructor model don't match
+    // up past one level of inheritance
+    // NOTE: that that when we remove this restriction we need to
+    // test how field initialization works because instance$init
+    // is almost certain to break with the current emit design
+    javaBase := def.base
+    while (javaBase != null && !javaBase.isForeign) javaBase = javaBase.base
+    if (javaBase != null && javaBase !== def.base)
+    {
+      err("Cannot subclass Java class more than one level: $javaBase", def.loc)
+      return
+    }
+
+    // ensure that when we map Fantom constructors to Java
+    // constructors that we don't have duplicate signatures
+    ctors := def.ctorDefs
+    ctors.each |MethodDef a, Int i|
+    {
+      ctors.each |MethodDef b, Int j|
+      {
+        if (i > j && areParamsSame(a, b))
+          err("Duplicate Java FFI constructor signatures: '$b.name' and '$a.name'", a.loc)
+      }
+    }
+  }
+
+  **
+  ** Do the two methods have the exact same parameter types.
+  **
+  static Bool areParamsSame(CMethod a, CMethod b)
+  {
+    if (a.params.size != b.params.size) return false
+    for (i:=0; i<a.params.size; ++i)
+    {
+      if (a.params[i].paramType != b.params[i].paramType)
+        return false
+    }
+    return true
+  }
+
+//////////////////////////////////////////////////////////////////////////
+// Coercion
+//////////////////////////////////////////////////////////////////////////
+
+  **
+  ** Return if we can make the actual type fit the expected
+  ** type, potentially using a coercion.
+  **
+  Bool fits(CType actual, CType expected)
+  {
+    // use dummy expression and route to coerce code
+    dummy := UnknownVarExpr(Loc("dummy"), null, "dummy") { ctype = actual }
+    fits := true
+    coerce(dummy, expected) |->| { fits=false }
+    return fits
+  }
+
+  **
+  ** Coerce expression to expected type.  If not a type match
+  ** then run the onErr function.
+  **
+  override Expr coerce(Expr expr, CType expected, |->| onErr)
+  {
+    // handle easy case
+    actual := expr.ctype
+    expected = expected.deref
+    if (actual == expected) return expr
+
+    // handle null literal
+    if (expr.id === ExprId.nullLiteral && expected.isNullable)
+      return expr
+
+    // handle Fantom to Java primitives
+    if (expected.pod == primitives)
+      return coerceToPrimitive(expr, expected, onErr)
+
+    // handle Java primitives to Fan
+    if (actual.pod == primitives)
+      return coerceFromPrimitive(expr, expected, onErr)
+
+    // handle Java array to Fantom list
+    if (actual.name[0] == '[')
+      return coerceFromArray(expr, expected, onErr)
+
+    // handle Fantom list to Java array
+    if (expected.name[0] == '[')
+      return coerceToArray(expr, expected, onErr)
+
+    // handle sys::Func -> Java interface
+    if (actual is FuncType && expected.isMixin && expected.toNonNullable is JavaType)
+      return coerceFuncToInterface(expr, expected.toNonNullable, onErr)
+
+    // handle special classes and interfaces for built-in Fantom
+    // classes which actually map directly to Java built-in types
+    if (actual.isBool    && boolTypes.contains(expected.toNonNullable.signature)) return box(expr)
+    if (actual.isInt     && intTypes.contains(expected.toNonNullable.signature)) return box(expr)
+    if (actual.isFloat   && floatTypes.contains(expected.toNonNullable.signature)) return box(expr)
+    if (actual.isDecimal && decimalTypes.contains(expected.toNonNullable.signature)) return expr
+    if (actual.isStr     && strTypes.contains(expected.toNonNullable.signature)) return expr
+
+     // use normal Fantom coercion behavior
+    return super.coerce(expr, expected, onErr)
+  }
+
+  **
+  ** Ensure value type is boxed.
+  **
+  private Expr box(Expr expr)
+  {
+    if (expr.ctype.isVal)
+      return TypeCheckExpr.coerce(expr, expr.ctype.toNullable)
+    else
+      return expr
+  }
+
+  **
+  ** Coerce a fan expression to a Java primitive (other
+  ** than the ones we support natively)
+  **
+  Expr coerceToPrimitive(Expr expr, JavaType expected, |->| onErr)
+  {
+    actual := expr.ctype
+
+    // sys::Int (long) -> int, short, byte
+    if (actual.isInt && expected.isPrimitiveIntLike)
+      return TypeCheckExpr.coerce(expr, expected)
+
+    // sys::Float (double) -> float
+    if (actual.isFloat && expected.isPrimitiveFloat)
+      return TypeCheckExpr.coerce(expr, expected)
+
+    // no coercion - type error
+    onErr()
+    return expr
+  }
+
+  **
+  ** Coerce a Java primitive to a Fantom type.
+  **
+  Expr coerceFromPrimitive(Expr expr, CType expected, |->| onErr)
+  {
+    actual := (JavaType)expr.ctype
+
+    // int, short, byte -> sys::Int (long)
+    if (actual.isPrimitiveIntLike)
+    {
+      if (expected.isInt || expected.isObj)
+        return TypeCheckExpr.coerce(expr, expected)
+    }
+
+    // float -> sys::Float (float)
+    if (actual.isPrimitiveFloat)
+    {
+      if (expected.isFloat || expected.isObj)
+        return TypeCheckExpr.coerce(expr, expected)
+    }
+
+    // no coercion - type error
+    onErr()
+    return expr
+  }
+
+  **
+  ** Coerce a Java array to a Fantom list.
+  **
+  Expr coerceFromArray(Expr expr, CType expected, |->| onErr)
+  {
+    actual := (JavaType)expr.ctype.toNonNullable
+
+    // if expected is array type
+    if (expected is JavaType && ((JavaType)expected).isArray)
+      if (actual.arrayOf.fits(((JavaType)expected).arrayOf)) return expr
+
+    // if expected is Obj
+    if (expected.isObj) return arrayToList(expr, actual.inferredArrayOf)
+
+    // if expected is list type
+    if (expected.toNonNullable is ListType)
+    {
+      expectedOf := ((ListType)expected.toNonNullable).v
+      if (actual.inferredArrayOf.fits(expectedOf)) return arrayToList(expr, expectedOf)
+    }
+
+    // no coercion available
+    onErr()
+    return expr
+  }
+
+  **
+  ** Generate List.make(of, expr) where expr is Object[]
+  **
+  private Expr arrayToList(Expr expr, CType of)
+  {
+    loc := expr.loc
+    ofExpr := LiteralExpr(loc, ExprId.typeLiteral, ns.typeType, of)
+    call := CallExpr.makeWithMethod(loc, null, listMakeFromArray, [ofExpr, expr])
+    call.synthetic = true
+    return call
+  }
+
+  **
+  ** Coerce a Fantom list to Java array.
+  **
+  Expr coerceToArray(Expr expr, CType expected, |->| onErr)
+  {
+    loc := expr.loc
+    expectedOf := ((JavaType)expected.toNonNullable).inferredArrayOf
+    actual := expr.ctype
+
+    // if actual is list type
+    if (actual.toNonNullable is ListType)
+    {
+      actualOf := ((ListType)actual.toNonNullable).v
+      if (actualOf.fits(expectedOf))
+      {
+        // (Foo[])list.asArray(cls)
+        clsLiteral := CallExpr.makeWithMethod(loc, null, JavaType.classLiteral(this, expectedOf))
+        asArray := CallExpr.makeWithMethod(loc, expr, listAsArray, [clsLiteral])
+        return TypeCheckExpr.coerce(asArray, expected)
+      }
+    }
+
+    // no coercion available
+    onErr()
+    return expr
+  }
+
+  **
+  ** Attempt to coerce a parameterized sys::Func expr to a Java
+  ** interface if the interface supports exactly one matching method.
+  **
+  Expr coerceFuncToInterface(Expr expr, JavaType expected, |->| onErr)
+  {
+    // check if we have exactly one abstract method in the expected type
+    loc := expr.loc
+    abstracts := expected.methods.findAll |CMethod m->Bool| { return m.isAbstract }
+    if (abstracts.size != 1) { onErr(); return expr }
+    method := abstracts.first
+
+    // check if we have a match
+    FuncType funcType := (FuncType)expr.ctype
+    if (!isFuncToInterfaceMatch(funcType, method)) { onErr(); return expr }
+
+    // check if we've already generated a wrapper for this combo
+    key := "${funcType.signature}+${method.qname}"
+    ctor := funcWrappers[key]
+    if (ctor == null)
+    {
+      ctor = generateFuncToInterfaceWrapper(expr.loc, funcType, expected, method)
+      funcWrappers[key] = ctor
+    }
+
+    // replace expr with FuncWrapperX(expr)
+    call := CallExpr.makeWithMethod(loc, null, ctor, [expr])
+    call.synthetic = true
+    return call
+  }
+
+  **
+  ** Return if the specified function type can be used to implement
+  ** the specified interface method.
+  **
+  Bool isFuncToInterfaceMatch(FuncType funcType, CMethod method)
+  {
+    // sanity check to map to callX method - can't handle more than 8 args
+    if (method.params.size > 8) return false
+
+    // check if method is match for function; first check is that
+    // method must supply all the arguments required by the function
+    if (funcType.params.size > method.params.size) return false
+
+    // check that func return type fits method return
+    retOk := method.returnType.isVoid || fits(funcType.ret, method.returnType)
+    if (!retOk) return false
+
+    // check all the method parameters fit the function parameters
+    paramsOk := funcType.params.all |CType f, Int i->Bool| { return fits(f, method.params[i].paramType) }
+    if (!paramsOk) return false
+
+    return true
+  }
+
+  **
+  ** Generate the wrapper which implements the specified expected interface
+  ** and overrides the specified method which calls the function.
+  **
+  CMethod generateFuncToInterfaceWrapper(Loc loc, FuncType funcType, CType expected, CMethod method)
+  {
+    //   Fantom: func typed as |Str|
+    //   Java:   interface Foo { void bar(String) }
+    //   Result: FuncWrapperX(func)
+    //
+    //   class FuncWrapperX : Foo
+    //   {
+    //     new make(Func f) { _func = f }
+    //     override Void bar(Str a) { _func.call(a) }
+    //     Func _func
+    //   }
+
+    // generate FuncWrapper class
+    name := "FuncWrapper" + funcWrappers.size
+    cls := TypeDef(ns, loc, compiler.types[0].unit, name, FConst.Internal + FConst.Synthetic)
+    cls.base = ns.objType
+    cls.mixins = [expected]
+    addTypeDef(cls)
+
+    // generate FuncWrapper._func field
+    field := FieldDef(loc, cls)
+    ((SlotDef)field).name = "_func"
+    ((DefNode)field).flags = FConst.Private + FConst.Storage + FConst.Synthetic
+    field.fieldType = funcType
+    cls.addSlot(field)
+
+    // generate FuncWrapper.make constructor
+    ctor := MethodDef(loc, cls, "make", FConst.Internal + FConst.Ctor + FConst.Synthetic)
+    ctor.ret  = ns.voidType
+    ctor.paramDefs = [ParamDef(loc, funcType, "f")]
+    ctor.code = Block.make(loc)
+    ctor.code.stmts.add(BinaryExpr.makeAssign(
+      FieldExpr(loc, ThisExpr(loc), field),
+      UnknownVarExpr(loc, null, "f")).toStmt)
+    ctor.code.stmts.add(ReturnStmt.make(loc))
+    cls.addSlot(ctor)
+
+    // generate FuncWrapper override of abstract method
+    over := MethodDef(loc, cls, method.name, FConst.Public + FConst.Override + FConst.Synthetic)
+    over.ret = method.returnType
+    over.paramDefs = ParamDef[,]
+    over.code = Block.make(loc)
+    callArity := "call"
+    call := CallExpr.makeWithMethod(loc, FieldExpr(loc, ThisExpr(loc), field), funcType.method(callArity))
+    method.params.each |CParam param, Int i|
+    {
+      paramName := "p$i"
+      over.params.add(ParamDef(loc, param.paramType, paramName))
+      if (i < funcType.params.size)
+        call.args.add(UnknownVarExpr(loc, null, paramName))
+    }
+    if (method.returnType.isVoid)
+      over.code.stmts.add(call.toStmt).add(ReturnStmt(loc))
+    else
+      over.code.stmts.add(ReturnStmt(loc, call))
+    cls.addSlot(over)
+
+    // return the ctor which we use for coercion
+    return ctor
+  }
+
+//////////////////////////////////////////////////////////////////////////
+// Reflection
+//////////////////////////////////////////////////////////////////////////
+
+  **
+  ** Get a CMethod representation for 'List.make(Type, Object[])'
+  **
+  once CMethod listMakeFromArray()
+  {
+    return JavaMethod(
+      this.ns.listType,
+      "make",
+      FConst.Public + FConst.Static,
+      this.ns.listType.toNullable,
+      [
+        JavaParam("of", this.ns.typeType),
+        JavaParam("array", objectArrayType)
+      ])
+  }
+
+  **
+  ** Get a CMethod representation for 'Object[] List.asArray()'
+  **
+  once CMethod listAsArray()
+  {
+    return JavaMethod(
+      this.ns.listType,
+      "asArray",
+      FConst.Public,
+      objectArrayType,
+      [JavaParam("cls", classType)])
+  }
+
+  **
+  ** Get a CType representation for 'java.lang.Class'
+  **
+  once JavaType classType()
+  {
+    return ns.resolveType("[java]java.lang::Class")
+  }
+
+  **
+  ** Get a CType representation for 'java.lang.Object[]'
+  **
+  once JavaType objectArrayType()
+  {
+    return ns.resolveType("[java]java.lang::[Object")
+  }
+
+//////////////////////////////////////////////////////////////////////////
+// Fields
+//////////////////////////////////////////////////////////////////////////
+
+  const static Str[] boolTypes := Str[
+    "[java]java.io::Serializable",
+    "[java]java.lang::Comparable",
+  ]
+
+  const static Str[] intTypes := Str[
+    "[java]java.lang::Number",
+    "[java]java.io::Serializable",
+    "[java]java.lang::Comparable",
+  ]
+
+  const static Str[] floatTypes := Str[
+    "[java]java.lang::Number",
+    "[java]java.io::Serializable",
+    "[java]java.lang::Comparable",
+  ]
+
+  const static Str[] decimalTypes := Str[
+    "[java]java.lang::Number",
+    "[java]java.io::Serializable",
+    "[java]java.lang::Comparable",
+  ]
+
+  const static Str[] strTypes := Str[
+    "[java]java.io::Serializable",
+    "[java]java.lang::CharSequence",
+    "[java]java.lang::Comparable",
+  ]
+
+  JavaPrimitives primitives := JavaPrimitives(this)
+  ClassPath cp
+
+  private Str:CMethod funcWrappers := Str:CMethod[:]  // funcType+method:ctor
+
+}
+
+**************************************************************************
+** CallMatch
+**************************************************************************
+
+internal class CallMatch
+{
+  CallExpr apply(CallExpr call)
+  {
+    call.args   = args
+    call.method = method
+    call.ctype  = method.isCtor ? method.parent : method.returnType
+    return call
+  }
+
+  override Str toStr() { return method.signature }
+
+  CMethod? method    // matched method
+  Expr[]? args       // coerced arguments
+}
\ No newline at end of file
diff --git a/tests/examplefiles/test.groovy b/tests/examplefiles/test.groovy
new file mode 100644 (file)
index 0000000..903863d
--- /dev/null
@@ -0,0 +1,97 @@
+// This source code comes from http://www.odelia-technologies.com/node/200
+
+package com.odelia.groovy.simpleworkflow
+
+
+class SimpleWorkflowEngine {
+    def workflowMap = [:]
+    def context = [:]
+    def beforeActivityName = 'beforeActivity'
+    def afterActivityName = 'afterActivity'
+
+    SimpleWorkflowEngine(workflow, context = [:]) {
+        this.context = context
+        parseWorkflow(workflow)
+    }
+
+    def parseWorkflow(workflow) {
+        workflowMap = new WorkflowParser().parse(workflow)
+    }
+
+    def getActivityValue(activity) {
+        assert activity instanceof String
+        if (!workflowMap[activity])
+            throw new RuntimeException("$activity activity doesn't exist")
+        workflowMap[activity]
+    }
+
+    def execute(activity, pause) {
+        if (workflowMap[beforeActivityName]) {
+            getActivityValue(beforeActivityName)(context, activity)
+        }
+
+        def activityValue = getActivityValue(activity)
+
+        // Determine the next activity to execute
+        def nextActivity
+        switch (activityValue) {
+            case String: nextActivity = activityValue; break
+            case Closure: nextActivity = activityValue(context); break
+            case Class: nextActivity = activityValue.newInstance()(context)
+        }
+
+        if (workflowMap[afterActivityName]) {
+            getActivityValue(afterActivityName)(context, activity, nextActivity)
+        }
+
+        if (!pause && nextActivity)
+            call(nextActivity)
+        else
+            nextActivity
+    }
+
+    def call(activity) {
+        execute(activity, false)
+    }
+
+    def nextActivity(activity) {
+        execute(activity, true)
+    }
+
+    static void main(String[] args) {
+        if (args.size() != 2) {
+            println 'Usage: com.odelia.groovy.simpleworkflow.SimpleWorkflowEngine <dsl_filename> <activity_name>'
+            return
+        }
+        SimpleWorkflowEngine.newInstance(new File(args[0]))(args[1])
+    }
+
+}
+
+private class WorkflowParser {
+    def map = [:]
+
+    def methodMissing(String name, args) {
+        map[name] = args[0]
+    }
+
+    def parse(Closure wf) {
+        wf.delegate = this
+        wf.resolveStrategy = Closure.DELEGATE_FIRST
+        wf()
+        map
+    }
+
+    def workflow = { it ->
+        it.delegate = this
+        it.resolveStrategy = Closure.DELEGATE_FIRST
+        it()
+    }
+
+    def parse(File workflowDef) {
+        def binding = new Binding([workflow: workflow])
+        def shell = new GroovyShell(binding)
+        shell.evaluate(workflowDef)
+        map
+    }
+}
\ No newline at end of file
diff --git a/tests/examplefiles/test.nim b/tests/examplefiles/test.nim
new file mode 100644 (file)
index 0000000..20610bb
--- /dev/null
@@ -0,0 +1,93 @@
+import re
+
+for x in lines("myfile.txt"):
+  if x =~ re"(\w+)=(.*)":
+    echo "Key: ", matches[0],
+         " Value: ", matches[1]
+
+Echo("What's your name? ")
+var name: string = readLine(stdin)
+if name == "":
+  echo("Poor soul, you lost your name?")
+elif name == "name":
+  echo("Very funny, your name is name.")
+else:
+  Echo("Hi, ", name, "!")
+
+var name = readLine(stdin)
+case name
+of "":
+  echo("Poor soul, you lost your name?")
+of "name":
+  echo("Very funny, your name is name.")
+else:
+  Echo("Hi, ", name, "!")
+
+from strutils import parseInt
+
+Echo("A number please: ")
+var n = parseInt(readLine(stdin))
+case n
+of 0..2, 4..7: Echo("The number is in the set: {0, 1, 2, 4, 5, 6, 7}")
+of 3, 8: Echo("The number is 3 or 8")
+
+Echo("Counting to 10: ")
+var i = 1
+while i <= 10:
+  Echo($i)
+  inc(i)
+
+proc yes(question: string): bool =
+  Echo(question, " (y/n)")
+  while true:
+    case readLine(stdin)
+    of "y", "Y", "yes", "Yes": return true
+    of "n", "N", "no", "No": return false
+    else: Echo("Please be clear: yes or no")
+
+proc even(n: int): bool
+
+proc odd(n: int): bool =
+  if n == 1: return true
+  else: return even(n-1)
+
+iterator countup(a, b: int): int =
+  var res = a
+  while res <= b:
+    yield res
+    inc(res)
+
+type
+  TPerson = object of TObject
+    name*: string  # the * means that `name` is accessible from other modules
+    age: int       # no * means that the field is hidden from other modules
+
+  TStudent = object of TPerson # TStudent inherits from TPerson
+    id: int                    # with an id field
+
+var
+  student: TStudent
+  person: TPerson
+assert(student is TStudent)
+
+echo({'a', 'b', 'c'}.card)
+stdout.writeln("Hallo")
+var
+  f: TFile
+if open(f, "numbers.txt"):
+  try:
+    var a = readLine(f)
+    var b = readLine(f)
+    echo("sum: " & $(parseInt(a) + parseInt(b)))
+  except EOverflow:
+    echo("overflow!")
+  except EInvalidValue:
+    echo("could not convert string to integer")
+  except EIO:
+    echo("IO error!")
+  except:
+    echo("Unknown exception!")
+    # reraise the unknown exception:
+    raise
+  finally:
+    close(f)
\ No newline at end of file
diff --git a/tests/examplefiles/test.ps1 b/tests/examplefiles/test.ps1
new file mode 100644 (file)
index 0000000..385fb6f
--- /dev/null
@@ -0,0 +1,108 @@
+<#
+.SYNOPSIS
+Runs a T-SQL Query and optional outputs results to a delimited file.
+.DESCRIPTION
+Invoke-Sql script will run a T-SQL query or stored procedure and optionally outputs a delimited file.
+.EXAMPLE
+PowerShell.exe -File "C:\Scripts\Invoke-Sql.ps1" -ServerInstance "Z003\sqlprod2" -Database orders -Query "EXEC usp_accounts '12445678'"
+This example connects to Z003\sqlprod2.Orders and executes a stored procedure which does not return a result set
+.EXAMPLE
+PowerShell.exe -File "C:\Scripts\Invoke-Sql.ps1" -ServerInstance "Z003\sqlprod2" -Database orders -Query "SELECT * FROM dbo.accounts" -FilePath "C:\Scripts\accounts.txt" -Delimiter ","
+This example connects to Z003\sqlprod2.Orders and selects the records from the accounts tables, the data is outputed to a CSV file
+.NOTES
+Version History
+v1.0   - Chad Miller - 12/14/2010 - Initial release
+IMPORTANT!!! The EventLog source which is set to the application needs to be registered with
+the Event log:
+New-EventLog -LogName Application -Source  $Application
+#>
+param(
+#ServerInstance is Mandatory!
+[Parameter(Position=0, Mandatory=$false)] [string]$ServerInstance,
+#Database is Mandatory!
+[Parameter(Position=1, Mandatory=$false)] [string]$Database,
+#Query is Mandatory!
+[Parameter(Position=2, Mandatory=$false)] [string]$Query,
+[Parameter(Position=3, Mandatory=$false)] [string]$Application="Invoke-Sql.ps1",
+[Parameter(Position=4, Mandatory=$false)] [string]$FilePath,
+[Parameter(Position=7, Mandatory=$false)] [string]$Delimiter="|",
+#If UserName isn't supplied a trusted connection will be used
+[Parameter(Position=5, Mandatory=$false)] [string]$UserName,
+[Parameter(Position=6, Mandatory=$false)] [string]$Password,
+[Parameter(Position=8, Mandatory=$false)] [Int32]$QueryTimeout=600,
+[Parameter(Position=9, Mandatory=$false)] [Int32]$ConnectionTimeout=15
+)
+#This must be run as administrator on Windows 2008 and higher!
+New-EventLog -LogName Application -Source $Application -EA SilentlyContinue
+$Error.Clear()
+#######################
+function Invoke-SqlCmd2
+{
+    param(
+    [Parameter(Position=0, Mandatory=$true)] [string]$ServerInstance,
+    [Parameter(Position=1, Mandatory=$true)] [string]$Database,
+    [Parameter(Position=2, Mandatory=$true)] [string]$Query,
+    [Parameter(Position=3, Mandatory=$false)] [string]$UserName,
+    [Parameter(Position=4, Mandatory=$false)] [string]$Password,
+    [Parameter(Position=5, Mandatory=$false)] [Int32]$QueryTimeout,
+    [Parameter(Position=6, Mandatory=$false)] [Int32]$ConnectionTimeout
+    )
+    try {
+        if ($Username)
+        { $ConnectionString = "Server={0};Database={1};User ID={2};Password={3};Trusted_Connection=False;Connect Timeout={4}" -f $ServerInstance,$Database,$Username,$Password,$ConnectionTimeout }
+        else
+        { $ConnectionString = "Server={0};Database={1};Integrated Security=True;Connect Timeout={2}" -f $ServerInstance,$Database,$ConnectionTimeout }
+        $conn=new-object System.Data.SqlClient.SQLConnection
+        $conn.ConnectionString=$ConnectionString
+        $conn.Open()
+        $cmd=new-object system.Data.SqlClient.SqlCommand($Query,$conn)
+        $cmd.CommandTimeout=$QueryTimeout
+        $ds=New-Object system.Data.DataSet
+        $da=New-Object system.Data.SqlClient.SqlDataAdapter($cmd)
+        [void]$da.fill($ds)
+        Write-Output ($ds.Tables[0])
+    }
+    finally {
+        $conn.Dispose()
+    }
+} #Invoke-SqlCmd2
+#######################
+#       MAIN          #
+#######################
+if ($PSBoundParameters.Count -eq 0)
+{
+ get-help $myInvocation.MyCommand.Path -full
+ break
+}
+try {
+    $msg = $null
+    $msg += "Application/Job Name: $Application`n"
+    $msg += "Query: $Query`n"
+    $msg += "ServerInstance: $ServerInstance`n"
+    $msg += "Database: $Database`n"
+    $msg += "FilePath: $FilePath`n"
+   
+    Write-EventLog -LogName Application -Source "$Application" -EntryType Information -EventId 12345 -Message "Starting`n$msg"
+    $dt = Invoke-SqlCmd2 -ServerInstance $ServerInstance -Database $Database -Query $Query -UserName $UserName -Password $Password -QueryTimeOut $QueryTimeOut -ConnectionTimeout $ConnectionTimeout
+    if ($FilePath)
+    {
+        if ($dt)
+        { $dt | export-csv -Delimiter $Delimiter -Path $FilePath -NoTypeInformation }
+        else #Query Returned No Output!
+        {Write-EventLog -LogName Application -Source "$Application" -EntryType Warning -EventId 12345 -Message "NoOutput`n$msg" }
+    }
+    Write-EventLog -LogName Application -Source "$Application" -EntryType Information -EventId 12345 -Message "Completed`n$msg"
+}
+catch {
+    $Exception = "{0}, {1}" -f  $_.Exception.GetType().FullName,$( $_.Exception.Message -replace "'" )
+    Write-EventLog -LogName Application -Source "$Application" -EntryType Error -EventId 12345 -Message "Error`n$msg`n$Exception"
+    throw
+}
diff --git a/tests/examplefiles/test.pypylog b/tests/examplefiles/test.pypylog
new file mode 100644 (file)
index 0000000..f85030c
--- /dev/null
@@ -0,0 +1,1839 @@
+[5ed621f277b8] {jit-backend-counts
+[5ed621f309bc] jit-backend-counts}
+[5ed622c957b0] {jit-log-opt-loop
+# Loop 0 : loop with 145 ops
+[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, f11, p12, p13, p14, p15, i16, f17, i18, i19, i20, i21, i22, i23, i24, i25, i26, f27, i28, f29, f30]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+i32 = int_gt(i18, 0)
+guard_true(i32, descr=<Guard3>) [p1, p0, p5, p2, p3, p4, p6, p7, p8, p9, p10, p12, p13, p14, p15, i16, f17, f11]
+i33 = int_add(i19, i20)
+i35 = int_sub(i18, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #128 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #131 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #134 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #137 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #140 BINARY_MULTIPLY', 0)
+setfield_gc(p5, i33, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p5, i35, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+i36 = int_mul_ovf(i21, i22)
+guard_no_overflow(, descr=<Guard4>) [p1, p0, p12, p15, i36, p2, p3, p4, p5, p14, p6, p7, p8, p9, p10, p13, i19, None, f17, f11]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #141 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #144 BINARY_ADD', 0)
+i38 = int_add_ovf(i36, i19)
+guard_no_overflow(, descr=<Guard5>) [p1, p0, i38, p2, p3, p4, p5, p14, p6, p7, p8, p9, p10, p12, p13, p15, i36, i19, None, f17, f11]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #145 BINARY_SUBSCR', 0)
+i40 = int_lt(i38, 0)
+guard_false(i40, descr=<Guard6>) [p1, p0, p14, i38, i23, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, None, i19, None, f17, f11]
+i41 = int_lt(i38, i23)
+guard_true(i41, descr=<Guard7>) [p1, p0, p14, i38, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, None, i19, None, f17, f11]
+f42 = getarrayitem_raw(i24, i38, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #146 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #149 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #152 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #155 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #158 BINARY_SUBTRACT', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #159 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #162 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #163 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #166 BINARY_ADD', 0)
+i43 = int_add_ovf(i25, i19)
+guard_no_overflow(, descr=<Guard8>) [p1, p0, i43, p2, p3, p4, p5, p14, p6, p7, p8, p9, p10, p12, p13, p15, f42, i25, None, i19, None, None, f11]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #167 BINARY_SUBSCR', 0)
+i45 = int_lt(i43, 0)
+guard_false(i45, descr=<Guard9>) [p1, p0, p14, i43, i23, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, f42, None, None, i19, None, None, f11]
+i46 = int_lt(i43, i23)
+guard_true(i46, descr=<Guard10>) [p1, p0, p14, i43, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, f42, None, None, i19, None, None, f11]
+f47 = getarrayitem_raw(i24, i43, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #168 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #171 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #174 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #177 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #178 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #181 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #182 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #185 BINARY_ADD', 0)
+i48 = int_add_ovf(i26, i19)
+guard_no_overflow(, descr=<Guard11>) [p1, p0, i48, p2, p3, p4, p5, p14, p6, p7, p8, p9, p10, p12, p13, p15, i26, f47, f42, None, None, i19, None, None, f11]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #186 BINARY_SUBSCR', 0)
+i50 = int_lt(i48, 0)
+guard_false(i50, descr=<Guard12>) [p1, p0, p14, i48, i23, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, None, f47, f42, None, None, i19, None, None, f11]
+i51 = int_lt(i48, i23)
+guard_true(i51, descr=<Guard13>) [p1, p0, p14, i48, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, None, f47, f42, None, None, i19, None, None, f11]
+f52 = getarrayitem_raw(i24, i48, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #187 BINARY_ADD', 0)
+f53 = float_add(f47, f52)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #188 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #191 BINARY_MULTIPLY', 0)
+f54 = float_mul(f53, f27)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #192 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #195 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #198 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #201 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #202 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #205 BINARY_ADD', 0)
+i55 = int_add_ovf(i28, i19)
+guard_no_overflow(, descr=<Guard14>) [p1, p0, i55, p2, p3, p4, p5, p14, p6, p7, p8, p9, p10, p12, p13, p15, f54, i28, None, None, f42, None, None, i19, None, None, f11]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #206 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #209 BINARY_SUBTRACT', 0)
+i57 = int_sub_ovf(i55, 1)
+guard_no_overflow(, descr=<Guard15>) [p1, p0, i57, p2, p3, p4, p5, p14, p6, p7, p8, p9, p10, p12, p13, p15, i55, f54, None, None, None, f42, None, None, i19, None, None, f11]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #210 BINARY_SUBSCR', 0)
+i59 = int_lt(i57, 0)
+guard_false(i59, descr=<Guard16>) [p1, p0, p14, i57, i23, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, None, f54, None, None, None, f42, None, None, i19, None, None, f11]
+i60 = int_lt(i57, i23)
+guard_true(i60, descr=<Guard17>) [p1, p0, p14, i57, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, None, f54, None, None, None, f42, None, None, i19, None, None, f11]
+f61 = getarrayitem_raw(i24, i57, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #211 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #214 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #217 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #220 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #221 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #224 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #225 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #228 BINARY_ADD', 0)
+i63 = int_add_ovf(i55, 1)
+guard_no_overflow(, descr=<Guard18>) [p1, p0, i63, p2, p3, p4, p5, p14, p6, p7, p8, p9, p10, p12, p13, p15, f61, i55, f54, None, None, None, f42, None, None, i19, None, None, f11]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #229 BINARY_SUBSCR', 0)
+i64 = int_lt(i63, i23)
+guard_true(i64, descr=<Guard19>) [p1, p0, p14, i63, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, f61, None, f54, None, None, None, f42, None, None, i19, None, None, f11]
+f65 = getarrayitem_raw(i24, i63, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #230 BINARY_ADD', 0)
+f66 = float_add(f61, f65)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #231 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #234 BINARY_MULTIPLY', 0)
+f67 = float_mul(f66, f29)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #235 BINARY_ADD', 0)
+f68 = float_add(f54, f67)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #236 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #239 BINARY_MULTIPLY', 0)
+f69 = float_mul(f68, f30)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #240 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #243 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #246 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #249 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #250 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #253 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #254 STORE_SUBSCR', 0)
+i70 = int_lt(i55, i23)
+guard_true(i70, descr=<Guard20>) [p1, p0, p14, i55, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p15, f69, None, None, None, None, None, None, f42, None, None, i19, None, None, f11]
+setarrayitem_raw(i24, i55, f69, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #255 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #258 LOAD_GLOBAL', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #261 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #264 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #267 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #270 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #271 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #274 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #275 BINARY_SUBSCR', 0)
+f71 = getarrayitem_raw(i24, i55, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #276 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #279 BINARY_SUBTRACT', 0)
+f72 = float_sub(f71, f42)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #280 CALL_FUNCTION', 0)
+i73 = force_token()
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #0 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #3 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #6 BINARY_MULTIPLY', 1)
+f74 = float_mul(f72, f72)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #7 RETURN_VALUE', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #283 INPLACE_ADD', 0)
+f75 = float_add(f11, f74)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #284 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #287 JUMP_ABSOLUTE', 0)
+i77 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i79 = int_sub(i77, 26)
+setfield_raw(38968960, i79, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i81 = int_lt(i79, 0)
+guard_false(i81, descr=<Guard21>) [p1, p0, p2, p3, p4, p5, p6, p7, p8, p9, p10, p12, p13, p14, p15, f75, None, None, None, None, None, None, None, f42, None, None, i19, None, None, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+jump(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, f75, p12, p13, p14, p15, i19, f42, i35, i33, i20, i21, i22, i23, i24, i25, i26, f27, i36, f29, f30, descr=<Loop0>)
+[5ed622d5187e] jit-log-opt-loop}
+[5ed622e116d0] {jit-log-opt-loop
+# Loop 1 : entry bridge with 188 ops
+[p0, p1, p2, p3, i4, p5, i6, i7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+guard_value(i4, 2, descr=<Guard22>) [i4, p1, p0, p2, p3, p5, i6, i7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26]
+guard_class(p9, 19861240, descr=<Guard23>) [p1, p0, p9, p2, p3, p5, i6, p8, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26]
+i29 = getfield_gc(p9, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+i31 = int_gt(i29, 0)
+guard_true(i31, descr=<Guard24>) [p1, p0, p9, p2, p3, p5, i6, p8, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26]
+i32 = getfield_gc(p9, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+i33 = getfield_gc(p9, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+i34 = int_add(i32, i33)
+i36 = int_sub(i29, 1)
+setfield_gc(p9, i34, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p9, i36, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+guard_value(i6, 0, descr=<Guard25>) [i6, p1, p0, p2, p3, p5, p8, p9, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #128 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #131 LOAD_FAST', 0)
+guard_nonnull_class(p23, 19886912, descr=<Guard26>) [p1, p0, p23, p2, p3, p5, p8, p9, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, p26, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #134 LOAD_FAST', 0)
+guard_nonnull_class(p24, ConstClass(W_IntObject), descr=<Guard27>) [p1, p0, p24, p2, p3, p5, p8, p9, p23, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p26, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #137 LOAD_FAST', 0)
+guard_nonnull_class(p21, ConstClass(W_IntObject), descr=<Guard28>) [p1, p0, p21, p2, p3, p5, p8, p9, p23, p24, p12, p13, p14, p15, p16, p17, p18, p19, p20, p22, p26, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #140 BINARY_MULTIPLY', 0)
+i41 = getfield_gc_pure(p24, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i42 = getfield_gc_pure(p21, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i43 = int_mul_ovf(i41, i42)
+guard_no_overflow(, descr=<Guard29>) [p1, p0, p21, p24, i43, p2, p3, p5, p8, p9, p23, p13, p14, p15, p16, p17, p18, p19, p20, p22, p26, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #141 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #144 BINARY_ADD', 0)
+i44 = int_add_ovf(i43, i32)
+guard_no_overflow(, descr=<Guard30>) [p1, p0, i44, p2, p3, p5, p8, p9, p23, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, p26, i43, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #145 BINARY_SUBSCR', 0)
+i45 = getfield_gc(p23, descr=<SignedFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_len 32>)
+i47 = int_lt(i44, 0)
+guard_false(i47, descr=<Guard31>) [p1, p0, p23, i44, i45, p2, p3, p5, p8, p9, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, p26, None, i32]
+i49 = int_lt(i44, i45)
+guard_true(i49, descr=<Guard32>) [p1, p0, p23, i44, p2, p3, p5, p8, p9, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, p26, None, i32]
+i50 = getfield_gc(p23, descr=<NonGcPtrFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_buffer 24>)
+f51 = getarrayitem_raw(i50, i44, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #146 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #149 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #152 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #155 LOAD_CONST', 0)
+guard_value(p2, ConstPtr(ptr52), descr=<Guard33>) [p1, p0, p2, p3, p5, p8, p9, p23, p24, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #158 BINARY_SUBTRACT', 0)
+i54 = int_sub_ovf(i41, 1)
+guard_no_overflow(, descr=<Guard34>) [p1, p0, p24, i54, p3, p5, p8, p9, p23, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #159 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #162 BINARY_MULTIPLY', 0)
+i55 = int_mul_ovf(i54, i42)
+guard_no_overflow(, descr=<Guard35>) [p1, p0, p21, i55, p3, p5, p8, p9, p23, p13, p14, p15, p16, p17, p18, p19, p20, p22, p24, i54, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #163 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #166 BINARY_ADD', 0)
+i56 = int_add_ovf(i55, i32)
+guard_no_overflow(, descr=<Guard36>) [p1, p0, i56, p3, p5, p8, p9, p23, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, i55, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #167 BINARY_SUBSCR', 0)
+i58 = int_lt(i56, 0)
+guard_false(i58, descr=<Guard37>) [p1, p0, p23, i56, i45, p3, p5, p8, p9, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, None, None, f51, None, i32]
+i59 = int_lt(i56, i45)
+guard_true(i59, descr=<Guard38>) [p1, p0, p23, i56, p3, p5, p8, p9, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, None, None, f51, None, i32]
+f60 = getarrayitem_raw(i50, i56, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #168 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #171 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #174 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #177 BINARY_ADD', 0)
+i62 = int_add_ovf(i41, 1)
+guard_no_overflow(, descr=<Guard39>) [p1, p0, p24, i62, p3, p5, p8, p9, p23, p14, p15, p16, p17, p18, p19, p20, p21, p22, f60, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #178 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #181 BINARY_MULTIPLY', 0)
+i63 = int_mul_ovf(i62, i42)
+guard_no_overflow(, descr=<Guard40>) [p1, p0, p21, i63, p3, p5, p8, p9, p23, p14, p15, p16, p17, p18, p19, p20, p22, p24, i62, f60, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #182 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #185 BINARY_ADD', 0)
+i64 = int_add_ovf(i63, i32)
+guard_no_overflow(, descr=<Guard41>) [p1, p0, i64, p3, p5, p8, p9, p23, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, i63, None, f60, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #186 BINARY_SUBSCR', 0)
+i66 = int_lt(i64, 0)
+guard_false(i66, descr=<Guard42>) [p1, p0, p23, i64, i45, p3, p5, p8, p9, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, None, None, f60, None, None, f51, None, i32]
+i67 = int_lt(i64, i45)
+guard_true(i67, descr=<Guard43>) [p1, p0, p23, i64, p3, p5, p8, p9, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, None, None, f60, None, None, f51, None, i32]
+f68 = getarrayitem_raw(i50, i64, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #187 BINARY_ADD', 0)
+f69 = float_add(f60, f68)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #188 LOAD_FAST', 0)
+guard_nonnull_class(p18, 19800744, descr=<Guard44>) [p1, p0, p18, p3, p5, p8, p9, p14, p15, p16, p17, p19, p20, p21, p22, p23, p24, f69, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #191 BINARY_MULTIPLY', 0)
+f71 = getfield_gc_pure(p18, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f72 = float_mul(f69, f71)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #192 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #195 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #198 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #201 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #202 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #205 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #206 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #209 BINARY_SUBTRACT', 0)
+i74 = int_sub(i44, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #210 BINARY_SUBSCR', 0)
+i76 = int_lt(i74, 0)
+guard_false(i76, descr=<Guard45>) [p1, p0, p23, i74, i45, p3, p5, p8, p9, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, f72, None, None, None, None, None, None, f51, None, i32]
+i77 = int_lt(i74, i45)
+guard_true(i77, descr=<Guard46>) [p1, p0, p23, i74, p3, p5, p8, p9, p14, p15, p16, p17, p18, p19, p20, p21, p22, p24, f72, None, None, None, None, None, None, f51, None, i32]
+f78 = getarrayitem_raw(i50, i74, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #211 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #214 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #217 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #220 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #221 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #224 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #225 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #228 BINARY_ADD', 0)
+i80 = int_add(i44, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #229 BINARY_SUBSCR', 0)
+i81 = int_lt(i80, i45)
+guard_true(i81, descr=<Guard47>) [p1, p0, p23, i80, p3, p5, p8, p9, p15, p16, p17, p18, p19, p20, p21, p22, p24, f78, f72, None, None, None, None, None, None, f51, None, i32]
+f82 = getarrayitem_raw(i50, i80, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #230 BINARY_ADD', 0)
+f83 = float_add(f78, f82)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #231 LOAD_FAST', 0)
+guard_nonnull_class(p17, 19800744, descr=<Guard48>) [p1, p0, p17, p3, p5, p8, p9, p15, p16, p18, p19, p20, p21, p22, p23, p24, f83, None, f72, None, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #234 BINARY_MULTIPLY', 0)
+f85 = getfield_gc_pure(p17, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f86 = float_mul(f83, f85)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #235 BINARY_ADD', 0)
+f87 = float_add(f72, f86)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #236 LOAD_FAST', 0)
+guard_nonnull_class(p19, 19800744, descr=<Guard49>) [p1, p0, p19, p3, p5, p8, p9, p15, p16, p17, p18, p20, p21, p22, p23, p24, f87, None, None, None, None, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #239 BINARY_MULTIPLY', 0)
+f89 = getfield_gc_pure(p19, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f90 = float_mul(f87, f89)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #240 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #243 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #246 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #249 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #250 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #253 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #254 STORE_SUBSCR', 0)
+setarrayitem_raw(i50, i44, f90, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #255 LOAD_FAST', 0)
+guard_nonnull_class(p20, 19800744, descr=<Guard50>) [p1, p0, p20, p3, p5, p8, p9, p15, p16, p17, p18, p19, p21, p22, p23, p24, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #258 LOAD_GLOBAL', 0)
+p92 = getfield_gc(p0, descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+guard_value(p92, ConstPtr(ptr93), descr=<Guard51>) [p1, p0, p92, p3, p5, p8, p9, p20, p15, p16, p17, p18, p19, p21, p22, p23, p24, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+p94 = getfield_gc(p92, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p94, descr=<Guard52>) [p1, p0, p94, p92, p3, p5, p8, p9, p20, p15, p16, p17, p18, p19, p21, p22, p23, p24, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+p96 = getfield_gc(ConstPtr(ptr95), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p96, ConstClass(Function), descr=<Guard53>) [p1, p0, p96, p3, p5, p8, p9, p20, p15, p16, p17, p18, p19, p21, p22, p23, p24, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #261 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #264 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #267 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #270 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #271 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #274 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #275 BINARY_SUBSCR', 0)
+f98 = getarrayitem_raw(i50, i44, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #276 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #279 BINARY_SUBTRACT', 0)
+f99 = float_sub(f98, f51)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #280 CALL_FUNCTION', 0)
+p100 = getfield_gc(p96, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_code 24>)
+guard_value(p100, ConstPtr(ptr101), descr=<Guard54>) [p1, p0, p100, p96, p3, p5, p8, p9, p20, p15, p16, p17, p18, p19, p21, p22, p23, p24, f99, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+p102 = getfield_gc(p96, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_w_func_globals 64>)
+p103 = getfield_gc(p96, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_closure 16>)
+p105 = call(ConstClass(getexecutioncontext), descr=<GcPtrCallDescr>)
+p106 = getfield_gc(p105, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+i107 = force_token()
+p108 = getfield_gc(p105, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc 72>)
+guard_isnull(p108, descr=<Guard55>) [p1, p0, p105, p108, p3, p5, p8, p9, p20, p96, p15, p16, p17, p18, p19, p21, p22, p23, p24, p106, p102, i107, f99, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+i109 = getfield_gc(p105, descr=<NonGcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc 40>)
+i110 = int_is_zero(i109)
+guard_true(i110, descr=<Guard56>) [p1, p0, p105, p3, p5, p8, p9, p20, p96, p15, p16, p17, p18, p19, p21, p22, p23, p24, p106, p102, i107, f99, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #0 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #3 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #6 BINARY_MULTIPLY', 1)
+f111 = float_mul(f99, f99)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #7 RETURN_VALUE', 1)
+i112 = int_is_true(i109)
+guard_false(i112, descr=<Guard57>) [p1, p0, p105, p3, p5, p8, p9, p20, p96, p15, p16, p17, p18, p19, p21, p22, p23, p24, f111, p106, p102, i107, f99, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #283 INPLACE_ADD', 0)
+f113 = getfield_gc_pure(p20, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f114 = float_add(f113, f111)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #284 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #287 JUMP_ABSOLUTE', 0)
+i116 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i118 = int_sub(i116, 26)
+setfield_raw(38968960, i118, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i120 = int_lt(i118, 0)
+guard_false(i120, descr=<Guard58>) [p1, p0, p3, p5, p8, p9, p15, p16, p17, p18, p19, p21, p22, p23, p24, f114, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, f51, None, i32]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+jump(p0, p1, p3, p5, p8, p9, p15, p16, p17, p18, p19, f114, p21, p22, p23, p24, i32, f51, i36, i34, i33, i41, i42, i45, i50, i55, i63, f71, i43, f85, f89, descr=<Loop0>)
+[5ed622ea316e] jit-log-opt-loop}
+[5ed62326a846] {jit-log-opt-bridge
+# bridge out of Guard 21 with 13 ops
+[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, f15, f16, i17]
+i18 = force_token()
+setfield_gc(p1, i18, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.vable_token 24>)
+call_may_force(ConstClass(action_dispatcher), p0, p1, descr=<VoidCallDescr>)
+guard_not_forced(, descr=<Guard59>) [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, i17, f16, f15]
+guard_no_exception(, descr=<Guard60>) [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, i17, f16, f15]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+p21 = new_with_vtable(19800744)
+setfield_gc(p21, f15, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+p23 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p23, i17, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p25 = new_with_vtable(19800744)
+setfield_gc(p25, f16, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+jump(p1, p0, ConstPtr(ptr26), p2, 2, p3, 0, 125, p4, p5, ConstPtr(ptr30), ConstPtr(ptr31), ConstPtr(ptr32), ConstPtr(ptr33), ConstPtr(ptr34), p6, p7, p8, p9, p10, p21, p11, p12, p13, p14, p23, p25, descr=<Loop1>)
+[5ed62327d096] jit-log-opt-bridge}
+[5ed623eb929c] {jit-log-opt-bridge
+# bridge out of Guard 3 with 260 ops
+[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, i15, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #290 POP_BLOCK', 0)
+p18 = getfield_gc(p3, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+guard_class(p3, 19865144, descr=<Guard61>) [p0, p1, p3, p18, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, i15, f16, f17]
+i20 = getfield_gc(p3, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+guard_value(i20, 1, descr=<Guard62>) [p0, p1, i20, p18, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, i15, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #291 JUMP_ABSOLUTE', 0)
+i23 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i25 = int_sub(i23, 1)
+setfield_raw(38968960, i25, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i27 = int_lt(i25, 0)
+guard_false(i27, descr=<Guard63>) [p0, p1, p18, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, i15, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #99 FOR_ITER', 0)
+guard_class(p5, 19861240, descr=<Guard64>) [p0, p1, p5, p18, p4, p6, p7, p8, p9, p10, p11, p12, p13, p14, i15, f16, f17]
+i29 = getfield_gc(p5, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+i31 = int_gt(i29, 0)
+guard_true(i31, descr=<Guard65>) [p0, p1, p5, p18, p4, p6, p7, p8, p9, p10, p11, p12, p13, p14, i15, f16, f17]
+i32 = getfield_gc(p5, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+i33 = getfield_gc(p5, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+i34 = int_add(i32, i33)
+i36 = int_sub(i29, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #102 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #105 SETUP_LOOP', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #108 LOAD_GLOBAL', 0)
+p37 = getfield_gc(p1, descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+setfield_gc(p5, i34, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p5, i36, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+guard_value(p37, ConstPtr(ptr38), descr=<Guard66>) [p0, p1, p37, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i32, p18, i15, f16, f17]
+p39 = getfield_gc(p37, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p39, descr=<Guard67>) [p0, p1, p39, p37, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i32, p18, i15, f16, f17]
+p41 = getfield_gc(ConstPtr(ptr40), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_isnull(p41, descr=<Guard68>) [p0, p1, p41, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i32, p18, i15, f16, f17]
+p43 = getfield_gc(ConstPtr(ptr42), descr=<GcPtrFieldDescr pypy.interpreter.module.Module.inst_w_dict 8>)
+guard_value(p43, ConstPtr(ptr44), descr=<Guard69>) [p0, p1, p43, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i32, p18, i15, f16, f17]
+p45 = getfield_gc(p43, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p45, descr=<Guard70>) [p0, p1, p45, p43, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i32, p18, i15, f16, f17]
+p47 = getfield_gc(ConstPtr(ptr46), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_value(p47, ConstPtr(ptr48), descr=<Guard71>) [p0, p1, p47, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i32, p18, i15, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #111 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #114 LOAD_FAST', 0)
+guard_nonnull_class(p12, ConstClass(W_IntObject), descr=<Guard72>) [p0, p1, p12, p4, p5, p47, p6, p7, p8, p9, p10, p11, p13, i32, p18, i15, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #117 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #120 BINARY_SUBTRACT', 0)
+i50 = getfield_gc_pure(p12, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i52 = int_sub_ovf(i50, 1)
+guard_no_overflow(, descr=<Guard73>) [p0, p1, p12, i52, p4, p5, p47, p6, p7, p8, p9, p10, p11, p13, i32, p18, i15, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #121 CALL_FUNCTION', 0)
+p54 = getfield_gc(ConstPtr(ptr53), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_name 40>)
+p55 = getfield_gc(ConstPtr(ptr53), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_defs 32>)
+i56 = getfield_gc_pure(p55, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i56, descr=<Guard74>) [p0, p1, p54, p55, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i52, i32, p18, i15, f16, f17]
+p57 = getfield_gc_pure(p55, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+i58 = arraylen_gc(p57, descr=<GcPtrArrayDescr>)
+i60 = int_sub(4, i58)
+i62 = int_ge(3, i60)
+guard_true(i62, descr=<Guard75>) [p0, p1, p54, i60, p55, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i52, i32, p18, i15, f16, f17]
+i63 = int_sub(3, i60)
+i64 = getfield_gc_pure(p55, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i64, descr=<Guard76>) [p0, p1, p54, i63, i60, p55, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i52, i32, p18, i15, f16, f17]
+p65 = getfield_gc_pure(p55, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+p66 = getarrayitem_gc(p65, i63, descr=<GcPtrArrayDescr>)
+guard_class(p66, ConstClass(W_IntObject), descr=<Guard77>) [p0, p1, p66, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i52, i32, p18, i15, f16, f17]
+i68 = getfield_gc_pure(p66, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i69 = int_is_zero(i68)
+guard_false(i69, descr=<Guard78>) [p0, p1, i68, i52, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p66, None, i32, p18, i15, f16, f17]
+i72 = int_lt(i68, 0)
+guard_false(i72, descr=<Guard79>) [p0, p1, i68, i52, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p66, None, i32, p18, i15, f16, f17]
+i74 = int_lt(1, i52)
+guard_true(i74, descr=<Guard80>) [p0, p1, i68, i52, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p66, None, i32, p18, i15, f16, f17]
+i75 = int_sub(i52, 1)
+i77 = int_sub(i75, 1)
+i78 = uint_floordiv(i77, i68)
+i80 = int_add(i78, 1)
+i82 = int_lt(i80, 0)
+guard_false(i82, descr=<Guard81>) [p0, p1, i68, i80, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p66, i52, i32, p18, i15, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #124 GET_ITER', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+i84 = int_gt(i80, 0)
+guard_true(i84, descr=<Guard82>) [p0, p1, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i80, i68, None, None, i32, p18, i15, f16, f17]
+i85 = int_add(1, i68)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #128 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #131 LOAD_FAST', 0)
+guard_nonnull_class(p13, 19886912, descr=<Guard83>) [p0, p1, p13, p4, p5, p6, p7, p8, p9, p10, p11, p12, i78, i85, None, i68, None, None, i32, p18, None, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #134 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #137 LOAD_FAST', 0)
+guard_nonnull_class(p11, ConstClass(W_IntObject), descr=<Guard84>) [p0, p1, p11, p4, p5, p13, p6, p7, p8, p9, p10, p12, i78, i85, None, i68, None, None, i32, p18, None, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #140 BINARY_MULTIPLY', 0)
+i88 = getfield_gc_pure(p11, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i89 = int_mul_ovf(i32, i88)
+guard_no_overflow(, descr=<Guard85>) [p0, p1, p11, i89, p4, p5, p13, p6, p7, p8, p9, p10, p12, i78, i85, None, i68, None, None, i32, p18, None, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #141 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #144 BINARY_ADD', 0)
+i90 = int_add_ovf(i89, 1)
+guard_no_overflow(, descr=<Guard86>) [p0, p1, i90, p4, p5, p13, p6, p7, p8, p9, p10, p11, p12, i89, i78, i85, None, i68, None, None, i32, p18, None, f16, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #145 BINARY_SUBSCR', 0)
+i91 = getfield_gc(p13, descr=<SignedFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_len 32>)
+i93 = int_lt(i90, 0)
+guard_false(i93, descr=<Guard87>) [p0, p1, p13, i90, i91, p4, p5, p6, p7, p8, p9, p10, p11, p12, None, i78, i85, None, i68, None, None, i32, p18, None, f16, f17]
+i94 = int_lt(i90, i91)
+guard_true(i94, descr=<Guard88>) [p0, p1, p13, i90, p4, p5, p6, p7, p8, p9, p10, p11, p12, None, i78, i85, None, i68, None, None, i32, p18, None, f16, f17]
+i95 = getfield_gc(p13, descr=<NonGcPtrFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_buffer 24>)
+f96 = getarrayitem_raw(i95, i90, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #146 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #149 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #152 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #155 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #158 BINARY_SUBTRACT', 0)
+i98 = int_sub_ovf(i32, 1)
+guard_no_overflow(, descr=<Guard89>) [p0, p1, i98, p4, p5, p13, p6, p7, p8, p9, p10, p11, p12, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #159 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #162 BINARY_MULTIPLY', 0)
+i99 = int_mul_ovf(i98, i88)
+guard_no_overflow(, descr=<Guard90>) [p0, p1, p11, i99, p4, p5, p13, p6, p7, p8, p9, p10, p12, i98, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #163 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #166 BINARY_ADD', 0)
+i100 = int_add_ovf(i99, 1)
+guard_no_overflow(, descr=<Guard91>) [p0, p1, i100, p4, p5, p13, p6, p7, p8, p9, p10, p11, p12, i99, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #167 BINARY_SUBSCR', 0)
+i102 = int_lt(i100, 0)
+guard_false(i102, descr=<Guard92>) [p0, p1, p13, i100, i91, p4, p5, p6, p7, p8, p9, p10, p11, p12, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+i103 = int_lt(i100, i91)
+guard_true(i103, descr=<Guard93>) [p0, p1, p13, i100, p4, p5, p6, p7, p8, p9, p10, p11, p12, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+f104 = getarrayitem_raw(i95, i100, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #168 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #171 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #174 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #177 BINARY_ADD', 0)
+i106 = int_add_ovf(i32, 1)
+guard_no_overflow(, descr=<Guard94>) [p0, p1, i106, p4, p5, p13, p6, p7, p8, p9, p10, p11, p12, f104, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #178 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #181 BINARY_MULTIPLY', 0)
+i107 = int_mul_ovf(i106, i88)
+guard_no_overflow(, descr=<Guard95>) [p0, p1, p11, i107, p4, p5, p13, p6, p7, p8, p9, p10, p12, i106, f104, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #182 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #185 BINARY_ADD', 0)
+i108 = int_add_ovf(i107, 1)
+guard_no_overflow(, descr=<Guard96>) [p0, p1, i108, p4, p5, p13, p6, p7, p8, p9, p10, p11, p12, i107, None, f104, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #186 BINARY_SUBSCR', 0)
+i110 = int_lt(i108, 0)
+guard_false(i110, descr=<Guard97>) [p0, p1, p13, i108, i91, p4, p5, p6, p7, p8, p9, p10, p11, p12, None, None, f104, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+i111 = int_lt(i108, i91)
+guard_true(i111, descr=<Guard98>) [p0, p1, p13, i108, p4, p5, p6, p7, p8, p9, p10, p11, p12, None, None, f104, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+f112 = getarrayitem_raw(i95, i108, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #187 BINARY_ADD', 0)
+f113 = float_add(f104, f112)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #188 LOAD_FAST', 0)
+guard_nonnull_class(p9, 19800744, descr=<Guard99>) [p0, p1, p9, p4, p5, p6, p7, p8, p10, p11, p12, p13, f113, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #191 BINARY_MULTIPLY', 0)
+f115 = getfield_gc_pure(p9, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f116 = float_mul(f113, f115)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #192 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #195 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #198 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #201 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #202 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #205 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #206 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #209 BINARY_SUBTRACT', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #210 BINARY_SUBSCR', 0)
+i118 = int_lt(i89, 0)
+guard_false(i118, descr=<Guard100>) [p0, p1, p13, i89, i91, p4, p5, p6, p7, p8, p9, p10, p11, p12, f116, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+i119 = int_lt(i89, i91)
+guard_true(i119, descr=<Guard101>) [p0, p1, p13, i89, p4, p5, p6, p7, p8, p9, p10, p11, p12, f116, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+f120 = getarrayitem_raw(i95, i89, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #211 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #214 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #217 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #220 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #221 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #224 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #225 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #228 BINARY_ADD', 0)
+i122 = int_add(i90, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #229 BINARY_SUBSCR', 0)
+i123 = int_lt(i122, i91)
+guard_true(i123, descr=<Guard102>) [p0, p1, p13, i122, p4, p5, p6, p7, p8, p9, p10, p11, p12, f120, f116, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+f124 = getarrayitem_raw(i95, i122, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #230 BINARY_ADD', 0)
+f125 = float_add(f120, f124)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #231 LOAD_FAST', 0)
+guard_nonnull_class(p8, 19800744, descr=<Guard103>) [p0, p1, p8, p4, p5, p6, p7, p9, p10, p11, p12, p13, f125, None, f116, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #234 BINARY_MULTIPLY', 0)
+f127 = getfield_gc_pure(p8, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f128 = float_mul(f125, f127)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #235 BINARY_ADD', 0)
+f129 = float_add(f116, f128)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #236 LOAD_FAST', 0)
+guard_nonnull_class(p10, 19800744, descr=<Guard104>) [p0, p1, p10, p4, p5, p6, p7, p8, p9, p11, p12, p13, f129, None, None, None, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #239 BINARY_MULTIPLY', 0)
+f131 = getfield_gc_pure(p10, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f132 = float_mul(f129, f131)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #240 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #243 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #246 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #249 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #250 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #253 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #254 STORE_SUBSCR', 0)
+setarrayitem_raw(i95, i90, f132, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #255 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #258 LOAD_GLOBAL', 0)
+p134 = getfield_gc(ConstPtr(ptr133), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p134, ConstClass(Function), descr=<Guard105>) [p0, p1, p134, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, None, None, None, None, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #261 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #264 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #267 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #270 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #271 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #274 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #275 BINARY_SUBSCR', 0)
+f136 = getarrayitem_raw(i95, i90, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #276 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #279 BINARY_SUBTRACT', 0)
+f137 = float_sub(f136, f96)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #280 CALL_FUNCTION', 0)
+p138 = getfield_gc(p134, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_code 24>)
+guard_value(p138, ConstPtr(ptr139), descr=<Guard106>) [p0, p1, p138, p134, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f137, None, None, None, None, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+p140 = getfield_gc(p134, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_w_func_globals 64>)
+p141 = getfield_gc(p134, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_closure 16>)
+p143 = call(ConstClass(getexecutioncontext), descr=<GcPtrCallDescr>)
+p144 = getfield_gc(p143, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+i145 = force_token()
+p146 = getfield_gc(p143, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc 72>)
+guard_isnull(p146, descr=<Guard107>) [p0, p1, p143, p146, p4, p5, p134, p6, p7, p8, p9, p10, p11, p12, p13, p144, i145, p140, f137, None, None, None, None, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+i147 = getfield_gc(p143, descr=<NonGcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc 40>)
+i148 = int_is_zero(i147)
+guard_true(i148, descr=<Guard108>) [p0, p1, p143, p4, p5, p134, p6, p7, p8, p9, p10, p11, p12, p13, p144, i145, p140, f137, None, None, None, None, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #0 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #3 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #6 BINARY_MULTIPLY', 1)
+f149 = float_mul(f137, f137)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #7 RETURN_VALUE', 1)
+i150 = int_is_true(i147)
+guard_false(i150, descr=<Guard109>) [p0, p1, p143, p4, p5, p134, p6, p7, p8, p9, p10, p11, p12, p13, f149, p144, i145, p140, f137, None, None, None, None, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, f17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #283 INPLACE_ADD', 0)
+f151 = float_add(f17, f149)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #284 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #287 JUMP_ABSOLUTE', 0)
+i153 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i155 = int_sub(i153, 35)
+setfield_raw(38968960, i155, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i157 = int_lt(i155, 0)
+guard_false(i157, descr=<Guard110>) [p0, p1, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f151, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, f96, None, i78, i85, None, i68, None, None, i32, p18, None, None, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+p159 = new_with_vtable(19865144)
+setfield_gc(p159, 291, descr=<UnsignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_handlerposition 8>)
+setfield_gc(p159, 1, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+setfield_gc(p159, p18, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+p163 = new_with_vtable(19861240)
+setfield_gc(p163, i85, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p163, i78, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+setfield_gc(p163, i68, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+p165 = new_with_vtable(19800744)
+setfield_gc(p165, f151, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+p167 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p167, i32, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p169 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p169, 1, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p171 = new_with_vtable(19800744)
+setfield_gc(p171, f96, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+jump(p1, p0, ConstPtr(ptr172), p159, 2, p4, 0, 125, p5, p163, ConstPtr(ptr176), ConstPtr(ptr177), ConstPtr(ptr178), ConstPtr(ptr179), ConstPtr(ptr180), p6, p7, p8, p9, p10, p165, p11, p12, p13, p167, p169, p171, descr=<Loop1>)
+[5ed623fc609b] jit-log-opt-bridge}
+[5ed63ea5fa94] {jit-log-opt-bridge
+# bridge out of Guard 110 with 23 ops
+[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, f12, f13, i14, i15, i16, i17, p18]
+i19 = force_token()
+setfield_gc(p1, i19, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.vable_token 24>)
+call_may_force(ConstClass(action_dispatcher), p0, p1, descr=<VoidCallDescr>)
+guard_not_forced(, descr=<Guard111>) [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, i14, i17, i16, i15, f12, f13, p18]
+guard_no_exception(, descr=<Guard112>) [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, i14, i17, i16, i15, f12, f13, p18]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+p22 = new_with_vtable(19865144)
+setfield_gc(p22, 291, descr=<UnsignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_handlerposition 8>)
+setfield_gc(p22, p18, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+setfield_gc(p22, 1, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+p26 = new_with_vtable(19861240)
+setfield_gc(p26, i15, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p26, i14, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+setfield_gc(p26, i16, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+p28 = new_with_vtable(19800744)
+setfield_gc(p28, f12, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+p30 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p30, i17, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p32 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p32, 1, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p35 = new_with_vtable(19800744)
+setfield_gc(p35, f13, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+jump(p1, p0, ConstPtr(ptr36), p22, 2, p2, 0, 125, p3, p26, ConstPtr(ptr40), ConstPtr(ptr41), ConstPtr(ptr42), ConstPtr(ptr43), ConstPtr(ptr44), p4, p5, p6, p7, p8, p28, p9, p10, p11, p30, p32, p35, descr=<Loop1>)
+[5ed63ea8ea04] jit-log-opt-bridge}
+[5ed640a0a34c] {jit-log-opt-bridge
+# bridge out of Guard 58 with 13 ops
+[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, f15, f16, i17]
+i18 = force_token()
+setfield_gc(p1, i18, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.vable_token 24>)
+call_may_force(ConstClass(action_dispatcher), p0, p1, descr=<VoidCallDescr>)
+guard_not_forced(, descr=<Guard113>) [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, f15, f16, i17]
+guard_no_exception(, descr=<Guard114>) [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, f15, f16, i17]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+p21 = new_with_vtable(19800744)
+setfield_gc(p21, f15, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+p23 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p23, i17, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p25 = new_with_vtable(19800744)
+setfield_gc(p25, f16, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+jump(p1, p0, ConstPtr(ptr26), p2, 2, p3, 0, 125, p4, p5, ConstPtr(ptr30), ConstPtr(ptr31), ConstPtr(ptr32), ConstPtr(ptr33), ConstPtr(ptr34), p6, p7, p8, p9, p10, p21, p11, p12, p13, p14, p23, p25, descr=<Loop1>)
+[5ed640a1e8c2] jit-log-opt-bridge}
+[5ed6431fc824] {jit-log-opt-bridge
+# bridge out of Guard 24 with 264 ops
+[p0, p1, p2, p3, p4, p5, i6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+guard_value(i6, 0, descr=<Guard115>) [i6, p0, p1, p3, p4, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #290 POP_BLOCK', 0)
+p26 = getfield_gc(p4, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+guard_class(p4, 19865144, descr=<Guard116>) [p0, p1, p4, p3, p26, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+i28 = getfield_gc(p4, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+guard_value(i28, 1, descr=<Guard117>) [p0, p1, i28, p3, p26, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #291 JUMP_ABSOLUTE', 0)
+i31 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i33 = int_sub(i31, 1)
+setfield_raw(38968960, i33, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i35 = int_lt(i33, 0)
+guard_false(i35, descr=<Guard118>) [p0, p1, p3, p26, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+guard_value(p3, ConstPtr(ptr36), descr=<Guard119>) [p0, p1, p3, p26, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #99 FOR_ITER', 0)
+guard_class(p7, 19861240, descr=<Guard120>) [p0, p1, p7, p26, p5, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+i38 = getfield_gc(p7, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+i40 = int_gt(i38, 0)
+guard_true(i40, descr=<Guard121>) [p0, p1, p7, p26, p5, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24]
+i41 = getfield_gc(p7, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+i42 = getfield_gc(p7, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+i43 = int_add(i41, i42)
+i45 = int_sub(i38, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #102 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #105 SETUP_LOOP', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #108 LOAD_GLOBAL', 0)
+p46 = getfield_gc(p1, descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+setfield_gc(p7, i43, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p7, i45, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+guard_value(p46, ConstPtr(ptr47), descr=<Guard122>) [p0, p1, p46, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p26, i41]
+p48 = getfield_gc(p46, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p48, descr=<Guard123>) [p0, p1, p48, p46, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p26, i41]
+p50 = getfield_gc(ConstPtr(ptr49), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_isnull(p50, descr=<Guard124>) [p0, p1, p50, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p26, i41]
+p52 = getfield_gc(ConstPtr(ptr51), descr=<GcPtrFieldDescr pypy.interpreter.module.Module.inst_w_dict 8>)
+guard_value(p52, ConstPtr(ptr53), descr=<Guard125>) [p0, p1, p52, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p26, i41]
+p54 = getfield_gc(p52, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p54, descr=<Guard126>) [p0, p1, p54, p52, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p26, i41]
+p56 = getfield_gc(ConstPtr(ptr55), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_value(p56, ConstPtr(ptr57), descr=<Guard127>) [p0, p1, p56, p5, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #111 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #114 LOAD_FAST', 0)
+guard_nonnull_class(p20, ConstClass(W_IntObject), descr=<Guard128>) [p0, p1, p20, p5, p7, p56, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p21, p23, p24, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #117 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #120 BINARY_SUBTRACT', 0)
+i59 = getfield_gc_pure(p20, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i61 = int_sub_ovf(i59, 1)
+guard_no_overflow(, descr=<Guard129>) [p0, p1, p20, i61, p5, p7, p56, p11, p12, p13, p14, p15, p16, p17, p18, p19, p21, p23, p24, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #121 CALL_FUNCTION', 0)
+p63 = getfield_gc(ConstPtr(ptr62), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_name 40>)
+p64 = getfield_gc(ConstPtr(ptr62), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_defs 32>)
+i65 = getfield_gc_pure(p64, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i65, descr=<Guard130>) [p0, p1, p63, p64, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, i61, p26, i41]
+p66 = getfield_gc_pure(p64, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+i67 = arraylen_gc(p66, descr=<GcPtrArrayDescr>)
+i69 = int_sub(4, i67)
+i71 = int_ge(3, i69)
+guard_true(i71, descr=<Guard131>) [p0, p1, p63, i69, p64, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, i61, p26, i41]
+i72 = int_sub(3, i69)
+i73 = getfield_gc_pure(p64, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i73, descr=<Guard132>) [p0, p1, p63, i72, i69, p64, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, i61, p26, i41]
+p74 = getfield_gc_pure(p64, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+p75 = getarrayitem_gc(p74, i72, descr=<GcPtrArrayDescr>)
+guard_class(p75, ConstClass(W_IntObject), descr=<Guard133>) [p0, p1, p75, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, i61, p26, i41]
+i77 = getfield_gc_pure(p75, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i78 = int_is_zero(i77)
+guard_false(i78, descr=<Guard134>) [p0, p1, i77, i61, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p75, None, p26, i41]
+i81 = int_lt(i77, 0)
+guard_false(i81, descr=<Guard135>) [p0, p1, i77, i61, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p75, None, p26, i41]
+i83 = int_lt(1, i61)
+guard_true(i83, descr=<Guard136>) [p0, p1, i77, i61, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p75, None, p26, i41]
+i84 = int_sub(i61, 1)
+i86 = int_sub(i84, 1)
+i87 = uint_floordiv(i86, i77)
+i89 = int_add(i87, 1)
+i91 = int_lt(i89, 0)
+guard_false(i91, descr=<Guard137>) [p0, p1, i77, i89, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, p75, i61, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #124 GET_ITER', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+i93 = int_gt(i89, 0)
+guard_true(i93, descr=<Guard138>) [p0, p1, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p23, p24, i89, i77, None, None, p26, i41]
+i94 = int_add(1, i77)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #128 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #131 LOAD_FAST', 0)
+guard_nonnull_class(p21, 19886912, descr=<Guard139>) [p0, p1, p21, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p24, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #134 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #137 LOAD_FAST', 0)
+guard_nonnull_class(p19, ConstClass(W_IntObject), descr=<Guard140>) [p0, p1, p19, p5, p7, p21, p11, p12, p13, p14, p15, p16, p17, p18, p20, p24, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #140 BINARY_MULTIPLY', 0)
+i97 = getfield_gc_pure(p19, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i98 = int_mul_ovf(i41, i97)
+guard_no_overflow(, descr=<Guard141>) [p0, p1, p19, i98, p5, p7, p21, p11, p12, p13, p14, p15, p16, p17, p18, p20, p24, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #141 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #144 BINARY_ADD', 0)
+i99 = int_add_ovf(i98, 1)
+guard_no_overflow(, descr=<Guard142>) [p0, p1, i99, p5, p7, p21, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p24, i98, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #145 BINARY_SUBSCR', 0)
+i100 = getfield_gc(p21, descr=<SignedFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_len 32>)
+i102 = int_lt(i99, 0)
+guard_false(i102, descr=<Guard143>) [p0, p1, p21, i99, i100, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p24, None, i87, i94, None, i77, None, None, p26, i41]
+i103 = int_lt(i99, i100)
+guard_true(i103, descr=<Guard144>) [p0, p1, p21, i99, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p24, None, i87, i94, None, i77, None, None, p26, i41]
+i104 = getfield_gc(p21, descr=<NonGcPtrFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_buffer 24>)
+f105 = getarrayitem_raw(i104, i99, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #146 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #149 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #152 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #155 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #158 BINARY_SUBTRACT', 0)
+i107 = int_sub_ovf(i41, 1)
+guard_no_overflow(, descr=<Guard145>) [p0, p1, i107, p5, p7, p21, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #159 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #162 BINARY_MULTIPLY', 0)
+i108 = int_mul_ovf(i107, i97)
+guard_no_overflow(, descr=<Guard146>) [p0, p1, p19, i108, p5, p7, p21, p11, p12, p13, p14, p15, p16, p17, p18, p20, i107, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #163 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #166 BINARY_ADD', 0)
+i109 = int_add_ovf(i108, 1)
+guard_no_overflow(, descr=<Guard147>) [p0, p1, i109, p5, p7, p21, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, i108, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #167 BINARY_SUBSCR', 0)
+i111 = int_lt(i109, 0)
+guard_false(i111, descr=<Guard148>) [p0, p1, p21, i109, i100, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+i112 = int_lt(i109, i100)
+guard_true(i112, descr=<Guard149>) [p0, p1, p21, i109, p5, p7, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+f113 = getarrayitem_raw(i104, i109, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #168 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #171 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #174 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #177 BINARY_ADD', 0)
+i115 = int_add_ovf(i41, 1)
+guard_no_overflow(, descr=<Guard150>) [p0, p1, i115, p5, p7, p21, p12, p13, p14, p15, p16, p17, p18, p19, p20, f113, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #178 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #181 BINARY_MULTIPLY', 0)
+i116 = int_mul_ovf(i115, i97)
+guard_no_overflow(, descr=<Guard151>) [p0, p1, p19, i116, p5, p7, p21, p12, p13, p14, p15, p16, p17, p18, p20, i115, f113, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #182 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #185 BINARY_ADD', 0)
+i117 = int_add_ovf(i116, 1)
+guard_no_overflow(, descr=<Guard152>) [p0, p1, i117, p5, p7, p21, p12, p13, p14, p15, p16, p17, p18, p19, p20, i116, None, f113, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #186 BINARY_SUBSCR', 0)
+i119 = int_lt(i117, 0)
+guard_false(i119, descr=<Guard153>) [p0, p1, p21, i117, i100, p5, p7, p12, p13, p14, p15, p16, p17, p18, p19, p20, None, None, f113, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+i120 = int_lt(i117, i100)
+guard_true(i120, descr=<Guard154>) [p0, p1, p21, i117, p5, p7, p12, p13, p14, p15, p16, p17, p18, p19, p20, None, None, f113, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+f121 = getarrayitem_raw(i104, i117, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #187 BINARY_ADD', 0)
+f122 = float_add(f113, f121)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #188 LOAD_FAST', 0)
+guard_nonnull_class(p16, 19800744, descr=<Guard155>) [p0, p1, p16, p5, p7, p12, p13, p14, p15, p17, p18, p19, p20, p21, f122, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #191 BINARY_MULTIPLY', 0)
+f124 = getfield_gc_pure(p16, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f125 = float_mul(f122, f124)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #192 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #195 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #198 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #201 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #202 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #205 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #206 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #209 BINARY_SUBTRACT', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #210 BINARY_SUBSCR', 0)
+i127 = int_lt(i98, 0)
+guard_false(i127, descr=<Guard156>) [p0, p1, p21, i98, i100, p5, p7, p12, p13, p14, p15, p16, p17, p18, p19, p20, f125, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+i128 = int_lt(i98, i100)
+guard_true(i128, descr=<Guard157>) [p0, p1, p21, i98, p5, p7, p12, p13, p14, p15, p16, p17, p18, p19, p20, f125, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+f129 = getarrayitem_raw(i104, i98, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #211 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #214 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #217 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #220 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #221 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #224 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #225 LOAD_CONST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #228 BINARY_ADD', 0)
+i131 = int_add(i99, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #229 BINARY_SUBSCR', 0)
+i132 = int_lt(i131, i100)
+guard_true(i132, descr=<Guard158>) [p0, p1, p21, i131, p5, p7, p13, p14, p15, p16, p17, p18, p19, p20, f129, f125, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+f133 = getarrayitem_raw(i104, i131, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #230 BINARY_ADD', 0)
+f134 = float_add(f129, f133)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #231 LOAD_FAST', 0)
+guard_nonnull_class(p15, 19800744, descr=<Guard159>) [p0, p1, p15, p5, p7, p13, p14, p16, p17, p18, p19, p20, p21, f134, None, f125, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #234 BINARY_MULTIPLY', 0)
+f136 = getfield_gc_pure(p15, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f137 = float_mul(f134, f136)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #235 BINARY_ADD', 0)
+f138 = float_add(f125, f137)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #236 LOAD_FAST', 0)
+guard_nonnull_class(p17, 19800744, descr=<Guard160>) [p0, p1, p17, p5, p7, p13, p14, p15, p16, p18, p19, p20, p21, f138, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #239 BINARY_MULTIPLY', 0)
+f140 = getfield_gc_pure(p17, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f141 = float_mul(f138, f140)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #240 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #243 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #246 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #249 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #250 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #253 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #254 STORE_SUBSCR', 0)
+setarrayitem_raw(i104, i99, f141, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #255 LOAD_FAST', 0)
+guard_nonnull_class(p18, 19800744, descr=<Guard161>) [p0, p1, p18, p5, p7, p13, p14, p15, p16, p17, p19, p20, p21, None, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #258 LOAD_GLOBAL', 0)
+p144 = getfield_gc(ConstPtr(ptr143), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p144, ConstClass(Function), descr=<Guard162>) [p0, p1, p144, p5, p7, p18, p13, p14, p15, p16, p17, p19, p20, p21, None, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #261 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #264 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #267 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #270 BINARY_MULTIPLY', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #271 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #274 BINARY_ADD', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #275 BINARY_SUBSCR', 0)
+f146 = getarrayitem_raw(i104, i99, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #276 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #279 BINARY_SUBTRACT', 0)
+f147 = float_sub(f146, f105)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #280 CALL_FUNCTION', 0)
+p148 = getfield_gc(p144, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_code 24>)
+guard_value(p148, ConstPtr(ptr149), descr=<Guard163>) [p0, p1, p148, p144, p5, p7, p18, p13, p14, p15, p16, p17, p19, p20, p21, f147, None, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+p150 = getfield_gc(p144, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_w_func_globals 64>)
+p151 = getfield_gc(p144, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_closure 16>)
+p153 = call(ConstClass(getexecutioncontext), descr=<GcPtrCallDescr>)
+p154 = getfield_gc(p153, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+i155 = force_token()
+p156 = getfield_gc(p153, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc 72>)
+guard_isnull(p156, descr=<Guard164>) [p0, p1, p153, p156, p5, p7, p18, p144, p13, p14, p15, p16, p17, p19, p20, p21, p150, p154, i155, f147, None, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+i157 = getfield_gc(p153, descr=<NonGcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc 40>)
+i158 = int_is_zero(i157)
+guard_true(i158, descr=<Guard165>) [p0, p1, p153, p5, p7, p18, p144, p13, p14, p15, p16, p17, p19, p20, p21, p150, p154, i155, f147, None, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #0 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #3 LOAD_FAST', 1)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #6 BINARY_MULTIPLY', 1)
+f159 = float_mul(f147, f147)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #7 RETURN_VALUE', 1)
+i160 = int_is_true(i157)
+guard_false(i160, descr=<Guard166>) [p0, p1, p153, p5, p7, p18, p144, p13, p14, p15, p16, p17, p19, p20, p21, f159, p150, p154, i155, f147, None, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #283 INPLACE_ADD', 0)
+f161 = getfield_gc_pure(p18, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f162 = float_add(f161, f159)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #284 STORE_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #287 JUMP_ABSOLUTE', 0)
+i164 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i166 = int_sub(i164, 34)
+setfield_raw(38968960, i166, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i168 = int_lt(i166, 0)
+guard_false(i168, descr=<Guard167>) [p0, p1, p5, p7, p13, p14, p15, p16, p17, p19, p20, p21, f162, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, f105, None, i87, i94, None, i77, None, None, p26, i41]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 0)
+p170 = new_with_vtable(19865144)
+setfield_gc(p170, 291, descr=<UnsignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_handlerposition 8>)
+setfield_gc(p170, 1, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+setfield_gc(p170, p26, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+p174 = new_with_vtable(19861240)
+setfield_gc(p174, i94, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p174, i87, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+setfield_gc(p174, i77, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+p176 = new_with_vtable(19800744)
+setfield_gc(p176, f162, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+p178 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p178, i41, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p180 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p180, 1, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+p182 = new_with_vtable(19800744)
+setfield_gc(p182, f105, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+jump(p1, p0, ConstPtr(ptr183), p170, 2, p5, 0, 125, p7, p174, ConstPtr(ptr187), ConstPtr(ptr188), ConstPtr(ptr189), ConstPtr(ptr190), ConstPtr(ptr191), p13, p14, p15, p16, p17, p176, p19, p20, p21, p178, p180, p182, descr=<Loop1>)
+[5ed6432f4a2c] jit-log-opt-bridge}
+[5ed66199330c] {jit-log-opt-bridge
+# bridge out of Guard 65 with 72 ops
+[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, i14, f15, f16]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #294 POP_BLOCK', 0)
+p17 = getfield_gc(p3, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+guard_class(p3, 19865144, descr=<Guard168>) [p0, p1, p3, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+i19 = getfield_gc(p3, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+guard_value(i19, 0, descr=<Guard169>) [p0, p1, i19, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #295 LOAD_GLOBAL', 0)
+p21 = getfield_gc(p1, descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+guard_value(p21, ConstPtr(ptr22), descr=<Guard170>) [p0, p1, p21, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+p23 = getfield_gc(p21, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p23, descr=<Guard171>) [p0, p1, p23, p21, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+p25 = getfield_gc(ConstPtr(ptr24), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p25, 19905496, descr=<Guard172>) [p0, p1, p25, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #298 LOOKUP_METHOD', 0)
+p27 = getfield_gc(p25, descr=<GcPtrFieldDescr pypy.interpreter.module.Module.inst_w_dict 8>)
+guard_value(p27, ConstPtr(ptr28), descr=<Guard173>) [p0, p1, p25, p27, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+p29 = getfield_gc(p27, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p29, descr=<Guard174>) [p0, p1, p25, p29, p27, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+p31 = getfield_gc(ConstPtr(ptr30), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_value(p31, ConstPtr(ptr32), descr=<Guard175>) [p0, p1, p31, p25, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #301 LOAD_FAST', 0)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #304 CALL_METHOD', 0)
+call(ConstClass(set_errno), 0, descr=<VoidCallDescr>)
+f36 = call(ConstClass(sqrt), f16, descr=<FloatCallDescr>)
+i38 = call(ConstClass(get_errno), descr=<INTCallDescr>)
+i39 = float_ne(f36, f36)
+guard_false(i39, descr=<Guard176>) [p0, p1, i38, f36, f16, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, None, i14, f15]
+i42 = float_eq(f36, inf)
+i44 = float_eq(f36, -inf)
+i45 = int_or(i42, i44)
+i46 = int_is_true(i45)
+guard_false(i46, descr=<Guard177>) [p0, p1, i38, f36, f16, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, None, i14, f15]
+i47 = int_is_true(i38)
+guard_false(i47, descr=<Guard178>) [p0, p1, i38, f36, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f16, i14, f15]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #307 RETURN_VALUE', 0)
+guard_isnull(p17, descr=<Guard179>) [p0, p1, p17, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, f36, f16, i14, f15]
+p48 = getfield_gc(p1, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_valuestack_w 120>)
+setarrayitem_gc(p48, 0, ConstPtr(ptr50), descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p48, 1, ConstPtr(ptr52), descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p48, 2, ConstPtr(ptr52), descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p48, 3, ConstPtr(ptr55), descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p48, 4, ConstPtr(ptr55), descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p48, 5, ConstPtr(ptr55), descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p48, 6, ConstPtr(ptr55), descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p48, 7, p5, descr=<GcPtrArrayDescr>)
+p60 = getfield_gc(p1, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_fastlocals_w 56>)
+setarrayitem_gc(p60, 0, p6, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p60, 1, p7, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p60, 2, p8, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p60, 3, p9, descr=<GcPtrArrayDescr>)
+p66 = new_with_vtable(19800744)
+setfield_gc(p66, f16, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p60, 4, p66, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p60, 5, p10, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p60, 6, p11, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p60, 7, p12, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p60, 8, p13, descr=<GcPtrArrayDescr>)
+p73 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p73, i14, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+setarrayitem_gc(p60, 9, p73, descr=<GcPtrArrayDescr>)
+p76 = new_with_vtable(19800744)
+setfield_gc(p76, f15, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p60, 10, p76, descr=<GcPtrArrayDescr>)
+setfield_gc(p1, 1, descr=<BoolFieldDescr pypy.interpreter.pyframe.PyFrame.inst_frame_finished_execution 148>)
+setfield_gc(p1, ConstPtr(ptr79), descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_pycode 112>)
+setfield_gc(p1, ConstPtr(ptr55), descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_lastblock 104>)
+setfield_gc(p1, 0, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.inst_valuestackdepth 128>)
+setfield_gc(p1, p4, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_last_exception 88>)
+setfield_gc(p1, 0, descr=<BoolFieldDescr pypy.interpreter.pyframe.PyFrame.inst_is_being_profiled 149>)
+setfield_gc(p1, 307, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.inst_last_instr 96>)
+p84 = new_with_vtable(19800744)
+setfield_gc(p84, f36, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+finish(p84, descr=<DoneWithThisFrameDescrRef object at 0x140bcc0>)
+[5ed6619e9448] jit-log-opt-bridge}
+[5ed74f2eef6e] {jit-log-opt-loop
+# Loop 2 : loop with 394 ops
+[p0, p1, p2, p3, p4, p5, p6, p7, i8, f9, i10, i11, p12, p13]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #21 LOAD_FAST', 0)
+guard_nonnull_class(p7, 19800744, descr=<Guard180>) [p1, p0, p7, p2, p3, p4, p5, p6, i8]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #24 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #27 COMPARE_OP', 0)
+f15 = getfield_gc_pure(p7, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+i16 = float_gt(f15, f9)
+guard_true(i16, descr=<Guard181>) [p1, p0, p6, p7, p2, p3, p4, p5, i8]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #30 POP_JUMP_IF_FALSE', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #33 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #36 POP_JUMP_IF_FALSE', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #39 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #42 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #45 COMPARE_OP', 0)
+i17 = int_ge(i8, i10)
+guard_false(i17, descr=<Guard182>) [p1, p0, p5, p2, p3, p4, p6, p7, i8]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #48 POP_JUMP_IF_FALSE', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #55 LOAD_GLOBAL', 0)
+p18 = getfield_gc(p0, descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+guard_value(p18, ConstPtr(ptr19), descr=<Guard183>) [p1, p0, p18, p2, p3, p4, p5, p6, p7, i8]
+p20 = getfield_gc(p18, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p20, descr=<Guard184>) [p1, p0, p20, p18, p2, p3, p4, p5, p6, p7, i8]
+p22 = getfield_gc(ConstPtr(ptr21), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p22, ConstClass(Function), descr=<Guard185>) [p1, p0, p22, p2, p3, p4, p5, p6, p7, i8]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #58 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #61 CALL_FUNCTION', 0)
+p24 = getfield_gc(p22, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_code 24>)
+guard_value(p24, ConstPtr(ptr25), descr=<Guard186>) [p1, p0, p24, p22, p2, p3, p4, p5, p6, p7, i8]
+p26 = getfield_gc(p22, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_w_func_globals 64>)
+p27 = getfield_gc(p22, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_closure 16>)
+i28 = force_token()
+i29 = int_is_zero(i11)
+guard_true(i29, descr=<Guard187>) [p1, p0, p12, p2, p3, p22, p4, p5, p6, p7, p26, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #0 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #3 LOAD_ATTR', 1)
+p30 = getfield_gc(p4, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst_map 48>)
+guard_value(p30, ConstPtr(ptr31), descr=<Guard188>) [p1, p0, p12, p4, p30, p2, p3, p22, p5, p6, p7, p26, p13, i28, i8]
+p33 = getfield_gc(ConstPtr(ptr32), descr=<GcPtrFieldDescr pypy.objspace.std.typeobject.W_TypeObject.inst__version_tag 16>)
+guard_value(p33, ConstPtr(ptr34), descr=<Guard189>) [p1, p0, p12, p4, p33, p2, p3, p22, p5, p6, p7, p26, p13, i28, i8]
+p35 = getfield_gc(p4, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value2 24>)
+guard_nonnull_class(p35, 19800744, descr=<Guard190>) [p1, p0, p12, p35, p4, p2, p3, p22, p5, p6, p7, p26, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #6 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #9 LOAD_ATTR', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #12 BINARY_MULTIPLY', 1)
+f37 = getfield_gc_pure(p35, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f38 = float_mul(f37, f37)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #13 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #16 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #19 LOAD_ATTR', 1)
+p39 = getfield_gc(p4, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value3 32>)
+guard_nonnull_class(p39, 19800744, descr=<Guard191>) [p1, p0, p12, p39, p4, p2, p3, p22, p5, p6, p7, f38, p26, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #22 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #25 LOAD_ATTR', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #28 BINARY_MULTIPLY', 1)
+f41 = getfield_gc_pure(p39, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f42 = float_mul(f41, f41)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #29 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #32 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #35 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #38 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #41 BINARY_ADD', 1)
+f43 = float_add(f38, f42)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #42 BINARY_DIVIDE', 1)
+i45 = float_eq(f43, 0.000000)
+guard_false(i45, descr=<Guard192>) [p1, p0, p12, f43, p2, p3, p22, p4, p5, p6, p7, f42, f38, p26, p13, i28, i8]
+f47 = float_truediv(0.500000, f43)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #43 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #46 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #49 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #52 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #55 LOAD_ATTR', 1)
+p48 = getfield_gc(p4, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value0 8>)
+guard_nonnull_class(p48, ConstClass(W_IntObject), descr=<Guard193>) [p1, p0, p12, p48, p4, p2, p3, p22, p5, p6, p7, f47, f42, f38, p26, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #58 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #61 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #64 LOAD_ATTR', 1)
+p50 = getfield_gc(p4, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value1 16>)
+guard_nonnull_class(p50, ConstClass(W_IntObject), descr=<Guard194>) [p1, p0, p12, p50, p4, p2, p3, p22, p5, p6, p7, p48, f47, f42, f38, p26, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #67 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #70 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #73 LOAD_ATTR', 1)
+p52 = getfield_gc(p4, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value4 40>)
+guard_nonnull_class(p52, 19886912, descr=<Guard195>) [p1, p0, p12, p52, p4, p2, p3, p22, p5, p6, p7, p50, p48, f47, f42, f38, p26, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #76 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #79 SETUP_LOOP', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #82 LOAD_GLOBAL', 1)
+guard_value(p26, ConstPtr(ptr54), descr=<Guard196>) [p1, p0, p12, p26, p2, p3, p22, p4, p5, p6, p7, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p56 = getfield_gc(p26, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p56, descr=<Guard197>) [p1, p0, p12, p56, p26, p2, p3, p22, p4, p5, p6, p7, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p58 = getfield_gc(ConstPtr(ptr57), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_isnull(p58, descr=<Guard198>) [p1, p0, p12, p58, p2, p3, p22, p4, p5, p6, p7, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p60 = getfield_gc(ConstPtr(ptr59), descr=<GcPtrFieldDescr pypy.interpreter.module.Module.inst_w_dict 8>)
+guard_value(p60, ConstPtr(ptr61), descr=<Guard199>) [p1, p0, p12, p60, p2, p3, p22, p4, p5, p6, p7, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p62 = getfield_gc(p60, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p62, descr=<Guard200>) [p1, p0, p12, p62, p60, p2, p3, p22, p4, p5, p6, p7, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p64 = getfield_gc(ConstPtr(ptr63), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_value(p64, ConstPtr(ptr65), descr=<Guard201>) [p1, p0, p12, p64, p2, p3, p22, p4, p5, p6, p7, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #85 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #88 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #91 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #94 BINARY_SUBTRACT', 1)
+i66 = getfield_gc_pure(p48, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i68 = int_sub_ovf(i66, 1)
+guard_no_overflow(, descr=<Guard202>) [p1, p0, p12, p48, i68, p2, p3, p22, p4, p5, p6, p7, p64, p52, p50, None, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #95 CALL_FUNCTION', 1)
+p70 = getfield_gc(ConstPtr(ptr69), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_name 40>)
+p71 = getfield_gc(ConstPtr(ptr69), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_defs 32>)
+i72 = getfield_gc_pure(p71, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i72, descr=<Guard203>) [p1, p0, p12, p70, p71, p2, p3, p22, p4, p5, p6, p7, i68, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p73 = getfield_gc_pure(p71, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+i74 = arraylen_gc(p73, descr=<GcPtrArrayDescr>)
+i76 = int_sub(4, i74)
+i78 = int_ge(3, i76)
+guard_true(i78, descr=<Guard204>) [p1, p0, p12, p70, i76, p71, p2, p3, p22, p4, p5, p6, p7, i68, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i79 = int_sub(3, i76)
+i80 = getfield_gc_pure(p71, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i80, descr=<Guard205>) [p1, p0, p12, p70, i79, i76, p71, p2, p3, p22, p4, p5, p6, p7, i68, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p81 = getfield_gc_pure(p71, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+p82 = getarrayitem_gc(p81, i79, descr=<GcPtrArrayDescr>)
+guard_class(p82, ConstClass(W_IntObject), descr=<Guard206>) [p1, p0, p12, p82, p2, p3, p22, p4, p5, p6, p7, i68, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i84 = getfield_gc_pure(p82, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i85 = int_is_zero(i84)
+guard_false(i85, descr=<Guard207>) [p1, p0, p12, i84, i68, p2, p3, p22, p4, p5, p6, p7, p82, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i87 = int_lt(i84, 0)
+guard_false(i87, descr=<Guard208>) [p1, p0, p12, i84, i68, p2, p3, p22, p4, p5, p6, p7, p82, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i89 = int_lt(1, i68)
+guard_true(i89, descr=<Guard209>) [p1, p0, p12, i84, i68, p2, p3, p22, p4, p5, p6, p7, p82, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i90 = int_sub(i68, 1)
+i92 = int_sub(i90, 1)
+i93 = uint_floordiv(i92, i84)
+i95 = int_add(i93, 1)
+i97 = int_lt(i95, 0)
+guard_false(i97, descr=<Guard210>) [p1, p0, p12, i84, i95, p2, p3, p22, p4, p5, p6, p7, p82, i68, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #98 GET_ITER', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #99 FOR_ITER', 1)
+i99 = int_gt(i95, 0)
+guard_true(i99, descr=<Guard211>) [p1, p0, p12, p2, p3, p22, p4, p5, p6, p7, i84, i95, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i100 = int_add(1, i84)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #102 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #105 SETUP_LOOP', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #108 LOAD_GLOBAL', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #111 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #114 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #117 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #120 BINARY_SUBTRACT', 1)
+i101 = getfield_gc_pure(p50, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i103 = int_sub_ovf(i101, 1)
+guard_no_overflow(, descr=<Guard212>) [p1, p0, p12, p50, i103, p2, p3, p22, p4, p5, p6, p7, i100, i93, i84, None, None, None, None, p52, None, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #121 CALL_FUNCTION', 1)
+i104 = getfield_gc_pure(p71, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i104, descr=<Guard213>) [p1, p0, p12, p70, p71, p2, p3, p22, p4, p5, p6, p7, i103, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p105 = getfield_gc_pure(p71, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+i106 = arraylen_gc(p105, descr=<GcPtrArrayDescr>)
+i108 = int_sub(4, i106)
+i110 = int_ge(3, i108)
+guard_true(i110, descr=<Guard214>) [p1, p0, p12, p70, i108, p71, p2, p3, p22, p4, p5, p6, p7, i103, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i111 = int_sub(3, i108)
+i112 = getfield_gc_pure(p71, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i112, descr=<Guard215>) [p1, p0, p12, p70, i111, i108, p71, p2, p3, p22, p4, p5, p6, p7, i103, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p113 = getfield_gc_pure(p71, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+p114 = getarrayitem_gc(p113, i111, descr=<GcPtrArrayDescr>)
+guard_class(p114, ConstClass(W_IntObject), descr=<Guard216>) [p1, p0, p12, p114, p2, p3, p22, p4, p5, p6, p7, i103, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i116 = getfield_gc_pure(p114, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i117 = int_is_zero(i116)
+guard_false(i117, descr=<Guard217>) [p1, p0, p12, i116, i103, p2, p3, p22, p4, p5, p6, p7, p114, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i119 = int_lt(i116, 0)
+guard_false(i119, descr=<Guard218>) [p1, p0, p12, i116, i103, p2, p3, p22, p4, p5, p6, p7, p114, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i121 = int_lt(1, i103)
+guard_true(i121, descr=<Guard219>) [p1, p0, p12, i116, i103, p2, p3, p22, p4, p5, p6, p7, p114, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i122 = int_sub(i103, 1)
+i124 = int_sub(i122, 1)
+i125 = uint_floordiv(i124, i116)
+i127 = int_add(i125, 1)
+i129 = int_lt(i127, 0)
+guard_false(i129, descr=<Guard220>) [p1, p0, p12, i116, i127, p2, p3, p22, p4, p5, p6, p7, p114, i103, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #124 GET_ITER', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 1)
+i131 = int_gt(i127, 0)
+guard_true(i131, descr=<Guard221>) [p1, p0, p12, p2, p3, p22, p4, p5, p6, p7, i116, i127, None, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i132 = int_add(1, i116)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #128 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #131 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #134 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #137 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #140 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #141 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #144 BINARY_ADD', 1)
+i133 = int_add_ovf(i66, 1)
+guard_no_overflow(, descr=<Guard222>) [p1, p0, p12, i133, p2, p3, p22, p4, p5, p6, p7, i132, i125, i66, i116, None, None, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #145 BINARY_SUBSCR', 1)
+i134 = getfield_gc(p52, descr=<SignedFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_len 32>)
+i135 = int_lt(i133, i134)
+guard_true(i135, descr=<Guard223>) [p1, p0, p12, p52, i133, p2, p3, p22, p4, p5, p6, p7, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, None, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i136 = getfield_gc(p52, descr=<NonGcPtrFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_buffer 24>)
+f137 = getarrayitem_raw(i136, i133, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #146 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #149 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #152 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #155 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #158 BINARY_SUBTRACT', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #159 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #162 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #163 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #166 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #167 BINARY_SUBSCR', 1)
+f138 = getarrayitem_raw(i136, 1, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #168 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #171 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #174 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #177 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #178 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #181 BINARY_MULTIPLY', 1)
+i140 = int_mul_ovf(2, i66)
+guard_no_overflow(, descr=<Guard224>) [p1, p0, p12, p48, i140, p2, p3, p22, p4, p5, p6, p7, f138, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, p52, p50, None, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #182 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #185 BINARY_ADD', 1)
+i141 = int_add_ovf(i140, 1)
+guard_no_overflow(, descr=<Guard225>) [p1, p0, p12, i141, p2, p3, p22, p4, p5, p6, p7, i140, f138, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #186 BINARY_SUBSCR', 1)
+i143 = int_lt(i141, 0)
+guard_false(i143, descr=<Guard226>) [p1, p0, p12, p52, i141, i134, p2, p3, p22, p4, p5, p6, p7, None, f138, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, None, p50, p48, f47, f42, f38, None, p13, i28, i8]
+i144 = int_lt(i141, i134)
+guard_true(i144, descr=<Guard227>) [p1, p0, p12, p52, i141, p2, p3, p22, p4, p5, p6, p7, None, f138, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, None, p50, p48, f47, f42, f38, None, p13, i28, i8]
+f145 = getarrayitem_raw(i136, i141, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #187 BINARY_ADD', 1)
+f146 = float_add(f138, f145)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #188 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #191 BINARY_MULTIPLY', 1)
+f147 = float_mul(f146, f42)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #192 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #195 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #198 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #201 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #202 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #205 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #206 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #209 BINARY_SUBTRACT', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #210 BINARY_SUBSCR', 1)
+i148 = int_lt(i66, i134)
+guard_true(i148, descr=<Guard228>) [p1, p0, p12, p52, i66, p2, p3, p22, p4, p5, p6, p7, f147, None, None, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, None, p50, p48, f47, f42, f38, None, p13, i28, i8]
+f149 = getarrayitem_raw(i136, i66, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #211 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #214 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #217 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #220 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #221 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #224 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #225 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #228 BINARY_ADD', 1)
+i151 = int_add(i133, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #229 BINARY_SUBSCR', 1)
+i152 = int_lt(i151, i134)
+guard_true(i152, descr=<Guard229>) [p1, p0, p12, p52, i151, p2, p3, p22, p4, p5, p6, p7, f149, f147, None, None, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, None, p50, p48, f47, f42, f38, None, p13, i28, i8]
+f153 = getarrayitem_raw(i136, i151, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #230 BINARY_ADD', 1)
+f154 = float_add(f149, f153)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #231 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #234 BINARY_MULTIPLY', 1)
+f155 = float_mul(f154, f38)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #235 BINARY_ADD', 1)
+f156 = float_add(f147, f155)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #236 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #239 BINARY_MULTIPLY', 1)
+f157 = float_mul(f156, f47)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #240 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #243 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #246 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #249 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #250 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #253 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #254 STORE_SUBSCR', 1)
+setarrayitem_raw(i136, i133, f157, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #255 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #258 LOAD_GLOBAL', 1)
+p159 = getfield_gc(ConstPtr(ptr158), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p159, ConstClass(Function), descr=<Guard230>) [p1, p0, p12, p159, p2, p3, p22, p4, p5, p6, p7, None, None, None, None, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #261 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #264 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #267 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #270 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #271 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #274 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #275 BINARY_SUBSCR', 1)
+f161 = getarrayitem_raw(i136, i133, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #276 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #279 BINARY_SUBTRACT', 1)
+f162 = float_sub(f161, f137)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #280 CALL_FUNCTION', 1)
+p163 = getfield_gc(p159, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_code 24>)
+guard_value(p163, ConstPtr(ptr164), descr=<Guard231>) [p1, p0, p12, p163, p159, p2, p3, p22, p4, p5, p6, p7, f162, None, None, None, None, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+p165 = getfield_gc(p159, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_w_func_globals 64>)
+p166 = getfield_gc(p159, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_closure 16>)
+i167 = force_token()
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #0 LOAD_FAST', 2)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #3 LOAD_FAST', 2)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #6 BINARY_MULTIPLY', 2)
+f168 = float_mul(f162, f162)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #7 RETURN_VALUE', 2)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #283 INPLACE_ADD', 1)
+f170 = float_add(0.000000, f168)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #284 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #287 JUMP_ABSOLUTE', 1)
+i172 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i174 = int_sub(i172, 100)
+setfield_raw(38968960, i174, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i176 = int_lt(i174, 0)
+guard_false(i176, descr=<Guard232>) [p1, p0, p12, p2, p3, p22, p4, p5, p6, p7, f170, None, None, None, None, None, f137, i132, i125, None, i116, None, None, None, i100, i93, i84, None, None, None, None, p52, p50, p48, f47, f42, f38, None, p13, i28, i8]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 1)
+i177 = force_token()
+p179 = new_with_vtable(19809200)
+setfield_gc(p179, i28, descr=<SignedFieldDescr JitVirtualRef.virtual_token 8>)
+setfield_gc(p12, p179, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+setfield_gc(p0, i177, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.vable_token 24>)
+p181 = new_with_vtable(19863424)
+setfield_gc(p181, p13, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_f_backref 48>)
+setfield_gc(p181, ConstPtr(ptr54), descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+setfield_gc(p181, 34, descr=<INTFieldDescr pypy.interpreter.pyframe.PyFrame.inst_f_lineno 144>)
+setfield_gc(p181, ConstPtr(ptr25), descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_pycode 112>)
+p184 = new_array(8, descr=<GcPtrArrayDescr>)
+p186 = new_with_vtable(19861240)
+setfield_gc(p186, i100, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p186, i93, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+setfield_gc(p186, i84, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+setarrayitem_gc(p184, 0, p186, descr=<GcPtrArrayDescr>)
+p189 = new_with_vtable(19861240)
+setfield_gc(p189, i132, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p189, i125, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+setfield_gc(p189, i116, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+setarrayitem_gc(p184, 1, p189, descr=<GcPtrArrayDescr>)
+setfield_gc(p181, p184, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_valuestack_w 120>)
+setfield_gc(p181, 125, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.inst_last_instr 96>)
+p193 = new_with_vtable(19865144)
+setfield_gc(p193, 291, descr=<UnsignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_handlerposition 8>)
+setfield_gc(p193, 1, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+p197 = new_with_vtable(19865144)
+setfield_gc(p197, 295, descr=<UnsignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_handlerposition 8>)
+setfield_gc(p193, p197, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+setfield_gc(p181, p193, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_lastblock 104>)
+p200 = new_array(11, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p200, 0, p4, descr=<GcPtrArrayDescr>)
+p203 = new_with_vtable(19800744)
+setfield_gc(p203, f38, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p200, 1, p203, descr=<GcPtrArrayDescr>)
+p206 = new_with_vtable(19800744)
+setfield_gc(p206, f42, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p200, 2, p206, descr=<GcPtrArrayDescr>)
+p209 = new_with_vtable(19800744)
+setfield_gc(p209, f47, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p200, 3, p209, descr=<GcPtrArrayDescr>)
+p212 = new_with_vtable(19800744)
+setfield_gc(p212, f170, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p200, 4, p212, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p200, 5, p48, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p200, 6, p50, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p200, 7, p52, descr=<GcPtrArrayDescr>)
+p218 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p218, 1, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+setarrayitem_gc(p200, 8, p218, descr=<GcPtrArrayDescr>)
+p221 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p221, 1, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+setarrayitem_gc(p200, 9, p221, descr=<GcPtrArrayDescr>)
+p224 = new_with_vtable(19800744)
+setfield_gc(p224, f137, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p200, 10, p224, descr=<GcPtrArrayDescr>)
+setfield_gc(p181, p200, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_fastlocals_w 56>)
+setfield_gc(p181, 2, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.inst_valuestackdepth 128>)
+p235 = call_assembler(p181, p12, ConstPtr(ptr25), p193, 2, ConstPtr(ptr227), 0, 125, p186, p189, ConstPtr(ptr229), ConstPtr(ptr230), ConstPtr(ptr231), ConstPtr(ptr232), ConstPtr(ptr233), ConstPtr(ptr234), p4, p203, p206, p209, p212, p48, p50, p52, p218, p221, p224, descr=<Loop1>)
+guard_not_forced(, descr=<Guard233>) [p1, p0, p12, p181, p235, p179, p2, p3, p22, p4, p5, p6, p7, i8]
+guard_no_exception(, descr=<Guard234>) [p1, p0, p12, p181, p235, p179, p2, p3, p22, p4, p5, p6, p7, i8]
+p236 = getfield_gc(p12, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc 72>)
+guard_isnull(p236, descr=<Guard235>) [p1, p0, p12, p235, p181, p236, p179, p2, p3, p22, p4, p5, p6, p7, i8]
+i237 = ptr_eq(p181, p0)
+guard_false(i237, descr=<Guard236>) [p1, p0, p12, p235, p181, p179, p2, p3, p22, p4, p5, p6, p7, i8]
+i238 = getfield_gc(p12, descr=<NonGcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc 40>)
+setfield_gc(p181, ConstPtr(ptr239), descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_last_exception 88>)
+i240 = int_is_true(i238)
+guard_false(i240, descr=<Guard237>) [p1, p0, p235, p181, p12, p179, p2, p3, p22, p4, p5, p6, p7, i8]
+p241 = getfield_gc(p181, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_f_backref 48>)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #64 STORE_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #67 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #70 LOAD_CONST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #73 INPLACE_ADD', 0)
+i243 = int_add(i8, 1)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #74 STORE_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #77 JUMP_ABSOLUTE', 0)
+i245 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i247 = int_sub(i245, 100)
+setfield_raw(38968960, i247, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+setfield_gc(p12, p241, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+setfield_gc(p179, p181, descr=<GcPtrFieldDescr JitVirtualRef.forced 16>)
+setfield_gc(p179, -3, descr=<SignedFieldDescr JitVirtualRef.virtual_token 8>)
+i250 = int_lt(i247, 0)
+guard_false(i250, descr=<Guard238>) [p1, p0, p2, p3, p4, p5, p6, p235, i243, None]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #21 LOAD_FAST', 0)
+jump(p0, p1, p2, p3, p4, p5, p6, p235, i243, f9, i10, i238, p12, p241, descr=<Loop2>)
+[5ed74fc965fa] jit-log-opt-loop}
+[5ed74fe43ee0] {jit-log-opt-loop
+# Loop 3 : entry bridge with 413 ops
+[p0, p1, p2, p3, i4, p5, i6, i7, p8, p9, p10, p11, p12, p13, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #21 LOAD_FAST', 0)
+guard_value(i4, 0, descr=<Guard239>) [i4, p1, p0, p2, p3, p5, i6, i7, p8, p9, p10, p11, p12, p13, p14]
+guard_nonnull_class(p13, 19800744, descr=<Guard240>) [p1, p0, p13, p2, p3, p5, i6, p8, p9, p10, p11, p12, p14]
+guard_value(i6, 0, descr=<Guard241>) [i6, p1, p0, p2, p3, p5, p13, p9, p10, p11, p12, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #24 LOAD_FAST', 0)
+guard_nonnull_class(p12, 19800744, descr=<Guard242>) [p1, p0, p12, p2, p3, p5, p13, p9, p10, p11, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #27 COMPARE_OP', 0)
+f19 = getfield_gc_pure(p13, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f20 = getfield_gc_pure(p12, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+i21 = float_gt(f19, f20)
+guard_true(i21, descr=<Guard243>) [p1, p0, p12, p13, p2, p3, p5, p10, p11, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #30 POP_JUMP_IF_FALSE', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #33 LOAD_FAST', 0)
+guard_nonnull_class(p11, ConstClass(W_IntObject), descr=<Guard244>) [p1, p0, p11, p2, p3, p5, p10, p12, p13, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #36 POP_JUMP_IF_FALSE', 0)
+i23 = getfield_gc_pure(p11, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i24 = int_is_true(i23)
+guard_true(i24, descr=<Guard245>) [p1, p0, p11, p2, p3, p5, p10, p12, p13, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #39 LOAD_FAST', 0)
+guard_nonnull_class(p14, ConstClass(W_IntObject), descr=<Guard246>) [p1, p0, p14, p2, p3, p5, p10, p11, p12, p13]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #42 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #45 COMPARE_OP', 0)
+i26 = getfield_gc_pure(p14, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i27 = int_ge(i26, i23)
+guard_false(i27, descr=<Guard247>) [p1, p0, p11, p14, p2, p3, p5, p10, p12, p13]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #48 POP_JUMP_IF_FALSE', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #55 LOAD_GLOBAL', 0)
+guard_value(p2, ConstPtr(ptr28), descr=<Guard248>) [p1, p0, p2, p3, p5, p10, p11, p12, p13, p14]
+p29 = getfield_gc(p0, descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+guard_value(p29, ConstPtr(ptr30), descr=<Guard249>) [p1, p0, p29, p3, p5, p10, p11, p12, p13, p14]
+p31 = getfield_gc(p29, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p31, descr=<Guard250>) [p1, p0, p31, p29, p3, p5, p10, p11, p12, p13, p14]
+p33 = getfield_gc(ConstPtr(ptr32), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p33, ConstClass(Function), descr=<Guard251>) [p1, p0, p33, p3, p5, p10, p11, p12, p13, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #58 LOAD_FAST', 0)
+guard_nonnull_class(p10, 19852624, descr=<Guard252>) [p1, p0, p10, p3, p5, p33, p11, p12, p13, p14]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #61 CALL_FUNCTION', 0)
+p36 = getfield_gc(p33, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_code 24>)
+guard_value(p36, ConstPtr(ptr37), descr=<Guard253>) [p1, p0, p36, p33, p3, p5, p10, p11, p12, p13, p14]
+p38 = getfield_gc(p33, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_w_func_globals 64>)
+p39 = getfield_gc(p33, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_closure 16>)
+p41 = call(ConstClass(getexecutioncontext), descr=<GcPtrCallDescr>)
+p42 = getfield_gc(p41, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+i43 = force_token()
+p44 = getfield_gc(p41, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc 72>)
+guard_isnull(p44, descr=<Guard254>) [p1, p0, p41, p44, p3, p5, p33, p10, p11, p12, p13, p14, i43, p42, p38]
+i45 = getfield_gc(p41, descr=<NonGcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc 40>)
+i46 = int_is_zero(i45)
+guard_true(i46, descr=<Guard255>) [p1, p0, p41, p3, p5, p33, p10, p11, p12, p13, p14, i43, p42, p38]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #0 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #3 LOAD_ATTR', 1)
+p47 = getfield_gc(p10, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst_map 48>)
+guard_value(p47, ConstPtr(ptr48), descr=<Guard256>) [p1, p0, p41, p10, p47, p3, p5, p33, p11, p12, p13, p14, i43, p42, p38]
+p50 = getfield_gc(ConstPtr(ptr49), descr=<GcPtrFieldDescr pypy.objspace.std.typeobject.W_TypeObject.inst__version_tag 16>)
+guard_value(p50, ConstPtr(ptr51), descr=<Guard257>) [p1, p0, p41, p10, p50, p3, p5, p33, p11, p12, p13, p14, i43, p42, p38]
+p52 = getfield_gc(p10, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value2 24>)
+guard_nonnull_class(p52, 19800744, descr=<Guard258>) [p1, p0, p41, p52, p10, p3, p5, p33, p11, p12, p13, p14, i43, p42, p38]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #6 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #9 LOAD_ATTR', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #12 BINARY_MULTIPLY', 1)
+f54 = getfield_gc_pure(p52, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f55 = float_mul(f54, f54)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #13 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #16 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #19 LOAD_ATTR', 1)
+p56 = getfield_gc(p10, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value3 32>)
+guard_nonnull_class(p56, 19800744, descr=<Guard259>) [p1, p0, p41, p56, p10, p3, p5, p33, p11, p12, p13, p14, f55, i43, p42, p38]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #22 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #25 LOAD_ATTR', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #28 BINARY_MULTIPLY', 1)
+f58 = getfield_gc_pure(p56, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+f59 = float_mul(f58, f58)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #29 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #32 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #35 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #38 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #41 BINARY_ADD', 1)
+f60 = float_add(f55, f59)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #42 BINARY_DIVIDE', 1)
+i62 = float_eq(f60, 0.000000)
+guard_false(i62, descr=<Guard260>) [p1, p0, p41, f60, p3, p5, p33, p10, p11, p12, p13, p14, f59, f55, i43, p42, p38]
+f64 = float_truediv(0.500000, f60)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #43 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #46 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #49 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #52 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #55 LOAD_ATTR', 1)
+p65 = getfield_gc(p10, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value0 8>)
+guard_nonnull_class(p65, ConstClass(W_IntObject), descr=<Guard261>) [p1, p0, p41, p65, p10, p3, p5, p33, p11, p12, p13, p14, f64, f59, f55, i43, p42, p38]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #58 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #61 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #64 LOAD_ATTR', 1)
+p67 = getfield_gc(p10, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value1 16>)
+guard_nonnull_class(p67, ConstClass(W_IntObject), descr=<Guard262>) [p1, p0, p41, p67, p10, p3, p5, p33, p11, p12, p13, p14, p65, f64, f59, f55, i43, p42, p38]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #67 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #70 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #73 LOAD_ATTR', 1)
+p69 = getfield_gc(p10, descr=<GcPtrFieldDescr pypy.objspace.std.mapdict.W_ObjectObjectSize5.inst__value4 40>)
+guard_nonnull_class(p69, 19886912, descr=<Guard263>) [p1, p0, p41, p69, p10, p3, p5, p33, p11, p12, p13, p14, p67, p65, f64, f59, f55, i43, p42, p38]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #76 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #79 SETUP_LOOP', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #82 LOAD_GLOBAL', 1)
+guard_value(p38, ConstPtr(ptr71), descr=<Guard264>) [p1, p0, p41, p38, p3, p5, p33, p10, p11, p12, p13, p14, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p73 = getfield_gc(p38, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p73, descr=<Guard265>) [p1, p0, p41, p73, p38, p3, p5, p33, p10, p11, p12, p13, p14, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p75 = getfield_gc(ConstPtr(ptr74), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_isnull(p75, descr=<Guard266>) [p1, p0, p41, p75, p3, p5, p33, p10, p11, p12, p13, p14, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p77 = getfield_gc(ConstPtr(ptr76), descr=<GcPtrFieldDescr pypy.interpreter.module.Module.inst_w_dict 8>)
+guard_value(p77, ConstPtr(ptr78), descr=<Guard267>) [p1, p0, p41, p77, p3, p5, p33, p10, p11, p12, p13, p14, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p79 = getfield_gc(p77, descr=<GcPtrFieldDescr pypy.objspace.std.dictmultiobject.W_DictMultiObject.inst_r_dict_content 8>)
+guard_isnull(p79, descr=<Guard268>) [p1, p0, p41, p79, p77, p3, p5, p33, p10, p11, p12, p13, p14, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p81 = getfield_gc(ConstPtr(ptr80), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_value(p81, ConstPtr(ptr82), descr=<Guard269>) [p1, p0, p41, p81, p3, p5, p33, p10, p11, p12, p13, p14, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #85 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #88 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #91 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #94 BINARY_SUBTRACT', 1)
+i83 = getfield_gc_pure(p65, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i85 = int_sub_ovf(i83, 1)
+guard_no_overflow(, descr=<Guard270>) [p1, p0, p41, p65, i85, p3, p5, p33, p10, p11, p12, p13, p14, p81, p69, p67, None, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #95 CALL_FUNCTION', 1)
+p87 = getfield_gc(ConstPtr(ptr86), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_name 40>)
+p88 = getfield_gc(ConstPtr(ptr86), descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_defs 32>)
+i89 = getfield_gc_pure(p88, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i89, descr=<Guard271>) [p1, p0, p41, p87, p88, p3, p5, p33, p10, p11, p12, p13, p14, i85, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p90 = getfield_gc_pure(p88, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+i91 = arraylen_gc(p90, descr=<GcPtrArrayDescr>)
+i93 = int_sub(4, i91)
+i95 = int_ge(3, i93)
+guard_true(i95, descr=<Guard272>) [p1, p0, p41, p87, i93, p88, p3, p5, p33, p10, p11, p12, p13, p14, i85, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i96 = int_sub(3, i93)
+i97 = getfield_gc_pure(p88, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i97, descr=<Guard273>) [p1, p0, p41, p87, i96, i93, p88, p3, p5, p33, p10, p11, p12, p13, p14, i85, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p98 = getfield_gc_pure(p88, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+p99 = getarrayitem_gc(p98, i96, descr=<GcPtrArrayDescr>)
+guard_class(p99, ConstClass(W_IntObject), descr=<Guard274>) [p1, p0, p41, p99, p3, p5, p33, p10, p11, p12, p13, p14, i85, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i101 = getfield_gc_pure(p99, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i102 = int_is_zero(i101)
+guard_false(i102, descr=<Guard275>) [p1, p0, p41, i101, i85, p3, p5, p33, p10, p11, p12, p13, p14, p99, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i104 = int_lt(i101, 0)
+guard_false(i104, descr=<Guard276>) [p1, p0, p41, i101, i85, p3, p5, p33, p10, p11, p12, p13, p14, p99, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i106 = int_lt(1, i85)
+guard_true(i106, descr=<Guard277>) [p1, p0, p41, i101, i85, p3, p5, p33, p10, p11, p12, p13, p14, p99, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i107 = int_sub(i85, 1)
+i109 = int_sub(i107, 1)
+i110 = uint_floordiv(i109, i101)
+i112 = int_add(i110, 1)
+i114 = int_lt(i112, 0)
+guard_false(i114, descr=<Guard278>) [p1, p0, p41, i101, i112, p3, p5, p33, p10, p11, p12, p13, p14, p99, i85, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #98 GET_ITER', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #99 FOR_ITER', 1)
+i116 = int_gt(i112, 0)
+guard_true(i116, descr=<Guard279>) [p1, p0, p41, p3, p5, p33, p10, p11, p12, p13, p14, i112, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i117 = int_add(1, i101)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #102 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #105 SETUP_LOOP', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #108 LOAD_GLOBAL', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #111 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #114 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #117 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #120 BINARY_SUBTRACT', 1)
+i118 = getfield_gc_pure(p67, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i120 = int_sub_ovf(i118, 1)
+guard_no_overflow(, descr=<Guard280>) [p1, p0, p41, p67, i120, p3, p5, p33, p10, p11, p12, p13, p14, i110, i117, None, i101, None, None, None, p69, None, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #121 CALL_FUNCTION', 1)
+i121 = getfield_gc_pure(p88, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i121, descr=<Guard281>) [p1, p0, p41, p87, p88, p3, p5, p33, p10, p11, p12, p13, p14, i120, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p122 = getfield_gc_pure(p88, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+i123 = arraylen_gc(p122, descr=<GcPtrArrayDescr>)
+i125 = int_sub(4, i123)
+i127 = int_ge(3, i125)
+guard_true(i127, descr=<Guard282>) [p1, p0, p41, p87, i125, p88, p3, p5, p33, p10, p11, p12, p13, p14, i120, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i128 = int_sub(3, i125)
+i129 = getfield_gc_pure(p88, descr=<BoolFieldDescr pypy.interpreter.function.Defaults.inst_promote 16>)
+guard_false(i129, descr=<Guard283>) [p1, p0, p41, p87, i128, i125, p88, p3, p5, p33, p10, p11, p12, p13, p14, i120, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p130 = getfield_gc_pure(p88, descr=<GcPtrFieldDescr pypy.interpreter.function.Defaults.inst_items 8>)
+p131 = getarrayitem_gc(p130, i128, descr=<GcPtrArrayDescr>)
+guard_class(p131, ConstClass(W_IntObject), descr=<Guard284>) [p1, p0, p41, p131, p3, p5, p33, p10, p11, p12, p13, p14, i120, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i133 = getfield_gc_pure(p131, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+i134 = int_is_zero(i133)
+guard_false(i134, descr=<Guard285>) [p1, p0, p41, i133, i120, p3, p5, p33, p10, p11, p12, p13, p14, p131, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i136 = int_lt(i133, 0)
+guard_false(i136, descr=<Guard286>) [p1, p0, p41, i133, i120, p3, p5, p33, p10, p11, p12, p13, p14, p131, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i138 = int_lt(1, i120)
+guard_true(i138, descr=<Guard287>) [p1, p0, p41, i133, i120, p3, p5, p33, p10, p11, p12, p13, p14, p131, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i139 = int_sub(i120, 1)
+i141 = int_sub(i139, 1)
+i142 = uint_floordiv(i141, i133)
+i144 = int_add(i142, 1)
+i146 = int_lt(i144, 0)
+guard_false(i146, descr=<Guard288>) [p1, p0, p41, i133, i144, p3, p5, p33, p10, p11, p12, p13, p14, p131, i120, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #124 GET_ITER', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 1)
+i148 = int_gt(i144, 0)
+guard_true(i148, descr=<Guard289>) [p1, p0, p41, p3, p5, p33, p10, p11, p12, p13, p14, i144, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+i149 = int_add(1, i133)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #128 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #131 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #134 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #137 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #140 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #141 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #144 BINARY_ADD', 1)
+i150 = int_add_ovf(i83, 1)
+guard_no_overflow(, descr=<Guard290>) [p1, p0, p41, i150, p3, p5, p33, p10, p11, p12, p13, p14, i83, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #145 BINARY_SUBSCR', 1)
+i151 = getfield_gc(p69, descr=<SignedFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_len 32>)
+i152 = int_lt(i150, i151)
+guard_true(i152, descr=<Guard291>) [p1, p0, p41, p69, i150, p3, p5, p33, p10, p11, p12, p13, p14, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, None, p67, p65, f64, f59, f55, i43, p42, None]
+i153 = getfield_gc(p69, descr=<NonGcPtrFieldDescr pypy.module.array.interp_array.W_ArrayTyped.inst_buffer 24>)
+f154 = getarrayitem_raw(i153, i150, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #146 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #149 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #152 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #155 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #158 BINARY_SUBTRACT', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #159 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #162 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #163 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #166 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #167 BINARY_SUBSCR', 1)
+f155 = getarrayitem_raw(i153, 1, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #168 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #171 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #174 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #177 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #178 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #181 BINARY_MULTIPLY', 1)
+i157 = int_mul_ovf(2, i83)
+guard_no_overflow(, descr=<Guard292>) [p1, p0, p41, p65, i157, p3, p5, p33, p10, p11, p12, p13, p14, f154, f155, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, None, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #182 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #185 BINARY_ADD', 1)
+i158 = int_add_ovf(i157, 1)
+guard_no_overflow(, descr=<Guard293>) [p1, p0, p41, i158, p3, p5, p33, p10, p11, p12, p13, p14, i157, f154, f155, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #186 BINARY_SUBSCR', 1)
+i160 = int_lt(i158, 0)
+guard_false(i160, descr=<Guard294>) [p1, p0, p41, p69, i158, i151, p3, p5, p33, p10, p11, p12, p13, p14, None, f154, f155, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, None, p67, p65, f64, f59, f55, i43, p42, None]
+i161 = int_lt(i158, i151)
+guard_true(i161, descr=<Guard295>) [p1, p0, p41, p69, i158, p3, p5, p33, p10, p11, p12, p13, p14, None, f154, f155, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, None, p67, p65, f64, f59, f55, i43, p42, None]
+f162 = getarrayitem_raw(i153, i158, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #187 BINARY_ADD', 1)
+f163 = float_add(f155, f162)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #188 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #191 BINARY_MULTIPLY', 1)
+f164 = float_mul(f163, f59)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #192 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #195 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #198 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #201 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #202 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #205 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #206 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #209 BINARY_SUBTRACT', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #210 BINARY_SUBSCR', 1)
+i165 = int_lt(i83, i151)
+guard_true(i165, descr=<Guard296>) [p1, p0, p41, p69, i83, p3, p5, p33, p10, p11, p12, p13, p14, f164, None, f154, None, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, None, p67, p65, f64, f59, f55, i43, p42, None]
+f166 = getarrayitem_raw(i153, i83, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #211 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #214 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #217 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #220 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #221 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #224 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #225 LOAD_CONST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #228 BINARY_ADD', 1)
+i168 = int_add(i150, 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #229 BINARY_SUBSCR', 1)
+i169 = int_lt(i168, i151)
+guard_true(i169, descr=<Guard297>) [p1, p0, p41, p69, i168, p3, p5, p33, p10, p11, p12, p13, p14, f166, f164, None, f154, None, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, None, p67, p65, f64, f59, f55, i43, p42, None]
+f170 = getarrayitem_raw(i153, i168, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #230 BINARY_ADD', 1)
+f171 = float_add(f166, f170)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #231 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #234 BINARY_MULTIPLY', 1)
+f172 = float_mul(f171, f55)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #235 BINARY_ADD', 1)
+f173 = float_add(f164, f172)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #236 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #239 BINARY_MULTIPLY', 1)
+f174 = float_mul(f173, f64)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #240 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #243 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #246 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #249 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #250 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #253 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #254 STORE_SUBSCR', 1)
+setarrayitem_raw(i153, i150, f174, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #255 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #258 LOAD_GLOBAL', 1)
+p176 = getfield_gc(ConstPtr(ptr175), descr=<GcPtrFieldDescr pypy.objspace.std.celldict.ModuleCell.inst_w_value 8>)
+guard_nonnull_class(p176, ConstClass(Function), descr=<Guard298>) [p1, p0, p41, p176, p3, p5, p33, p10, p11, p12, p13, p14, None, None, None, f154, None, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #261 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #264 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #267 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #270 BINARY_MULTIPLY', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #271 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #274 BINARY_ADD', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #275 BINARY_SUBSCR', 1)
+f178 = getarrayitem_raw(i153, i150, descr=<FloatArrayNoLengthDescr>)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #276 LOAD_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #279 BINARY_SUBTRACT', 1)
+f179 = float_sub(f178, f154)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #280 CALL_FUNCTION', 1)
+p180 = getfield_gc(p176, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_code 24>)
+guard_value(p180, ConstPtr(ptr181), descr=<Guard299>) [p1, p0, p41, p180, p176, p3, p5, p33, p10, p11, p12, p13, p14, f179, None, None, None, f154, None, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+p182 = getfield_gc(p176, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_w_func_globals 64>)
+p183 = getfield_gc(p176, descr=<GcPtrFieldDescr pypy.interpreter.function.Function.inst_closure 16>)
+i184 = force_token()
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #0 LOAD_FAST', 2)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #3 LOAD_FAST', 2)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #6 BINARY_MULTIPLY', 2)
+f185 = float_mul(f179, f179)
+debug_merge_point('<code object sqr, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 7> #7 RETURN_VALUE', 2)
+i186 = int_is_true(i45)
+guard_false(i186, descr=<Guard300>) [p1, p0, p41, p3, p5, p33, p10, p11, p12, p13, p14, p182, i184, p176, f185, f179, None, None, None, f154, None, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #283 INPLACE_ADD', 1)
+f188 = float_add(0.000000, f185)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #284 STORE_FAST', 1)
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #287 JUMP_ABSOLUTE', 1)
+i190 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i192 = int_sub(i190, 100)
+setfield_raw(38968960, i192, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i194 = int_lt(i192, 0)
+guard_false(i194, descr=<Guard301>) [p1, p0, p41, p3, p5, p33, p10, p11, p12, p13, p14, f188, None, None, None, None, None, None, None, None, f154, None, None, i149, i142, None, i133, None, None, i110, i117, None, i101, None, None, None, p69, p67, p65, f64, f59, f55, i43, p42, None]
+debug_merge_point('<code object time_step, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 34> #125 FOR_ITER', 1)
+i195 = force_token()
+p197 = new_with_vtable(19809200)
+setfield_gc(p197, i43, descr=<SignedFieldDescr JitVirtualRef.virtual_token 8>)
+setfield_gc(p41, p197, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+setfield_gc(p0, i195, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.vable_token 24>)
+p199 = new_with_vtable(19863424)
+setfield_gc(p199, p42, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_f_backref 48>)
+setfield_gc(p199, ConstPtr(ptr71), descr=<GcPtrFieldDescr pypy.interpreter.eval.Frame.inst_w_globals 8>)
+setfield_gc(p199, 34, descr=<INTFieldDescr pypy.interpreter.pyframe.PyFrame.inst_f_lineno 144>)
+setfield_gc(p199, ConstPtr(ptr37), descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_pycode 112>)
+p202 = new_array(8, descr=<GcPtrArrayDescr>)
+p204 = new_with_vtable(19861240)
+setfield_gc(p204, i117, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p204, i110, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+setfield_gc(p204, i101, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+setarrayitem_gc(p202, 0, p204, descr=<GcPtrArrayDescr>)
+p207 = new_with_vtable(19861240)
+setfield_gc(p207, i149, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_current 8>)
+setfield_gc(p207, i142, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_remaining 16>)
+setfield_gc(p207, i133, descr=<SignedFieldDescr pypy.module.__builtin__.functional.W_XRangeIterator.inst_step 24>)
+setarrayitem_gc(p202, 1, p207, descr=<GcPtrArrayDescr>)
+setfield_gc(p199, p202, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_valuestack_w 120>)
+setfield_gc(p199, 125, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.inst_last_instr 96>)
+p211 = new_with_vtable(19865144)
+setfield_gc(p211, 291, descr=<UnsignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_handlerposition 8>)
+setfield_gc(p211, 1, descr=<SignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_valuestackdepth 24>)
+p215 = new_with_vtable(19865144)
+setfield_gc(p215, 295, descr=<UnsignedFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_handlerposition 8>)
+setfield_gc(p211, p215, descr=<GcPtrFieldDescr pypy.interpreter.pyopcode.FrameBlock.inst_previous 16>)
+setfield_gc(p199, p211, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_lastblock 104>)
+p218 = new_array(11, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p218, 0, p10, descr=<GcPtrArrayDescr>)
+p221 = new_with_vtable(19800744)
+setfield_gc(p221, f55, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p218, 1, p221, descr=<GcPtrArrayDescr>)
+p224 = new_with_vtable(19800744)
+setfield_gc(p224, f59, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p218, 2, p224, descr=<GcPtrArrayDescr>)
+p227 = new_with_vtable(19800744)
+setfield_gc(p227, f64, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p218, 3, p227, descr=<GcPtrArrayDescr>)
+p230 = new_with_vtable(19800744)
+setfield_gc(p230, f188, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p218, 4, p230, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p218, 5, p65, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p218, 6, p67, descr=<GcPtrArrayDescr>)
+setarrayitem_gc(p218, 7, p69, descr=<GcPtrArrayDescr>)
+p236 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p236, 1, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+setarrayitem_gc(p218, 8, p236, descr=<GcPtrArrayDescr>)
+p239 = new_with_vtable(ConstClass(W_IntObject))
+setfield_gc(p239, 1, descr=<SignedFieldDescr pypy.objspace.std.intobject.W_IntObject.inst_intval 8>)
+setarrayitem_gc(p218, 9, p239, descr=<GcPtrArrayDescr>)
+p242 = new_with_vtable(19800744)
+setfield_gc(p242, f154, descr=<FloatFieldDescr pypy.objspace.std.floatobject.W_FloatObject.inst_floatval 8>)
+setarrayitem_gc(p218, 10, p242, descr=<GcPtrArrayDescr>)
+setfield_gc(p199, p218, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_fastlocals_w 56>)
+setfield_gc(p199, 2, descr=<SignedFieldDescr pypy.interpreter.pyframe.PyFrame.inst_valuestackdepth 128>)
+p253 = call_assembler(p199, p41, ConstPtr(ptr37), p211, 2, ConstPtr(ptr245), 0, 125, p204, p207, ConstPtr(ptr247), ConstPtr(ptr248), ConstPtr(ptr249), ConstPtr(ptr250), ConstPtr(ptr251), ConstPtr(ptr252), p10, p221, p224, p227, p230, p65, p67, p69, p236, p239, p242, descr=<Loop1>)
+guard_not_forced(, descr=<Guard302>) [p1, p0, p41, p199, p253, p197, p3, p5, p33, p10, p11, p12, p13, p14]
+guard_no_exception(, descr=<Guard303>) [p1, p0, p41, p199, p253, p197, p3, p5, p33, p10, p11, p12, p13, p14]
+p254 = getfield_gc(p41, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_w_tracefunc 72>)
+guard_isnull(p254, descr=<Guard304>) [p1, p0, p41, p253, p199, p254, p197, p3, p5, p33, p10, p11, p12, p13, p14]
+i255 = ptr_eq(p199, p0)
+guard_false(i255, descr=<Guard305>) [p1, p0, p41, p253, p199, p197, p3, p5, p33, p10, p11, p12, p13, p14]
+i256 = getfield_gc(p41, descr=<NonGcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_profilefunc 40>)
+setfield_gc(p199, ConstPtr(ptr257), descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_last_exception 88>)
+i258 = int_is_true(i256)
+guard_false(i258, descr=<Guard306>) [p1, p0, p253, p199, p41, p197, p3, p5, p33, p10, p11, p12, p13, p14]
+p259 = getfield_gc(p199, descr=<GcPtrFieldDescr pypy.interpreter.pyframe.PyFrame.inst_f_backref 48>)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #64 STORE_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #67 LOAD_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #70 LOAD_CONST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #73 INPLACE_ADD', 0)
+i261 = int_add(i26, 1)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #74 STORE_FAST', 0)
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #77 JUMP_ABSOLUTE', 0)
+i263 = getfield_raw(38968960, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+i265 = int_sub(i263, 100)
+setfield_raw(38968960, i265, descr=<SignedFieldDescr pypysig_long_struct.c_value 0>)
+setfield_gc(p41, p259, descr=<GcPtrFieldDescr pypy.interpreter.executioncontext.ExecutionContext.inst_topframeref 56>)
+setfield_gc(p197, p199, descr=<GcPtrFieldDescr JitVirtualRef.forced 16>)
+setfield_gc(p197, -3, descr=<SignedFieldDescr JitVirtualRef.virtual_token 8>)
+i268 = int_lt(i265, 0)
+guard_false(i268, descr=<Guard307>) [p1, p0, p3, p5, p10, p11, p12, p253, i261]
+debug_merge_point('<code object laplace_solve, file '/home/alex/projects/hack/benchmarks/laplace/laplace.py', line 52> #21 LOAD_FAST', 0)
+jump(p0, p1, p3, p5, p10, p11, p12, p253, i261, f20, i23, i256, p41, p259, descr=<Loop2>)
+[5ed74ff695c8] jit-log-opt-loop}
+[5ed8737e9776] {jit-backend-counts
+0:493724565
+1:2281802
+2:1283242
+3:993105
+4:2933
+5:2163
+6:2492
+7:1799
+8:963
+9:36
+[5ed8737ee19c] jit-backend-counts}
index 1f609e324b2bfbdf9974a4427a9af65c46d224a4..8ac102e63273a13bba8e1b10a3a065c9411ad1f1 100644 (file)
@@ -10,6 +10,9 @@ while x<10000
 g=%w{}
 x=0
 
+#leere regex
+test //, 123
+
 while x<100
  puts"#{g[x]}"
  x+=1
diff --git a/tests/examplefiles/test.vhdl b/tests/examplefiles/test.vhdl
new file mode 100644 (file)
index 0000000..426f237
--- /dev/null
@@ -0,0 +1,161 @@
+library ieee;
+use ieee.std_logic_unsigned.all;
+use ieee.std_logic_1164.all;   
+use ieee.numeric_std.all;
+
+
+entity top_testbench is --test
+       generic ( -- test
+           n : integer := 8 -- test
+       ); -- test
+end top_testbench; -- test
+
+
+architecture top_testbench_arch of top_testbench is  
+
+    component top is
+        generic (
+            n : integer
+        )   ;
+        port (
+            clk : in std_logic;
+            rst : in std_logic;
+            d1 : in std_logic_vector (n-1 downto 0);
+            d2 : in std_logic_vector (n-1 downto 0);
+            operation : in std_logic;
+            result : out std_logic_vector (2*n-1 downto 0)
+        );
+    end component;
+
+    signal clk : std_logic;
+    signal rst : std_logic;
+       signal operation : std_logic;
+    signal d1 : std_logic_vector (n-1 downto 0);
+    signal d2 : std_logic_vector (n-1 downto 0);
+    signal result : std_logic_vector (2*n-1 downto 0);
+    
+    type test_type is ( a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+    attribute enum_encoding of my_state : type is "001 010 011 100 111";
+begin
+
+    TESTUNIT : top generic map (n => n)
+                   port map (clk => clk,
+                             rst => rst,
+                             d1  => d1,
+                             d2  => d2,
+                             operation => operation,
+                             result => result);
+
+    clock_process : process
+    begin
+        clk <= '0';
+        wait for 5 ns;
+        clk <= '1';
+        wait for 5 ns;
+    end process;
+
+    data_process : process
+    begin       
+               
+               -- test case #1 
+               operation <= '0';
+               
+        rst <= '1';
+        wait for 5 ns;
+        rst <= '0';
+        wait for 5 ns;
+               
+               d1 <= std_logic_vector(to_unsigned(60, d1'length));
+               d2 <= std_logic_vector(to_unsigned(12, d2'length));
+               wait for 360 ns;
+               
+               assert (result = std_logic_vector(to_unsigned(720, result'length)))
+                       report "Test case #1 failed" severity error; 
+            
+               -- test case #2 
+               operation <= '0';
+               
+        rst <= '1';
+        wait for 5 ns;
+        rst <= '0';
+        wait for 5 ns;
+               
+               d1 <= std_logic_vector(to_unsigned(55, d1'length));
+               d2 <= std_logic_vector(to_unsigned(1, d2'length));
+               wait for 360 ns;
+               
+               assert (result = std_logic_vector(to_unsigned(55, result'length)))
+                       report "Test case #2 failed" severity error;
+            
+        -- etc 
+            
+    end process;
+
+end top_testbench_arch;
+
+
+configuration testbench_for_top of top_testbench is
+       for top_testbench_arch
+               for TESTUNIT : top
+                       use entity work.top(top_arch);
+               end for;
+       end for;
+end testbench_for_top;
+
+
+function compare(A: std_logic, B: std_Logic) return std_logic is
+    constant pi : real := 3.14159;
+    constant half_pi : real := pi / 2.0;
+    constant cycle_time : time := 2 ns;
+    constant N, N5 : integer := 5;
+begin
+    if (A = '0' and B = '1') then
+        return B;
+    else
+        return A;
+    end if ;
+end compare;
+
+
+procedure print(P : std_logic_vector(7 downto 0);
+                U : std_logic_vector(3 downto 0)) is
+    variable my_line : line;
+    alias swrite is write [line, string, side, width] ;
+begin
+    swrite(my_line, "sqrt( ");
+    write(my_line, P);
+    swrite(my_line, " )= ");
+    write(my_line, U);
+    writeline(output, my_line);
+end print;
+
+
+entity add32csa is          -- one stage of carry save adder for multiplier
+  port(
+    b       : in  std_logic;                      -- a multiplier bit
+    a       : in  std_logic_vector(31 downto 0);  -- multiplicand
+    sum_in  : in  std_logic_vector(31 downto 0);  -- sums from previous stage
+    cin     : in  std_logic_vector(31 downto 0);  -- carrys from previous stage
+    sum_out : out std_logic_vector(31 downto 0);  -- sums to next stage
+    cout    : out std_logic_vector(31 downto 0)); -- carrys to next stage
+end add32csa;
+
+
+ARCHITECTURE circuits of add32csa IS
+  SIGNAL zero : STD_LOGIC_VECTOR(31 downto 0) := X"00000000";
+  SIGNAL aa : std_logic_vector(31 downto 0) := X"00000000";
+  
+  COMPONENT fadd    -- duplicates entity port
+    PoRT(a    : in  std_logic;
+         b    : in  std_logic;
+         cin  : in  std_logic;
+         s    : out std_logic;
+         cout : out std_logic);
+  end comPonent fadd;
+  
+begin  -- circuits of add32csa
+  aa <= a when b='1' else zero after 1 ns;
+  stage: for I in 0 to 31 generate
+    sta: fadd port map(aa(I), sum_in(I), cin(I) , sum_out(I), cout(I));
+  end generate stage;  
+end architecture circuits; -- of add32csa
index 2d6fc36885fab9a2bd1170e22f4bc974aab6bca8..7929d7430e643d1ad01bfba781141c8585d94791 100644 (file)
@@ -8,7 +8,7 @@
         python run.py [testfile ...]
 
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 954f6f78fb9d57bc5123f4c7e5e83d213f94b830..ef92fe096d4ce2fe23cba214b2693a098c51be28 100644 (file)
@@ -8,7 +8,7 @@
         python run.py [testfile ...]
 
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index e8b9cf9ab6256bbe754ff97c815608afbae89378..b0fc2ce065380eef5c21fec447586e436965c596 100644 (file)
@@ -3,7 +3,7 @@
     Pygments basic API tests
     ~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -42,6 +42,8 @@ def test_lexer_classes():
                    "%s: %s attribute wrong" % (cls, attr)
         result = cls.analyse_text("abc")
         assert isinstance(result, float) and 0.0 <= result <= 1.0
+        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):
@@ -55,6 +57,9 @@ def test_lexer_classes():
                 assert 'root' in cls._tokens, \
                        '%s has no root state' % cls
 
+        if cls.name in ['XQuery', 'Opa']:   # XXX temporary
+            return
+
         tokens = list(inst.get_tokens(test_content))
         txt = ""
         for token in tokens:
@@ -87,7 +92,8 @@ def test_lexer_options():
         if cls.__name__ not in (
             'PythonConsoleLexer', 'RConsoleLexer', 'RubyConsoleLexer',
             'SqliteConsoleLexer', 'MatlabSessionLexer', 'ErlangShellLexer',
-            'BashSessionLexer', 'LiterateHaskellLexer'):
+            'BashSessionLexer', 'LiterateHaskellLexer', 'PostgresConsoleLexer',
+            'ElixirConsoleLexer'):
             inst = cls(ensurenl=False)
             ensure(inst.get_tokens('a\nb'), 'a\nb')
             inst = cls(ensurenl=False, stripall=True)
@@ -115,6 +121,15 @@ def test_get_lexers():
                        ]:
         yield verify, func, args
 
+    for cls, (_, lname, aliases, _, mimetypes) in lexers.LEXERS.iteritems():
+        assert cls == lexers.find_lexer_class(lname).__name__
+
+        for alias in aliases:
+            assert cls == lexers.get_lexer_by_name(alias).__class__.__name__
+
+        for mimetype in mimetypes:
+            assert cls == lexers.get_lexer_for_mimetype(mimetype).__class__.__name__
+
 
 def test_formatter_public_api():
     ts = list(lexers.PythonLexer().get_tokens("def f(): pass"))
index c172116c5a43d97565d082b8f0836cd9f8412351..08fb42cf864c96c80e775c42dcc33e0f40c7620c 100644 (file)
@@ -3,7 +3,7 @@
     Basic CLexer Test
     ~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 151346070e17e8b36ff6b283a90737eaa3469324..6a285fcc699fb94d30dabe9b9327c141020680d3 100644 (file)
@@ -3,7 +3,7 @@
     Command line test
     ~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 877cbecf305926450fe95873840c8f18a07618d6..4ab2912ee814825600f5c9442cdb164032db7afc 100644 (file)
@@ -3,7 +3,7 @@
     Pygments tests with example files
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -60,10 +60,13 @@ def check_lexer(lx, absfn, outfn):
     tokens = []
     for type, val in lx.get_tokens(text):
         ntext.append(val)
-        assert type != Error, 'lexer %s generated error token for %s' % \
-                (lx, absfn)
+        assert type != Error, \
+            'lexer %s generated error token for %s: %r at position %d' % \
+            (lx, absfn, val, len(u''.join(ntext)))
         tokens.append((type, val))
     if u''.join(ntext) != text:
+        print '\n'.join(difflib.unified_diff(u''.join(ntext).splitlines(),
+                                             text.splitlines()))
         raise AssertionError('round trip failed for ' + absfn)
 
     # check output against previous run if enabled
index ae54b9190ecff7731f32ea1d944fd2cf6c19eb28..b0b36c4d99dabd2c20a70b7fb2326afba6aca9c9 100644 (file)
@@ -3,7 +3,7 @@
     Pygments HTML formatter tests
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -75,6 +75,38 @@ class HtmlFormatterTest(unittest.TestCase):
             fmt = HtmlFormatter(**optdict)
             fmt.format(tokensource, outfile)
 
+    def test_linenos(self):
+        optdict = dict(linenos=True)
+        outfile = StringIO.StringIO()
+        fmt = HtmlFormatter(**optdict)
+        fmt.format(tokensource, outfile)
+        html = outfile.getvalue()
+        self.assert_(re.search("<pre>\s+1\s+2\s+3", html))
+
+    def test_linenos_with_startnum(self):
+        optdict = dict(linenos=True, linenostart=5)
+        outfile = StringIO.StringIO()
+        fmt = HtmlFormatter(**optdict)
+        fmt.format(tokensource, outfile)
+        html = outfile.getvalue()
+        self.assert_(re.search("<pre>\s+5\s+6\s+7", html))
+
+    def test_lineanchors(self):
+        optdict = dict(lineanchors="foo")
+        outfile = StringIO.StringIO()
+        fmt = HtmlFormatter(**optdict)
+        fmt.format(tokensource, outfile)
+        html = outfile.getvalue()
+        self.assert_(re.search("<pre><a name=\"foo-1\">", html))
+
+    def test_lineanchors_with_startnum(self):
+        optdict = dict(lineanchors="foo", linenostart=5)
+        outfile = StringIO.StringIO()
+        fmt = HtmlFormatter(**optdict)
+        fmt.format(tokensource, outfile)
+        html = outfile.getvalue()
+        self.assert_(re.search("<pre><a name=\"foo-5\">", html))
+
     def test_valid_output(self):
         # test all available wrappers
         fmt = HtmlFormatter(full=True, linenos=True, noclasses=True,
index dc8231bebee476ad0c0f9d9294c8a98701576f72..0c9c9122d57598c6afa5739e8f8891b6b251b130 100644 (file)
@@ -3,7 +3,7 @@
     Pygments LaTeX formatter tests
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
diff --git a/tests/test_perllexer.py b/tests/test_perllexer.py
new file mode 100644 (file)
index 0000000..b9c3cb7
--- /dev/null
@@ -0,0 +1,137 @@
+# -*- coding: utf-8 -*-
+"""
+    Pygments regex lexer tests
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+import time
+import unittest
+
+from pygments.token import String
+from pygments.lexers.agile import PerlLexer
+
+
+class RunawayRegexTest(unittest.TestCase):
+    # A previous version of the Perl lexer would spend a great deal of
+    # time backtracking when given particular strings.  These tests show that
+    # the runaway backtracking doesn't happen any more (at least for the given
+    # cases).
+
+    lexer = PerlLexer()
+
+    ### Test helpers.
+
+    def assert_single_token(self, s, token):
+        """Show that a given string generates only one token."""
+        tokens = list(self.lexer.get_tokens_unprocessed(s))
+        self.assertEqual(len(tokens), 1, tokens)
+        self.assertEqual(s, tokens[0][2])
+        self.assertEqual(token, tokens[0][1])
+
+    def assert_tokens(self, strings, expected_tokens):
+        """Show that a given string generates the expected tokens."""
+        tokens = list(self.lexer.get_tokens_unprocessed(''.join(strings)))
+        self.assertEqual(len(tokens), len(expected_tokens), tokens)
+        for index, s in enumerate(strings):
+            self.assertEqual(s, tokens[index][2])
+            self.assertEqual(expected_tokens[index], tokens[index][1])
+
+    def assert_fast_tokenization(self, s):
+        """Show that a given string is tokenized quickly."""
+        start = time.time()
+        tokens = list(self.lexer.get_tokens_unprocessed(s))
+        end = time.time()
+        # Isn't 10 seconds kind of a long time?  Yes, but we don't want false
+        # positives when the tests are starved for CPU time.
+        if end-start > 10:
+            self.fail('tokenization took too long')
+        return tokens
+
+    ### Strings.
+
+    def test_single_quote_strings(self):
+        self.assert_single_token(r"'foo\tbar\\\'baz'", String)
+        self.assert_fast_tokenization("'" + '\\'*999)
+
+    def test_double_quote_strings(self):
+        self.assert_single_token(r'"foo\tbar\\\"baz"', String)
+        self.assert_fast_tokenization('"' + '\\'*999)
+
+    def test_backtick_strings(self):
+        self.assert_single_token(r'`foo\tbar\\\`baz`', String.Backtick)
+        self.assert_fast_tokenization('`' + '\\'*999)
+
+    ### Regex matches with various delimiters.
+
+    def test_match(self):
+        self.assert_single_token(r'/aa\tbb/', String.Regex)
+        self.assert_fast_tokenization('/' + '\\'*999)
+
+    def test_match_with_slash(self):
+        self.assert_tokens(['m', '/\n\\t\\\\/'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m/xxx\n' + '\\'*999)
+
+    def test_match_with_bang(self):
+        self.assert_tokens(['m', r'!aa\t\!bb!'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m!' + '\\'*999)
+
+    def test_match_with_brace(self):
+        self.assert_tokens(['m', r'{aa\t\}bb}'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m{' + '\\'*999)
+
+    def test_match_with_angle_brackets(self):
+        self.assert_tokens(['m', r'<aa\t\>bb>'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m<' + '\\'*999)
+
+    def test_match_with_parenthesis(self):
+        self.assert_tokens(['m', r'(aa\t\)bb)'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m(' + '\\'*999)
+
+    def test_match_with_at_sign(self):
+        self.assert_tokens(['m', r'@aa\t\@bb@'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m@' + '\\'*999)
+
+    def test_match_with_percent_sign(self):
+        self.assert_tokens(['m', r'%aa\t\%bb%'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m%' + '\\'*999)
+
+    def test_match_with_dollar_sign(self):
+        self.assert_tokens(['m', r'$aa\t\$bb$'], [String.Regex, String.Regex])
+        self.assert_fast_tokenization('m$' + '\\'*999)
+
+    ### Regex substitutions with various delimeters.
+
+    def test_substitution_with_slash(self):
+        self.assert_single_token('s/aaa/bbb/g', String.Regex)
+        self.assert_fast_tokenization('s/foo/' + '\\'*999)
+
+    def test_substitution_with_at_sign(self):
+        self.assert_single_token(r's@aaa@bbb@g', String.Regex)
+        self.assert_fast_tokenization('s@foo@' + '\\'*999)
+
+    def test_substitution_with_percent_sign(self):
+        self.assert_single_token(r's%aaa%bbb%g', String.Regex)
+        self.assert_fast_tokenization('s%foo%' + '\\'*999)
+
+    def test_substitution_with_brace(self):
+        self.assert_single_token(r's{aaa}', String.Regex)
+        self.assert_fast_tokenization('s{' + '\\'*999)
+
+    def test_substitution_with_angle_bracket(self):
+        self.assert_single_token(r's<aaa>', String.Regex)
+        self.assert_fast_tokenization('s<' + '\\'*999)
+
+    def test_substitution_with_angle_bracket(self):
+        self.assert_single_token(r's<aaa>', String.Regex)
+        self.assert_fast_tokenization('s<' + '\\'*999)
+
+    def test_substitution_with_square_bracket(self):
+        self.assert_single_token(r's[aaa]', String.Regex)
+        self.assert_fast_tokenization('s[' + '\\'*999)
+
+    def test_substitution_with_parenthesis(self):
+        self.assert_single_token(r's(aaa)', String.Regex)
+        self.assert_fast_tokenization('s(' + '\\'*999)
index f9c1b7ac2e3d9dc0df1964bdaa9d9db851df86fe..fbb71ad67948f244c0d8cecc311e8a55ef48a288 100644 (file)
@@ -3,7 +3,7 @@
     Pygments regex lexer tests
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 9a836845d7723f8eb6a4f812bf94b1c88aaf4d39..490c966c1bf3fc1f704cee66a1a84170274b8996 100644 (file)
@@ -3,7 +3,7 @@
     Test suite for the token module
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 3d824f51986fa101010e4409f7f6e04e651bdca5..e645a881388adf557865ea900d548a33e8f719a4 100644 (file)
@@ -3,7 +3,7 @@
     Pygments tests for using()
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index b0fc2579aa6dfbf101feb49694941fb9fa4d54d7..d994e5fa051fc718c751b9b89320e096ade75a16 100644 (file)
@@ -3,7 +3,7 @@
     Test suite for the util module
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -13,6 +13,12 @@ import os
 from pygments import util
 
 
+class FakeLexer(object):
+    def analyse(text):
+        return float(text)
+    analyse = util.make_analysator(analyse)
+
+
 class UtilTest(unittest.TestCase):
 
     def test_getoptions(self):
@@ -53,12 +59,36 @@ class UtilTest(unittest.TestCase):
         self.assertEquals(util.docstring_headline(f1), "docstring headline")
         self.assertEquals(util.docstring_headline(f2), "docstring headline")
 
-    def test_analysator(self):
-        class X(object):
+    def test_analysator_returns_float(self):
+        # If an analysator wrapped by make_analysator returns a floating point
+        # number, then that number will be returned by the wrapper.
+        self.assertEquals(FakeLexer.analyse('0.5'), 0.5)
+
+    def test_analysator_returns_boolean(self):
+        # If an analysator wrapped by make_analysator returns a boolean value,
+        # then the wrapper will return 1.0 if the boolean was True or 0.0 if
+        # it was False.
+        self.assertEquals(FakeLexer.analyse(True), 1.0)
+        self.assertEquals(FakeLexer.analyse(False), 0.0)
+
+    def test_analysator_raises_exception(self):
+        # If an analysator wrapped by make_analysator raises an exception,
+        # then the wrapper will return 0.0.
+        class ErrorLexer(object):
             def analyse(text):
-                return 0.5
+                raise RuntimeError('something bad happened')
             analyse = util.make_analysator(analyse)
-        self.assertEquals(X.analyse(''), 0.5)
+        self.assertEquals(ErrorLexer.analyse(''), 0.0)
+
+    def test_analysator_value_error(self):
+        # When converting the analysator's return value to a float a
+        # ValueError may occur.  If that happens 0.0 is returned instead.
+        self.assertEquals(FakeLexer.analyse('bad input'), 0.0)
+
+    def test_analysator_type_error(self):
+        # When converting the analysator's return value to a float a
+        # TypeError may occur.  If that happens 0.0 is returned instead.
+        self.assertEquals(FakeLexer.analyse(None), 0.0)
 
     def test_shebang_matches(self):
         self.assert_(util.shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?'))